PropertyLib::PropertyWidget Class Reference
An abstract base class of property viewer and editor vidget. More...
#include <propertywidget.h>
Inheritance diagram for PropertyLib::PropertyWidget:


Signals | |
void | propertyChanged (MultiProperty *property, const QVariant &value) |
Emit this signal when property value is changed. | |
Public Member Functions | |
PropertyWidget (MultiProperty *property, QWidget *parent=0, const char *name=0) | |
Constructs widget for property with name "propertyName". | |
virtual | ~PropertyWidget () |
virtual QVariant | value () const =0 |
virtual void | setValue (const QVariant &value, bool emitChange=true)=0 |
Sets the value shown in the editor widget. | |
virtual QString | propertyName () const |
virtual void | setProperty (MultiProperty *property) |
Sets the name of edited property. | |
virtual void | setValueList (const QMap< QString, QVariant > &valueList) |
Sets the list of possible values shown in the editor widget. | |
virtual void | drawViewer (QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) |
Function to draw a property viewer when the editor isn't shown. | |
virtual void | undo () |
Reverts the property value to previous setting. | |
Protected Attributes | |
MultiProperty * | m_property |
Detailed Description
An abstract base class of property viewer and editor vidget.Subclass this class to create custom property viewer and editor widget.
Descendants should implement value() and setValue() methods.
Hint: in case you want to implement your property editor widget using existing widgets like QLineEdit, QComboBox, etc. you can't use multiple inheritance from two QObject descendants due to Qt library restriction. Therefore use line edits and combo boxes as child widgets.
A set of predefined widgets for predefined property types are available in the library.
Definition at line 49 of file propertywidget.h.
Constructor & Destructor Documentation
|
Constructs widget for property with name "propertyName".
Definition at line 26 of file propertywidget.cpp. |
|
Definition at line 54 of file propertywidget.h. |
Member Function Documentation
|
Function to draw a property viewer when the editor isn't shown.
Reimplemented in PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PCursorEdit, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PDummyWidget, PropertyLib::PFontButton, PropertyLib::PPixmapEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, and PropertyLib::PYesNoButton. Definition at line 41 of file propertywidget.cpp. |
|
|
Definition at line 31 of file propertywidget.cpp. References m_property, and PropertyLib::MultiProperty::name(). Referenced by PropertyLib::PropertyEditor::propertyValueChanged(). |
|
Sets the name of edited property.
Definition at line 36 of file propertywidget.cpp. References m_property. Referenced by PropertyLib::PropertyEditor::prepareEditor(). |
|
Sets the value shown in the editor widget. Set emitChange to false if you don't want to emit propertyChanged signal. Implemented in PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PComboBox, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PDoubleNumInput, PropertyLib::PDummyWidget, PropertyLib::PFontButton, PropertyLib::PFontCombo, PropertyLib::PLineEdit, PropertyLib::PPixmapEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PSpinBox, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, PropertyLib::PUrlEdit, and PropertyLib::PYesNoButton. Referenced by PropertyLib::PropertyEditor::prepareEditor(), PropertyLib::PropertyEditor::propertyValueChanged(), and PropertyLib::PropertyWidgetProxy::setValue(). |
|
Sets the list of possible values shown in the editor widget. This method does not emit propertyChanged signal. Reimplemented in PropertyLib::PComboBox. Definition at line 49 of file propertywidget.cpp. Referenced by PropertyLib::PropertyEditor::prepareEditor(). |
|
Reverts the property value to previous setting.
Definition at line 54 of file propertywidget.cpp. References m_property, and PropertyLib::MultiProperty::undo(). Referenced by PropertyLib::PropertyEditor::undo(). |
|
Member Data Documentation
|
Definition at line 83 of file propertywidget.h. Referenced by propertyName(), setProperty(), and undo(). |
The documentation for this class was generated from the following files:
- lib/widgets/propeditor/propertywidget.h
- lib/widgets/propeditor/propertywidget.cpp