summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-02 19:27:36 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-02 16:56:13 -0700
commit82b1b04920fdd5882e0cbf28c9871c2ddd404af8 (patch)
tree964af6d2961b8fb2dc05ee68aeeea7d79fe53150 /qt-ui/modeldelegates.cpp
parentf9c97ff97d072d6a4cb934a50427dc69382281e0 (diff)
downloadsubsurface-82b1b04920fdd5882e0cbf28c9871c2ddd404af8.tar.gz
Test the CSS for styling the TableView
This is a test and I shouldn't be taken seriously. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 87629bd1b..0b3231583 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -7,9 +7,21 @@
#include <QtDebug>
#include <QPainter>
#include <QSortFilterProxyModel>
+#include <QColor>
+#include <QBrush>
+#include <QStyle>
+#include <QStyleOption>
+
+StarWidgetsDelegate::StarWidgetsDelegate(QWidget* parent):
+ QStyledItemDelegate(parent),
+ parentWidget(parent)
+{
+
+}
void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
+ QStyledItemDelegate::paint(painter, option, index);
if (!index.isValid())
return;
@@ -20,8 +32,6 @@ void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
int rating = value.toInt();
- if(option.state & QStyle::State_Selected)
- painter->fillRect(option.rect, option.palette.highlight());
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);