MIRA
Classes | Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
PropertyEditor Class Referenceabstract

Provides display and editing facilities for property items in the editor. More...

#include <widgets/PropertyEditor.h>

Inheritance diagram for PropertyEditor:
Inheritance graph
[legend]

Classes

struct  SupportedType
 

Public Types

typedef boost::shared_ptr< Delegate > DelegatePtr
 
typedef std::list< SupportedTypeSupportedTypes
 

Public Slots

void clear ()
 Removes all property nodes that were set and therefore clears the whole editor content (without deleting the nodes). More...
 
void addProperty (PropertyNode *property, QVariant user=QVariant())
 Adds the specified property node as top level node to the editor. More...
 
void removeProperty (PropertyNode *property)
 Remove the specified property node from the editor. More...
 
void moveUpProperty (PropertyNode *property)
 Moves the property node up in the editor's property node list. More...
 
void moveDownProperty (PropertyNode *property)
 Moves the property node down in the editor's property node list. More...
 
QVariant getUser (PropertyNode *property)
 
void setAutoHideFilterBar (bool hide=true)
 
void showFilter ()
 
void hideFilter ()
 

Public Member Functions

 PropertyEditor (QWidget *parent=0)
 
virtual ~PropertyEditor ()
 
PropertyNodecurrentProperty ()
 Returns the current selected property node, or NULL if nothing is selected. More...
 
void setHideSingleRootNode (bool hide=true)
 If hiding of the single root node is enabled, a single top level node will not be shown explicitly. More...
 
bool getHideSingleRootNode () const
 Returns the set mode, whether a single root node should be hidden or not. More...
 
void installFilterShortCut (QWidget *widget, const QString &shortcut="Ctrl+F")
 
bool getAutoHideFilterBar () const
 
void setColor (const PropertyNode *property, const QColor &color)
 Sets the background color for the specified property. More...
 
QColor getColor (const PropertyNode *property) const
 
std::string getText (const PropertyNode *property) const
 
QIcon getIcon (const PropertyNode *property) const
 
QColor getBackgroundColor (const PropertyNode *property) const
 
QWidget * createEditor (PropertyNode *property, QWidget *parent)
 
std::string getName (const PropertyNode *property)
 
const PropertyNodegetCurrentEditedProperty () const
 
virtual SupportedTypes supportedTypes () const =0
 
virtual std::string getText (const PropertyNode *property)
 Returns text for a text label. More...
 
virtual QIcon getIcon (const PropertyNode *property)
 
virtual QColor getBackgroundColor (const PropertyNode *property)
 
virtual QWidget * createEditor (PropertyNode *property, QWidget *parent)
 
virtual bool execDialog (PropertyNode *property, QWidget *parent)
 
virtual std::string getName (const PropertyNode *property)
 
PropertyListener interface
virtual void beginAddChildren (const PropertyNode *node, int index, int count)
 
virtual void endAddChildren ()
 
virtual void beginRemoveChildren (const PropertyNode *node, int index, int count)
 
virtual void endRemoveChildren ()
 
virtual void beginMoveChildren (const PropertyNode *node, int index, int count, int destination)
 
virtual void endMoveChildren ()
 

Static Public Member Functions

template<typename Type >
static SupportedType makeSupportedType (SupportedType::Flags flags)
 

Static Public Attributes

static const QColor lightBlue
 
static const QColor lightRed
 
static const QColor lightGreen
 
static const QColor lightYellow
 
static const QColor lightPurple
 

Protected Member Functions

void timerEvent (QTimerEvent *)
 
void customEvent (QEvent *)
 

Friends

class Model
 
class TreeView
 
class ItemDelegate
 
class PropertyItemEditor
 

Detailed Description

Provides display and editing facilities for property items in the editor.

A PropertyEditor::Delegate is used to provide custom display features and editor widgets. Using the delegate mechanism allows the development of display and editing facilities independently from the PropertyEditor. PropertyEditor::Delegate classes can be implemented in different libraries. The PropertyEditor automatically asks the ClassFactory for loaded Delegates and instantiates them.

Member Typedef Documentation

◆ DelegatePtr

typedef boost::shared_ptr<Delegate> DelegatePtr

◆ SupportedTypes

typedef std::list<SupportedType> SupportedTypes

Constructor & Destructor Documentation

◆ PropertyEditor()

PropertyEditor ( QWidget *  parent = 0)

◆ ~PropertyEditor()

virtual ~PropertyEditor ( )
virtual

Member Function Documentation

◆ currentProperty()

PropertyNode* currentProperty ( )

Returns the current selected property node, or NULL if nothing is selected.

◆ clear

void clear ( )
slot

