Emergency 2017 Dokumentation  v3.0.1
qsf::editor::ObjectPropertiesDelegate Class Reference

The delegate for using the specific display of the different values from the object properties view. More...

#include <ObjectPropertiesDelegate.h>

Public Member Functions

 ObjectPropertiesDelegate (QWidget *qWidgetParent)
 Constructor. More...
 
virtual ~ObjectPropertiesDelegate ()
 Destructor. More...
 
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
virtual void destroyEditor (QWidget *editor, const QModelIndex &index) const override
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const override
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
virtual bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 

Static Public Attributes

static const uint32 PLUGINABLE_ID
 "qsf::editor::ObjectPropertiesDelegate" unique pluginable view ID More...
 

Detailed Description

The delegate for using the specific display of the different values from the object properties view.

Remarks
Uses the Qt model/view principle to show a data model with a view. The delegate is a extra layer on the view for displaying different via own input style, like colors via color dialog, filenames via file dialog, etc. See Qt documentation for more information http://qt-project.org/doc/qt-4.8/model-view-programming.html#delegate-classes We derived from QStyledItemDelegate because it has more functionality see for more information http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html#qstyleditemdelegate-vs-qitemdelegate

We check the different property values for a style tag and display it via an extra "editor"-widget. We can use our own painting style by creating a "QStyleOptionViewItem" class.

We have two ways for editing and display the values:

  1. Create a editor widget and handle everything inside of this extra widget, use createEditor, setEditorData, setModelData
  2. Use paint/editorEvent function to display the values directly, handle input in editorEvent function

Workflow from 1.

Todo:

Definition at line 70 of file ObjectPropertiesDelegate.h.

Constructor & Destructor Documentation

qsf::editor::ObjectPropertiesDelegate::ObjectPropertiesDelegate ( QWidget *  qWidgetParent)
explicit

Constructor.

Parameters
[in]qWidgetParentPointer to parent Qt widget, can be a null pointer (in this case you're responsible for destroying this delegate instance)
virtual qsf::editor::ObjectPropertiesDelegate::~ObjectPropertiesDelegate ( )
virtual

Destructor.

Member Function Documentation

virtual QWidget* qsf::editor::ObjectPropertiesDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual
virtual void qsf::editor::ObjectPropertiesDelegate::destroyEditor ( QWidget *  editor,
const QModelIndex &  index 
) const
overridevirtual
virtual bool qsf::editor::ObjectPropertiesDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
overridevirtual
virtual void qsf::editor::ObjectPropertiesDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual
virtual void qsf::editor::ObjectPropertiesDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
overridevirtual
virtual void qsf::editor::ObjectPropertiesDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
overridevirtual
virtual QSize qsf::editor::ObjectPropertiesDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual
virtual void qsf::editor::ObjectPropertiesDelegate::updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual

Member Data Documentation

const uint32 qsf::editor::ObjectPropertiesDelegate::PLUGINABLE_ID
static

"qsf::editor::ObjectPropertiesDelegate" unique pluginable view ID

Definition at line 85 of file ObjectPropertiesDelegate.h.


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