diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-04-27 12:27:27 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-04-27 12:27:27 -0300 |
commit | 2f4d6bbe535a195046b4746fd3a771087ee4a6c4 (patch) | |
tree | 60e7e1ea1cdb4518402f90bd0476915fb7f4742d /qt-ui/models.h | |
parent | 1d0d42f861fc3a658eb22b99ba58616d716e095e (diff) | |
download | subsurface-2f4d6bbe535a195046b4746fd3a771087ee4a6c4.tar.gz |
Added support for showing the Stars on the DiveTable
For the stars on the dive table I had to rework a bit my
StarRating widget, because it used a pixmap for each widget
that were created. Not it uses only 2 pixmaps: the active
and inactive ones.
A new file was created named modeldelegates(h, cpp) that
should hold all delegates of the models. For the GTK / C
folks, a 'Delegate' ia s way to bypass the default behavior
of the view that's displaying the data.
I also added the code to display the stars if no delegate
is set ( good for debugging. )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r-- | qt-ui/models.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h index d64faf0bd..f4d9c8d3b 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -9,7 +9,7 @@ #include <QAbstractTableModel> #include "../dive.h" - +#include "../divelist.h" /* Encapsulates the tank_info global variable * to show on Qt`s Model View System.*/ class TankInfoModel : public QAbstractTableModel { @@ -74,11 +74,12 @@ private: /*! An AbstractItemModel for recording dive trip information such as a list of dives. * */ -class DiveItem; // Represents a single item on the model, implemented in the .cpp since it's private for this class. +class DiveItem; class DiveTripModel : public QAbstractItemModel { public: enum Column {NR, DATE, RATING, DEPTH, DURATION, TEMPERATURE, TOTALWEIGHT, SUIT, CYLINDER, NITROX, SAC, OTU, MAXCNS, LOCATION, COLUMNS }; + enum { DelegatesRole = Qt::UserRole }; DiveTripModel(QObject *parent = 0); |