- Timestamp:
- 01/17/10 20:31:04 (13 years ago)
- Branches:
- master, qt5
- Children:
- 9f7666d
- Parents:
- 2af8e2f
- Location:
- src/mvc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/eventmodel.cpp
r2af8e2f r67c59a7 144 144 } 145 145 146 void EventModel::emitDataChangedSignal(const QModelIndex &aTopLeft, const QModelIndex &aBottomRight) 147 { 148 emit(dataChanged(aTopLeft,aBottomRight)); 149 } 150 -
src/mvc/eventmodel.h
r2af8e2f r67c59a7 17 17 void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB 18 18 void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB 19 20 // a method to force 'EventModel' emit signal 'dataChanged()' 21 // a 'view', eg. 'TreeView' listens for this signal and redraws changed items(indexes) 22 void emitDataChangedSignal(const QModelIndex &aTopLeft, const QModelIndex &aBottomRight); 19 23 20 24 private: -
src/mvc/treeview.cpp
r2af8e2f r67c59a7 4 4 #include "delegate.h" 5 5 #include "event.h" 6 #include "eventmodel.h" 6 7 7 8 #include <QDebug> … … 49 50 qDebug() << " FAVOURITE [" << qVariantValue<QString>(aIndex.data()) << "] -> " << event.isFavourite(); 50 51 event.update("favourite"); 51 // TODO: since the Favourite icon has changed, update TreeView accordingly 52 // not really working solution is the following 53 // maybe the call to MainWindow->update() fix the problem ??? 54 QTreeView::update(); 55 update(); 52 // since the Favourite icon has changed, update TreeView accordingly 53 static_cast<EventModel*>(model())->emitDataChangedSignal(aIndex,aIndex); 56 54 } 57 55 break;
Note: See TracChangeset
for help on using the changeset viewer.