QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
DynamicTextItemDelegate Class Reference

#include <dynamicelementtextmodel.h>

Inherits QStyledItemDelegate.

Collaboration diagram for DynamicTextItemDelegate:
Collaboration graph

Public Member Functions

 DynamicTextItemDelegate (QObject *parent=Q_NULLPTR)
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override

Protected Member Functions

bool eventFilter (QObject *object, QEvent *event) override

Private Member Functions

QStringList availableInfo (DynamicElementTextItem *deti) const
 DynamicTextItemDelegate::availableInfo.
void commitAndCloseDeferred (QWidget *editor) const
 commitAndCloseDeferred Schedule commitData()/closeEditor() for editor on the next event loop iteration. For editors resolved synchronously inside createEditor() (font/color, both run their picker dialog before returning) there is no user interaction left to drive the base QStyledItemDelegate::eventFilter()'s usual Enter/focus-out commit path, so without this the value sits picked-but-uncommitted until something unrelated (e.g. clicking elsewhere) happens to trigger it. Deferred rather than called immediately: the view only registers the widget createEditor() returns as "the active editor" after createEditor() itself returns, so emitting here would target an editor the view doesn't know about yet.

Constructor & Destructor Documentation

◆ DynamicTextItemDelegate()

DynamicTextItemDelegate::DynamicTextItemDelegate ( QObject * parent = Q_NULLPTR)
Here is the caller graph for this function:

Member Function Documentation

◆ availableInfo()

QStringList DynamicTextItemDelegate::availableInfo ( DynamicElementTextItem * deti) const
private

DynamicTextItemDelegate::availableInfo.

Parameters
deti
Returns
A list of available info of element
Here is the call graph for this function:
Here is the caller graph for this function:

◆ commitAndCloseDeferred()

void DynamicTextItemDelegate::commitAndCloseDeferred ( QWidget * editor) const
private

commitAndCloseDeferred Schedule commitData()/closeEditor() for editor on the next event loop iteration. For editors resolved synchronously inside createEditor() (font/color, both run their picker dialog before returning) there is no user interaction left to drive the base QStyledItemDelegate::eventFilter()'s usual Enter/focus-out commit path, so without this the value sits picked-but-uncommitted until something unrelated (e.g. clicking elsewhere) happens to trigger it. Deferred rather than called immediately: the view only registers the widget createEditor() returns as "the active editor" after createEditor() itself returns, so emitting here would target an editor the view doesn't know about yet.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createEditor()

QWidget * DynamicTextItemDelegate::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override
Here is the call graph for this function:

◆ eventFilter()

bool DynamicTextItemDelegate::eventFilter ( QObject * object,
QEvent * event )
overrideprotected

◆ setModelData()

void DynamicTextItemDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
override
Here is the call graph for this function:

The documentation for this class was generated from the following files: