Changeset c53a3f4 for src/mvc/treeview.cpp
- Timestamp:
- 01/19/10 18:34:18 (13 years ago)
- Branches:
- master, qt5
- Children:
- 395d6d3
- Parents:
- 02c1e09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/treeview.cpp
r02c1e09 rc53a3f4 22 22 QPoint point = aEvent->pos(); 23 23 24 testForControlClicked(index,point); 25 26 // pass the event to the Base class, so item clicks/events are handled correctly 27 QTreeView::mouseReleaseEvent(aEvent); 24 // test whether we have handled the mouse event 25 if(!testForControlClicked(index,point)) 26 { 27 // pass the event to the Base class, so item clicks/events are handled correctly 28 QTreeView::mouseReleaseEvent(aEvent); 29 } 28 30 } 29 31 30 void TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint) 32 // returns bool if some Control was clicked 33 bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint) 31 34 { 35 bool handled = false; 36 32 37 if(!aIndex.isValid()) 33 return ;38 return handled; 34 39 35 40 QRect rect = visualRect(aIndex); // visual QRect of selected/clicked item in the list … … 56 61 // since the Favourite icon has changed, update TreeView accordingly 57 62 static_cast<EventModel*>(model())->emitDataChangedSignal(aIndex,aIndex); 63 handled = true; 58 64 } 59 65 break; … … 89 95 // since the Alarm icon has changed, update TreeView accordingly 90 96 static_cast<EventModel*>(model())->emitDataChangedSignal(aIndex,aIndex); 91 97 handled = true; 92 98 } 93 99 break; … … 97 103 qDebug() << "MAP CLICKED: " << qVariantValue<QString>(aIndex.data()); 98 104 emit(requestForMap(aIndex)); 105 handled = true; 99 106 } 100 107 break; … … 103 110 { 104 111 // item was clicked, but not a control 112 handled = false; 105 113 } 106 114 }; 115 116 return handled; 107 117 } 108 118
Note: See TracChangeset
for help on using the changeset viewer.