#include <propertywidget.h>

Signals | |
void | propertyChanged (MultiProperty *property, const TQVariant &value) |
Public Member Functions | |
PropertyWidget (MultiProperty *property, TQWidget *parent=0, const char *name=0) | |
virtual TQVariant | value () const =0 |
virtual void | setValue (const TQVariant &value, bool emitChange=true)=0 |
virtual TQString | propertyName () const |
virtual void | setProperty (MultiProperty *property) |
virtual void | setValueList (const TQMap< TQString, TQVariant > &valueList) |
virtual void | drawViewer (TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) |
virtual void | undo () |
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 TQLineEdit, TQComboBox, etc. you can't use multiple inheritance from two TQObject descendants due to TQt 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
◆ PropertyWidget()
PropertyLib::PropertyWidget::PropertyWidget | ( | MultiProperty * | property, |
TQWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructs widget for property with name "propertyName".
Definition at line 26 of file propertywidget.cpp.
Member Function Documentation
◆ drawViewer()
|
virtual |
Function to draw a property viewer when the editor isn't shown.
Reimplemented in PropertyLib::PDummyWidget, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PPixmapEdit, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PFontButton, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PYesNoButton, PropertyLib::PLineStyleEdit, and PropertyLib::PCursorEdit.
Definition at line 41 of file propertywidget.cpp.
◆ propertyChanged
|
signal |
Emit this signal when property value is changed.
Probably you want to emit it only from setValue() method. PropertyLib::PropertyEditor widget will connect this to the appropriate slot which will make updates to the PropertyLib::PropertyList that hold propeties.
◆ propertyName()
|
virtual |
- Returns
- the name of edited property.
Definition at line 31 of file propertywidget.cpp.
◆ setProperty()
|
virtual |
Sets the name of edited property.
Definition at line 36 of file propertywidget.cpp.
◆ setValue()
|
pure virtual |
Sets the value shown in the editor widget.
Set emitChange to false if you don't want to emit propertyChanged signal.
Implemented in PropertyLib::PUrlEdit, PropertyLib::PDummyWidget, PropertyLib::PComboBox, PropertyLib::PDoubleNumInput, PropertyLib::PFontCombo, PropertyLib::PStringListEdit, PropertyLib::PColorButton, PropertyLib::PSymbolCombo, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PSpinBox, PropertyLib::PCheckBox, PropertyLib::PColorCombo, PropertyLib::PLineEdit, PropertyLib::PPixmapEdit, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PFontButton, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PYesNoButton, and PropertyLib::PLineStyleEdit.
◆ setValueList()
|
virtual |
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.
◆ undo()
|
virtual |
Reverts the property value to previous setting.
Definition at line 55 of file propertywidget.cpp.
◆ value()
|
pure virtual |
- Returns
- the value currently entered in the editor widget.
Implemented in PropertyLib::PUrlEdit, PropertyLib::PDummyWidget, PropertyLib::PComboBox, PropertyLib::PDoubleNumInput, PropertyLib::PColorButton, PropertyLib::PFontCombo, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PPixmapEdit, PropertyLib::PSpinBox, PropertyLib::PCheckBox, PropertyLib::PColorCombo, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PFontButton, PropertyLib::PLineEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PYesNoButton, and PropertyLib::PLineStyleEdit.
The documentation for this class was generated from the following files: