#include <property.h>

Public Types | |
enum | PropertyType { Invalid = TQVariant::Invalid, Map = TQVariant::Map, List = TQVariant::List, String = TQVariant::String, StringList = TQVariant::StringList, Font = TQVariant::Font, Pixmap = TQVariant::Pixmap, Rect = TQVariant::Rect, Size = TQVariant::Size, Color = TQVariant::Color, Point = TQVariant::Point, Integer = TQVariant::Int, Boolean = TQVariant::Bool, Double = TQVariant::Double, Cursor = TQVariant::Cursor, SizePolicy = TQVariant::SizePolicy, Date = TQVariant::Date, DateTime = TQVariant::DateTime, ValueFromList = 2000, Symbol = 2001, FontName = 2002, FileURL = 2003, DirectoryURL = 2004, LineStyle = 2005, UserDefined = 3000 } |
Public Member Functions | |
Property () | |
Property (int type, const TQString &name, const TQString &description, const TQVariant &value=TQVariant(), bool save=true, bool readOnly=false) | |
Property (const TQString &name, const TQMap< TQString, TQVariant > &v_valueList, const TQString &description, const TQVariant &value=TQVariant(), bool save=true, bool readOnly=false) | |
virtual bool | operator< (const Property &prop) const |
virtual TQString | name () const |
virtual void | setName (const TQString &name) |
virtual int | type () const |
virtual void | setType (int type) |
virtual TQVariant | value () const |
virtual void | setValue (const TQVariant &value, bool rememberOldValue=true) |
virtual TQString | description () const |
virtual void | setDescription (const TQString &description) |
virtual void | setValueList (const TQMap< TQString, TQVariant > &list) |
virtual bool | allowSaving () const |
virtual bool | readOnly () const |
virtual bool | visible () const |
virtual void | setVisible (const bool visible) |
virtual TQVariant | oldValue () const |
Public Attributes | |
TQMap< TQString, TQVariant > | valueList |
Detailed Description
It includes support for TQStringList 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 TQVariant types) by PropertyLib::Property::PropertyType enum or custom user type. User defined types should have values more than 3000.
Value is a TQVariant.
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 62 of file property.h.
Member Enumeration Documentation
◆ PropertyType
PropertyType.
Integers that represent the type of the property.
Definition at line 66 of file property.h.
Constructor & Destructor Documentation
◆ Property() [1/3]
|
inline |
Constructs empty property.
Definition at line 118 of file property.h.
◆ Property() [2/3]
PropertyLib::Property::Property | ( | int | type, |
const TQString & | name, | ||
const TQString & | description, | ||
const TQVariant & | value = TQVariant() , |
||
bool | save = true , |
||
bool | readOnly = false |
||
) |
Constructs property.
Definition at line 25 of file property.cpp.
◆ Property() [3/3]
PropertyLib::Property::Property | ( | const TQString & | name, |
const TQMap< TQString, TQVariant > & | v_valueList, | ||
const TQString & | description, | ||
const TQVariant & | value = TQVariant() , |
||
bool | save = true , |
||
bool | readOnly = false |
||
) |
Constructs property with ValueFromList type.
Definition at line 32 of file property.cpp.
Member Function Documentation
◆ allowSaving()
|
virtual |
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.
◆ description()
|
virtual |
- Returns
- the description of the property.
Definition at line 91 of file property.cpp.
◆ name()
|
virtual |
- Returns
- the name of the property.
Definition at line 57 of file property.cpp.
◆ oldValue()
|
virtual |
Gets the previous property value.
Definition at line 121 of file property.cpp.
◆ readOnly()
|
virtual |
Tells if the property is read only.
Definition at line 106 of file property.cpp.
◆ setDescription()
|
virtual |
Sets the description of the property.
Definition at line 96 of file property.cpp.
◆ setName()
|
virtual |
Sets the name of the property.
Definition at line 62 of file property.cpp.
◆ setType()
|
virtual |
Sets the type of the property.
Definition at line 72 of file property.cpp.
◆ setValue()
|
virtual |
Sets the value of the property.
Reimplemented in PropertyLib::ChildProperty.
Definition at line 82 of file property.cpp.
◆ setValueList()
|
virtual |
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.
◆ setVisible()
|
virtual |
Set the visibility.
Definition at line 116 of file property.cpp.
◆ type()
|
virtual |
- Returns
- the type of the property.
Definition at line 67 of file property.cpp.
◆ value()
|
virtual |
- Returns
- the value of the property.
Reimplemented in PropertyLib::ChildProperty.
Definition at line 77 of file property.cpp.
◆ visible()
|
virtual |
Tells if the property is visible.
Definition at line 111 of file property.cpp.
Member Data Documentation
◆ valueList
TQMap<TQString, TQVariant> PropertyLib::Property::valueList |
The string-to-value correspondence list of the property.
Definition at line 149 of file property.h.
The documentation for this class was generated from the following files: