30 #include <QApplication> 45 :
Property(name, text, text, parent), level_(level)
64 if ((
getViewFlags(column) & Qt::ItemIsEnabled) && column == 0 && role == Qt::ForegroundRole)
68 if (column == 0 && role == Qt::DecorationRole)
virtual void setLevel(Level level)
PropertyTreeModel * model_
Pointer to the PropertyTreeModel managing this property tree.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
A single element of a property tree, with a name, value, description, and possibly children...
bool setValue(const QVariant &new_value) override
Set the status text. Overridden from Property.
QIcon statusIcon(Level level) const
virtual void setDescription(const QString &description)
Set the description.
QVariant getViewData(int column, int role) const override
Return data appropriate for the given column (0 or 1) and role for this StatusProperty.
static QString status_words_[3]
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Property. ...
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Property.
static QColor statusColor(Level level)
Return the color appropriate for the given status level.
void setShouldBeSaved(bool save)
If save is true and getReadOnly() is false, shouldBeSaved will return true; otherwise false...
static QString statusWord(Level level)
Return the word appropriate for the given status level: "Ok", "Warn", or "Error". ...
void emitDataChanged(Property *property)
static QColor status_colors_[3]
StatusProperty(const QString &name, const QString &text, Level level, Property *parent)
QPixmap loadPixmap(QString url, bool fill_cache)
Qt::ItemFlags getViewFlags(int column) const override
Return item flags appropriate for the given column (0 or 1) for this StatusProperty.