summaryrefslogtreecommitdiffstats
path: root/smtreemodel.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-12-28 19:36:05 +0100
committerArno <am@disconnect.de>2011-12-28 19:36:05 +0100
commit83d2b014f563b9de387c4d8e9e45adbb36b56825 (patch)
tree09174bbb145df0967dfe4cd11c0cd829b36db51e /smtreemodel.cpp
parenta18c569e6ffaea7a8a4f387b1c1e4245146e29d8 (diff)
downloadSheMov-83d2b014f563b9de387c4d8e9e45adbb36b56825.tar.gz
SheMov-83d2b014f563b9de387c4d8e9e45adbb36b56825.tar.bz2
SheMov-83d2b014f563b9de387c4d8e9e45adbb36b56825.zip
Mark items in DbAnalyzerDialog
It's now possible to mark items in DbAnalyzerDialog with a different color, when there are no covers or actor information available on the net. I enhanced SmTreeItem to contain a QVariant::foregroundColor, and made SmTreeModel return it when QModelIndex::data with role Qt::ForegroundRole is called. Maybe that could be useful for other things like favorites and such...
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r--smtreemodel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp
index 50a55d0..86d2b77 100644
--- a/smtreemodel.cpp
+++ b/smtreemodel.cpp
@@ -7,6 +7,7 @@
#include <QIcon>
#include <QSettings>
+#include <QBrush>
#include "smtreemodel.h"
#include "smtreeitem.h"
@@ -107,6 +108,10 @@ QVariant SmTreeModel::data(const QModelIndex &index, int role) const{
return mDecorationIcon;
}
}
+ if(role == Qt::ForegroundRole){
+ QColor fgCol = item->foregroundColor().value<QColor>();
+ return QBrush(fgCol);
+ }
return QVariant();
}