21 #include <QDataWidgetMapper>
23 #include <QDoubleSpinBox>
24 #include <QGridLayout>
33 , m_dataMapper(new QDataWidgetMapper(this))
37 m_label->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
56 m_editor->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
66 if (valueIndex.isValid())
79 gridLayout->addWidget(
m_label, nrow, 0);
80 gridLayout->addWidget(
m_editor, nrow, 1);
101 if (
auto customEditor =
dynamic_cast<CustomEditor*
>(editor)) {
#define ASSERT(condition)
Defines CustomEditors classes.
Defines namespace SessionItemUtils.
Defines class SessionModelDelegate.
Defines class SessionModel.
Base class for all custom variants editors.
void dataChanged(const QVariant &data)
Signal emit then user changed the data through the editor.
QString displayName() const
Get display name of item, append index if ambigue.
SessionItem * parent() const
Returns parent of this item.
SessionModel * model() const
Returns model of this item.
QModelIndex index() const
Returns model index of this item.
The SessionModelDelegate class presents the content of SessionModel items in standard QTreeView.
void onCustomEditorDataChanged(const QVariant &)
Notifies everyone that the editor has completed editing the data.
void setEditorData(QWidget *editor, const QModelIndex &index) const
Propagates the data change from the model to the editor (if it is still opened).
QVariant ToolTipRole(const SessionItem &item, int ncol=0)
Returns tooltip for given item.