QPoint point = aEvent->pos();
// test whether we have handled the mouse event
- if(!testForControlClicked(index,point))
+ if(!testForControlClicked(index, point, aEvent->button()))
{
// pass the event to the Base class, so item clicks/events are handled correctly
QTreeView::mouseReleaseEvent(aEvent);
}
// returns bool if some Control was clicked
-bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint)
+bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint, Qt::MouseButton button)
{
bool handled = false;
Event event = Event::getById(aIndex.data().toInt(),confId);
QList<Event> conflicts = Event::conflictEvents(event.id(),Conference::activeConference());
- event.cycleFavourite();
+ event.cycleFavourite(button == Qt::RightButton);
event.update("favourite");
// event has became 'favourite' and so 'conflicts' list may have changed
~TreeView() {}
private:
void mouseReleaseEvent(QMouseEvent *aEvent);
- bool testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint);
+ bool testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint, Qt::MouseButton button);
public slots:
void setAllExpanded(bool aExpanded); // (aExpanded==true) => expanded; (aExpanded==false) => collapsed
private slots: