JobPropertyDelegate Class Reference

#include <jobpropertydelegate.h>

List of all members.

Public Slots

void sync ()
void slotDestroyed (QObject *object)
void onCustomContextMenuRequested (const QPoint &pos)

Signals

void editorOpened ()
void editorClosed ()

Public Member Functions

 JobPropertyDelegate (QObject *parent)
virtual ~JobPropertyDelegate ()
virtual bool eventFilter (QObject *object, QEvent *event)
 Filters event on the view.
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const

Private Attributes

bool m_syncing
QObject * m_lastEdited


Detailed Description

Delegate on the Treeview of the JobEditorWidget

Definition at line 18 of file jobpropertydelegate.h.


Constructor & Destructor Documentation

JobPropertyDelegate::JobPropertyDelegate ( QObject *  parent  ) 

Construct a JobPropertyDelegate

Parameters:
parent of the delegate

Definition at line 25 of file jobpropertydelegate.cpp.

JobPropertyDelegate::~JobPropertyDelegate (  )  [virtual]

Destroy a JobPropertyDelegate

Definition at line 35 of file jobpropertydelegate.cpp.


Member Function Documentation

bool JobPropertyDelegate::eventFilter ( QObject *  object,
QEvent *  event 
) [virtual]

Filters event on the view.

Used to close the property editor

Parameters:
object where the event comes from/to
event the event

Definition at line 47 of file jobpropertydelegate.cpp.

void JobPropertyDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  opt,
const QModelIndex &  index 
) const [virtual]

Paint the value from the model to the view

Parameters:
painter the painter
opt options on how to view the item
index index in the model for the item to paint

Definition at line 92 of file jobpropertydelegate.cpp.

QSize JobPropertyDelegate::sizeHint ( const QStyleOptionViewItem &  opt,
const QModelIndex &  index 
) const [virtual]

Returns the size needed by the delegate to display the item specified by index, taking into account the style information provided by the option.

Parameters:
opt options on how to view the item
index index in the model for the item to paint

Definition at line 125 of file jobpropertydelegate.cpp.

QWidget * JobPropertyDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Create an editor for a specified item

Parameters:
parent where to draw the widget
option options on how to view/edit the item
index index in the model for the item to edit

Definition at line 152 of file jobpropertydelegate.cpp.

References JobPropertyItem::createEditor(), editorOpened(), JobPropertyModel::getItem(), m_lastEdited, slotDestroyed(), and sync().

Here is the call graph for this function:

void JobPropertyDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const [virtual]

Set the data to edit

Parameters:
editor the editor
index index in the model to get the data from

Definition at line 186 of file jobpropertydelegate.cpp.

void JobPropertyDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const [virtual]

Set the data edited in the model

Parameters:
editor the editor
model the model
index index in the model to set the data

Definition at line 204 of file jobpropertydelegate.cpp.

void JobPropertyDelegate::updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const [virtual]

Update the editor geometry.

Definition at line 232 of file jobpropertydelegate.cpp.

void JobPropertyDelegate::editorOpened (  )  [signal]

Slignal to let the model know we're editing it

Referenced by createEditor().

void JobPropertyDelegate::editorClosed (  )  [signal]

Slignal to let the model know we've finished editing it

Referenced by slotDestroyed().

void JobPropertyDelegate::sync (  )  [slot]

Synchronize the model with the editor

Definition at line 219 of file jobpropertydelegate.cpp.

References m_syncing.

Referenced by createEditor().

void JobPropertyDelegate::slotDestroyed ( QObject *  object  )  [slot]

Called when the editor is destroyed

Parameters:
object the editor being destroyed

Definition at line 136 of file jobpropertydelegate.cpp.

References editorClosed(), and m_lastEdited.

Referenced by createEditor().

void JobPropertyDelegate::onCustomContextMenuRequested ( const QPoint &  pos  )  [slot]

Slot called when a context menu is requested

Parameters:
pos pos where the context menu is requested

Definition at line 243 of file jobpropertydelegate.cpp.

References JobPropertyItem::createCustomContextMenu(), JobPropertyModel::getItem(), and JobPropertyItem::hasContextMenu().


Member Data Documentation

bool JobPropertyDelegate::m_syncing [private]

Definition at line 65 of file jobpropertydelegate.h.

Referenced by sync().

QObject* JobPropertyDelegate::m_lastEdited [mutable, private]

Definition at line 66 of file jobpropertydelegate.h.

Referenced by createEditor(), and slotDestroyed().


The documentation for this class was generated from the following files:
Generated on Mon Mar 16 18:46:07 2009 for QCJM by  doxygen 1.5.4