mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
2f4d6bbe53
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>
12 lines
379 B
C++
12 lines
379 B
C++
#ifndef MODELDELEGATES_H
|
|
#define MODELDELEGATES_H
|
|
|
|
#include <QAbstractItemDelegate>
|
|
|
|
class StarWidgetsDelegate : public QAbstractItemDelegate {
|
|
Q_OBJECT
|
|
public:
|
|
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
|
virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
|
};
|
|
#endif
|