CValueObject virtual method toIcon, reprsenting the object as icon where applicable.

Currently used for status messages (severity), will be used for CAtcStation and others as well.
This commit is contained in:
Klaus Basan
2014-02-05 21:33:40 +00:00
committed by Mathew Sutcliffe
parent 4ec1db4b38
commit fda587994d
5 changed files with 34 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
#include <QtGlobal>
#include <QDataStream>
#include <QDebug>
#include <QPixmap>
#include <type_traits>
#include <iostream>
@@ -173,6 +174,12 @@ namespace BlackMisc
*/
virtual QVariant toQVariant() const = 0;
/*!
* \brief As icon, not implement by all classes
* \return
*/
virtual const QPixmap &toIcon() const { static const QPixmap p; return p; }
/*!
* \brief Set property by index
* \remarks Intentionally not abstract, avoiding all classes need to implement this method