Removes all property nodes that were set and therefore clears the whole editor content (without deleting the nodes).

◆ addProperty

void addProperty ( PropertyNode property,
QVariant  user = QVariant() 
)
slot

Adds the specified property node as top level node to the editor.

◆ removeProperty

void removeProperty ( PropertyNode property)
slot

Remove the specified property node from the editor.

◆ moveUpProperty

void moveUpProperty ( PropertyNode property)
slot

Moves the property node up in the editor's property node list.

◆ moveDownProperty

void moveDownProperty ( PropertyNode property)
slot

Moves the property node down in the editor's property node list.

◆ getUser

QVariant getUser ( PropertyNode property)
slot

◆ setHideSingleRootNode()

void setHideSingleRootNode ( bool  hide = true)

If hiding of the single root node is enabled, a single top level node will not be shown explicitly.

Its children will be shown only.

◆ getHideSingleRootNode()

bool getHideSingleRootNode ( ) const

Returns the set mode, whether a single root node should be hidden or not.

◆ installFilterShortCut()

void installFilterShortCut ( QWidget *  widget,
const QString &  shortcut = "Ctrl+F" 
)

◆ getAutoHideFilterBar()

bool getAutoHideFilterBar ( ) const

◆ setAutoHideFilterBar

void setAutoHideFilterBar ( bool  hide = true)
slot

◆ showFilter

void showFilter ( )
slot

◆ hideFilter

void hideFilter ( )
slot

◆ setColor()

void setColor ( const PropertyNode property,
const QColor &  color 
)

Sets the background color for the specified property.

◆ getColor()

QColor getColor ( const PropertyNode property) const

◆ getText() [1/2]

std::string getText ( const PropertyNode property) const

◆ getIcon() [1/2]

QIcon getIcon ( const PropertyNode property) const

◆ getBackgroundColor() [1/2]

QColor getBackgroundColor ( const PropertyNode property) const

◆ createEditor() [1/2]

QWidget* createEditor ( PropertyNode property,
QWidget *  parent 
)

◆ getName() [1/2]

std::string getName ( const PropertyNode property)

◆ timerEvent()

void timerEvent ( QTimerEvent *  )
protected

◆ customEvent()

void customEvent ( QEvent *  )
protected

◆ getCurrentEditedProperty()

const PropertyNode* getCurrentEditedProperty ( ) const
inline

◆ beginAddChildren()

virtual void beginAddChildren ( const PropertyNode node,
int  index,
int  count 
)
virtual

Implements PropertyNodeListener.

◆ endAddChildren()

virtual void endAddChildren ( )
virtual

Implements PropertyNodeListener.

◆ beginRemoveChildren()

virtual void beginRemoveChildren ( const PropertyNode node,
int  index,
int  count 
)
virtual

Implements PropertyNodeListener.

◆ endRemoveChildren()

virtual void endRemoveChildren ( )
virtual

Implements PropertyNodeListener.

◆ beginMoveChildren()

virtual void beginMoveChildren ( const PropertyNode node,
int  index,
int  count,
int  destination 
)
virtual

Implements PropertyNodeListener.

◆ endMoveChildren()

virtual void endMoveChildren ( )
virtual

Implements PropertyNodeListener.

◆ makeSupportedType()

static SupportedType makeSupportedType ( SupportedType::Flags  flags)
inlinestatic

◆ supportedTypes()

virtual SupportedTypes supportedTypes ( ) const
pure virtual

◆ getText() [2/2]

virtual std::string getText ( const PropertyNode property)
inlinevirtual

Returns text for a text label.

◆ getIcon() [2/2]

virtual QIcon getIcon ( const PropertyNode property)
inlinevirtual

◆ getBackgroundColor() [2/2]

virtual QColor getBackgroundColor ( const PropertyNode property)
inlinevirtual

◆ createEditor() [2/2]

virtual QWidget* createEditor ( PropertyNode property,
QWidget *  parent 
)
inlinevirtual

◆ execDialog()

virtual bool execDialog ( PropertyNode property,
QWidget *  parent 
)
inlinevirtual

◆ getName() [2/2]

virtual std::string getName ( const PropertyNode property)
inlinevirtual

Friends And Related Function Documentation

◆ Model

friend class Model
friend

◆ TreeView

friend class TreeView
friend

◆ ItemDelegate

friend class ItemDelegate
friend

◆ PropertyItemEditor

friend class PropertyItemEditor
friend

Member Data Documentation

◆ lightBlue

const QColor lightBlue
static

◆ lightRed

const QColor lightRed
static

◆ lightGreen

const QColor lightGreen
static

◆ lightYellow

const QColor lightYellow
static

◆ lightPurple

const QColor lightPurple
static

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