Workspace 6.21.5
|
The QtFlagPropertyManager provides and manages flag properties. More...
#include <Workspace/Widgets/PropertyBrowser/qtpropertymanager.h>
Public Slots | |
void | setFlagNames (QtProperty *property, const QStringList &names) |
void | setValue (QtProperty *property, int val) |
Signals | |
void | flagNamesChanged (QtProperty *property, const QStringList &names) |
void | valueChanged (QtProperty *property, int val) |
Signals inherited from QtAbstractPropertyManager | |
void | propertyChanged (QtProperty *property) |
void | propertyDestroyed (QtProperty *property) |
void | propertyInserted (QtProperty *property, QtProperty *parent, QtProperty *after) |
void | propertyRemoved (QtProperty *property, QtProperty *parent) |
Public Member Functions | |
QtFlagPropertyManager (QObject *parent=nullptr) | |
~QtFlagPropertyManager () | |
QStringList | flagNames (const QtProperty *property) const |
QtBoolPropertyManager * | subBoolPropertyManager () const |
int | value (const QtProperty *property) const |
Public Member Functions inherited from QtAbstractPropertyManager | |
QtAbstractPropertyManager (QObject *parent=nullptr) | |
~QtAbstractPropertyManager () | |
QtProperty * | addProperty (const QString &name=QString()) |
void | clear () const |
bool | getModifiedOnValueChanged () const |
QSet< QtProperty * > | properties () const |
void | setModifiedOnValueChanged (bool modified) |
Protected Member Functions | |
virtual void | initializeProperty (QtProperty *property) |
virtual void | uninitializeProperty (QtProperty *property) |
QString | valueText (const QtProperty *property) const |
Protected Member Functions inherited from QtAbstractPropertyManager | |
virtual QtProperty * | createProperty () |
virtual QString | displayText (const QtProperty *property) const |
virtual EchoMode | echoMode (const QtProperty *) const |
virtual bool | hasValue (const QtProperty *property) const |
virtual void | initializeProperty (QtProperty *property)=0 |
virtual void | uninitializeProperty (QtProperty *property) |
virtual QIcon | valueIcon (const QtProperty *property) const |
virtual QString | valueText (const QtProperty *property) const |
Each flag property has an associated list of flag names which can be retrieved using the flagNames() function, and set using the corresponding setFlagNames() function.
The flag manager provides properties with nested boolean subproperties representing each flag, i.e. a flag property's value is the binary combination of the subproperties' values. A property's value can be retrieved and set using the value() and setValue() slots respectively. The combination of flags is represented by single int value - that's why it's possible to store up to 32 independent flags in one flag property.
The subproperties are created by a QtBoolPropertyManager object. This manager can be retrieved using the subBoolPropertyManager() function. In order to provide editing widgets for the subproperties in a property browser widget, this manager must be associated with an editor factory.
In addition, QtFlagPropertyManager provides the valueChanged() signal which is emitted whenever a property created by this manager changes, and the flagNamesChanged() signal which is emitted whenever the list of flag names is altered.
QtFlagPropertyManager | ( | QObject * | parent = nullptr | ) |
Creates a manager with the given parent.
Destroys this manager, and all the properties it has created.
QStringList flagNames | ( | const QtProperty * | property | ) | const |
Returns the given property's list of flag names.
|
signal |
This signal is emitted whenever a property created by this manager changes its flag names, passing a pointer to the property and the new names as parameters.
|
protectedvirtual |
This function is called whenever a new valid property pointer has been created, passing the pointer as parameter.
The purpose is to let the manager know that the property has been created so that it can provide additional attributes for the new property, e.g. QtIntPropertyManager adds {QtIntPropertyManager::value()}{value}, {QtIntPropertyManager::minimum()}{minimum} and {QtIntPropertyManager::maximum()}{maximum} attributes. Since each manager subclass adds type specific attributes, this function is pure virtual and must be reimplemented when deriving from the QtAbstractPropertyManager class.
Implements QtAbstractPropertyManager.
|
slot |
Sets the given property's list of flag names to flagNames. The property's current value is reset to 0 indicating the first item of the list.
|
slot |
Sets the value of the given property to value. Nested properties are updated automatically.
The specified value must be less than the binary combination of the property's flagNames() list size (i.e. less than 2 n, where n
is the size of the list) and larger than (or equal to) 0.
QtBoolPropertyManager * subBoolPropertyManager | ( | ) | const |
Returns the manager that produces the nested boolean subproperties representing each flag.
In order to provide editing widgets for the subproperties in a property browser widget, this manager must be associated with an editor factory.
|
protectedvirtual |
This function is called just before the specified property is destroyed.
The purpose is to let the property manager know that the property is being destroyed so that it can remove the property's additional attributes.
Reimplemented from QtAbstractPropertyManager.
int value | ( | const QtProperty * | property | ) | const |
Returns the given property's value.
If the given property is not managed by this manager, this function returns 0.
|
signal |
This signal is emitted whenever a property created by this manager changes its value, passing a pointer to the property and the new value as parameters.
|
protectedvirtual |
Returns a string representing the current state of the given property.
The default implementation of this function returns an empty string.
Reimplemented from QtAbstractPropertyManager.