From 696c9ccacd24392ea63477c5ec8a25d6649aedf7 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 2 May 2013 20:32:57 -0300 Subject: Added code to Select a dive, fixed minor annoyances. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui/modeldelegates.cpp') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 0b3231583..33c1717e6 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -22,10 +22,11 @@ StarWidgetsDelegate::StarWidgetsDelegate(QWidget* parent): void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { QStyledItemDelegate::paint(painter, option, index); + if (!index.isValid()) return; - QVariant value = index.model()->data(index, Qt::DisplayRole); + QVariant value = index.model()->data(index, TreeItemDT::STAR_ROLE); if (!value.isValid()) return; -- cgit v1.2.3-70-g09d2