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

@@ -47,15 +47,19 @@ namespace BlackGui
//! Destructor
virtual ~CListModelDbObjects() {}
//! Highlight the DB models
bool highlightDbData() const { return m_highlightDbData; }
//! Highlight the DB models
void setHighlightDbData(bool highlightDbData) { m_highlightDbData = highlightDbData; }
//! Keys to be highlighted
void setHighlightDbKeys(const QList<KeyType> &keys) { m_highlightKeys = keys; }
//! Clear the highlighted keys
void clearHighlightingDbKeys() { m_highlightKeys.clear(); }
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::clearHighlighting
virtual void clearHighlighting() override
{
this->clearHighlightingDbKeys();
CListModelBase<ObjectType, ContainerType, UseCompare>::clearHighlighting();
}
//! Set color for highlighting
void setHighlightColor(QColor color) { m_highlightColor = color; }
@@ -73,12 +77,10 @@ namespace BlackGui
CListModelDbObjects(const QString &translationContext, QObject *parent = nullptr);
private:
bool m_highlightDbData = false; //!< highlight if DB data entry (valid key)
QList<KeyType> m_highlightKeys; //!< keys to be highlighted
QColor m_highlightColor = Qt::green;
};
//! List model for DB objects
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare = false> class COrderableListModelDbObjects :
public CListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>