PropertyLib::Property Class Reference
Property. More...
#include <property.h>
Inheritance diagram for PropertyLib::Property:


Public Types | |
enum | PropertyType { Invalid = QVariant::Invalid, Map = QVariant::Map, List = QVariant::List, String = QVariant::String, StringList = QVariant::StringList, Font = QVariant::Font, Pixmap = QVariant::Pixmap, Rect = QVariant::Rect, Size = QVariant::Size, Color = QVariant::Color, Point = QVariant::Point, Integer = QVariant::Int, Boolean = QVariant::Bool, Double = QVariant::Double, Cursor = QVariant::Cursor, SizePolicy = QVariant::SizePolicy, Date = QVariant::Date, DateTime = QVariant::DateTime, ValueFromList = 2000, Symbol = 2001, FontName = 2002, FileURL = 2003, DirectoryURL = 2004, UserDefined = 3000 } |
PropertyType. More... | |
Public Member Functions | |
Property () | |
Constructs empty property. | |
Property (int type, const QString &name, const QString &description, const QVariant &value=QVariant(), bool save=true, bool readOnly=false) | |
Constructs property. | |
Property (const QString &name, const QMap< QString, QVariant > &v_valueList, const QString &description, const QVariant &value=QVariant(), bool save=true, bool readOnly=false) | |
Constructs property with ValueFromList type. | |
virtual | ~Property () |
virtual bool | operator< (const Property &prop) const |
virtual QString | name () const |
virtual void | setName (const QString &name) |
Sets the name of the property. | |
virtual int | type () const |
virtual void | setType (int type) |
Sets the type of the property. | |
virtual QVariant | value () const |
virtual void | setValue (const QVariant &value, bool rememberOldValue=true) |
Sets the value of the property. | |
virtual QString | description () const |
virtual void | setDescription (const QString &description) |
Sets the description of the property. | |
virtual void | setValueList (const QMap< QString, QVariant > &list) |
Sets the string-to-value correspondence list of the property. | |
virtual bool | allowSaving () const |
Tells if the property can be saved to a stream, xml, etc. | |
virtual bool | readOnly () const |
Tells if the property is read only. | |
virtual bool | visible () const |
Tells if the property is visible. | |
virtual void | setVisible (const bool visible) |
Set the visibility. | |
virtual QVariant | oldValue () const |
Gets the previous property value. | |
Public Attributes | |
QMap< QString, QVariant > | valueList |
The string-to-value correspondence list of the property. | |
Private Attributes | |
int | m_type |
QString | m_name |
QString | m_description |
QVariant | m_value |
QVariant | m_oldValue |
bool | m_save |
bool | m_readOnly |
bool | m_visible |
Detailed Description
Property.It includes support for QStringList properties, an i18n'ed label and stores an old value to allow undo.
Contains name, type and value.
Type can be one of predefined types (including standard QVariant types) by PropertyType enum or custom user type. User defined types should have values more than 3000.
Value is a QVariant.
Property can optionally have a list of possible values. In that case use ValueFromList type and valueList member. Use description for i18n'ed label.
Examples: creating property:
using convenience constructor to create property of ValueFromList type:
Definition at line 61 of file property.h.
Member Enumeration Documentation
|
PropertyType. Integers that represent the type of the property.
Definition at line 65 of file property.h. |
Constructor & Destructor Documentation
|
Constructs empty property.
Definition at line 116 of file property.h. |
|
Constructs property.
Definition at line 25 of file property.cpp. |
|
Constructs property with ValueFromList type.
Definition at line 32 of file property.cpp. |
|
Definition at line 40 of file property.cpp. |
Member Function Documentation
|
Tells if the property can be saved to a stream, xml, etc. There is a possibility to use "GUI" properties that aren't stored but used only in a GUI. Definition at line 44 of file property.cpp. |
|
Definition at line 91 of file property.cpp. Referenced by PropertyLib::MultiProperty::description(). |
|
Definition at line 57 of file property.cpp. Referenced by PropertyLib::PropertyList::addProperty(), operator<(), PropertyLib::MultiProperty::operator==(), PropertyLib::PropertyEditor::propertyValueChanged(), and PropertyLib::PropertyList::removeProperty(). |
|
Gets the previous property value.
Definition at line 121 of file property.cpp. References m_oldValue. Referenced by PropertyLib::MultiProperty::undo(). |
|
Definition at line 49 of file property.cpp. |
|
Tells if the property is read only.
Definition at line 106 of file property.cpp. Referenced by PropertyLib::MultiProperty::readOnly(). |
|
Sets the description of the property.
Definition at line 96 of file property.cpp. References m_description. Referenced by PropertyLib::MultiProperty::setDescription(). |
|
Sets the name of the property.
Definition at line 62 of file property.cpp. References m_name. |
|
Sets the type of the property.
Definition at line 72 of file property.cpp. References m_type. Referenced by PropertyLib::PropertyWidgetProxy::setWidget(). |
|
Sets the value of the property.
Reimplemented in PropertyLib::ChildProperty. Definition at line 82 of file property.cpp. References m_oldValue, and m_value. Referenced by PropertyLib::MultiProperty::setValue(), and PropertyLib::MultiProperty::undo(). |
|
Sets the string-to-value correspondence list of the property. This is used to create comboboxes-like property editors. Definition at line 101 of file property.cpp. References valueList. Referenced by PropertyLib::MultiProperty::setValueList(). |
|
Set the visibility.
Definition at line 116 of file property.cpp. References m_visible. |
|
Definition at line 67 of file property.cpp. Referenced by operator<(), and PropertyLib::MultiProperty::operator==(). |
|
Reimplemented in PropertyLib::ChildProperty. Definition at line 77 of file property.cpp. Referenced by PropertyLib::PropertyEditor::propertyValueChanged(), and PropertyLib::MultiProperty::value(). |
|
Tells if the property is visible.
Definition at line 111 of file property.cpp. Referenced by PropertyLib::MultiProperty::visible(). |
Member Data Documentation
|
Definition at line 169 of file property.h. Referenced by setDescription(). |
|
Definition at line 168 of file property.h. Referenced by setName(). |
|
Definition at line 171 of file property.h. Referenced by oldValue(), and setValue(). |
|
Definition at line 173 of file property.h. |
|
Definition at line 172 of file property.h. |
|
Definition at line 167 of file property.h. Referenced by setType(). |
|
Definition at line 170 of file property.h. Referenced by setValue(). |
|
Definition at line 174 of file property.h. Referenced by setVisible(). |
|
The string-to-value correspondence list of the property.
Definition at line 147 of file property.h. Referenced by setValueList(). |
The documentation for this class was generated from the following files:
- lib/widgets/propeditor/property.h
- lib/widgets/propeditor/property.cpp