refs #735, allow to reset highlighting

(some leftovers of DB object highlighting also deleted)
This commit is contained in:
Klaus Basan
2016-08-15 21:09:06 +02:00
committed by Mathew Sutcliffe
parent 2434c7bbe2
commit b324a26747
9 changed files with 50 additions and 23 deletions

View File

@@ -36,18 +36,8 @@ namespace BlackGui
QVariant CListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::data(const QModelIndex &index, int role) const
{
if (role != Qt::BackgroundRole) { return CListModelBase<ObjectType, ContainerType, UseCompare>::data(index, role); }
if (isHighlightIndex(index)) { return QBrush(m_highlightColor); }
if (!highlightDbData()) { return CListModelBase<ObjectType, ContainerType, UseCompare>::data(index, role); }
const ObjectType obj(this->at(index));
// highlight DB models
if (obj.hasValidDbKey())
{
static const QBrush b(Qt::green);
return b;
}
return QVariant();
return CListModelBase<ObjectType, ContainerType, UseCompare>::data(index, role);
}
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare>