12#ifndef COLORING_RULE_DELEGATE_H
13#define COLORING_RULE_DELEGATE_H
17#include <QStyledItemDelegate>
41 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
42 const QModelIndex &index)
const;
50 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
51 const QModelIndex &index)
const;
58 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
66 void setModelData(QWidget *editor, QAbstractItemModel *model,
67 const QModelIndex &index)
const;
76 const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
84 void invalidField(
const QModelIndex &index,
const QString& errMessage)
const;
97 void ruleNameChanged(
const QString name);
A delegate for rendering and editing coloring rules in a view.
Definition coloring_rules_delegate.h:24
void validField(const QModelIndex &index) const
Signal emitted when a field contains valid data.
void setEditorData(QWidget *editor, const QModelIndex &index) const
Sets the data for the editor from the model.
Definition coloring_rules_delegate.cpp:88
void invalidField(const QModelIndex &index, const QString &errMessage) const
Signal emitted when a field contains invalid data.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Creates an editor widget for editing a coloring rule.
Definition coloring_rules_delegate.cpp:65
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Sets the data in the model from the editor.
Definition coloring_rules_delegate.cpp:110
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Paints the coloring rule item.
Definition coloring_rules_delegate.cpp:21
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
Updates the geometry of the editor.
Definition coloring_rules_delegate.cpp:151