![]() |
tuchulcha
0.10.1
Graphical Workflow Configuration Editor
|
delegate to handle parameter types and offer specialized editors More...
#include <InspectorDelegate.h>

Public Member Functions | |
| InspectorDelegate (QObject *parent=0) | |
| standart constructor More... | |
| virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| create own editors, if necessary More... | |
| bool | eventFilter (QObject *object, QEvent *event) |
| filter editor events More... | |
| virtual void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| Sets the data for the item at the given index in the model to the contents of the given editor. More... | |
Protected Slots | |
| void | _handleCloseEditor (QWidget *, QAbstractItemDelegate::EndEditHint) |
| reset working dir | |
| void | _setFileDialogFlag (bool flag) |
| set _fileDialogFlag | |
Protected Attributes | |
| bool | _fileDialogFlag |
| file dialog opened | |
| QString | _workingDir |
| cache | |
This delegate takes care of showing eanough digits of float/double values and of file/path specialized editors as well as dropdown selections. Editors for int/float/double/string/etc. are handled by the default editors of the QStyledItemDelegate, only the digit number is fixed.
The following special types are recognized:
fileopen, openfile: open file editorfilewrite, writefile, filename: write file editorpath: path selection editor{opt1,opt2,opt3}: selection editor (dropdown box, replace optX by the string options you want) Definition at line 56 of file InspectorDelegate.h.
| InspectorDelegate::InspectorDelegate | ( | QObject * | parent = 0 | ) |
parent is passed to QStyledItemDelegate constructor
| parent | parent widget |
Definition at line 48 of file InspectorDelegate.cpp.
References _handleCloseEditor().
|
virtual |
Returns the widget used to edit the item specified by index for editing. The parent widget and style option are used to control how the editor widget appears.
| parent | parent widget |
| option | style option |
| index | model index |
Definition at line 55 of file InspectorDelegate.cpp.
References _setFileDialogFlag(), _workingDir, QDirEdit::acceptFiles(), ParameterFileModel::data(), exists(), ParameterFileModel::fileName(), ParameterFileModel::getType(), ParameterFileModel::onlyParams(), ParameterFileModel::prefix(), and type().
| bool InspectorDelegate::eventFilter | ( | QObject * | object, |
| QEvent * | event | ||
| ) |
workaround for what looks like a bug in Qt on Mac OS X where it doesn't create a QWidget wrapper for the native file dialog so the Qt library ends up assuming the focus was lost to something else
| object | event object |
| event | event |
| true | event has to be handled |
Definition at line 170 of file InspectorDelegate.cpp.
References _fileDialogFlag.
|
virtual |
| editor | editor widget |
| model | model |
| index | item index |
Definition at line 132 of file InspectorDelegate.cpp.
References ParameterFileModel::fileName().