|  | Home

# QtFlagPropertyManager Class Reference

The QtFlagPropertyManager provides and manages flag properties. More...

     #include <QtFlagPropertyManager>

Inherits QtAbstractPropertyManager.

- List of all members, including inherited members

## Public Functions

| QtFlagPropertyManager ( QObject * parent = 0 )
| ~QtFlagPropertyManager ()
QStringList | flagNames ( const QtProperty * property ) const
QtBoolPropertyManager * | subBoolPropertyManager () const
int | value ( const QtProperty * property ) const

- 3 public functions inherited from QtAbstractPropertyManager
- 29 public functions inherited from QObject

## Public Slots

void | setFlagNames ( QtProperty * property, const QStringList & flagNames )
void | setValue ( QtProperty * property, int value )

- 1 public slot inherited from QObject

## Signals

void | flagNamesChanged ( QtProperty * property, const QStringList & names )
void | valueChanged ( QtProperty * property, int value )

- 4 signals inherited from QtAbstractPropertyManager
- 1 signal inherited from QObject

## Reimplemented Protected Functions

virtual void | initializeProperty ( QtProperty * property )
virtual void | uninitializeProperty ( QtProperty * property )
virtual QString | valueText ( const QtProperty * property ) const

- 6 protected functions inherited from QtAbstractPropertyManager
- 7 protected functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public type inherited from QObject
- 4 static public members inherited from QObject
- 6 protected functions inherited from QtAbstractPropertyManager
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QtFlagPropertyManager provides and manages flag properties.

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.

See also QtAbstractPropertyManager and QtBoolPropertyManager.

## Member Function Documentation

### QtFlagPropertyManager::QtFlagPropertyManager ( QObject * parent = 0 )

Creates a manager with the given parent.

### QtFlagPropertyManager::~QtFlagPropertyManager ()

Destroys this manager, and all the properties it has created.

### QStringList QtFlagPropertyManager::flagNames ( const QtProperty * property ) const

Returns the given property's list of flag names.

See also value() and setFlagNames().

### void QtFlagPropertyManager::flagNamesChanged ( QtProperty * property, const QStringList & 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.

See also setFlagNames().

### void QtFlagPropertyManager::initializeProperty ( QtProperty * property ) `[virtual protected]`

Reimplemented from QtAbstractPropertyManager::initializeProperty().

### void QtFlagPropertyManager::setFlagNames ( QtProperty * property, const QStringList & flagNames ) `[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.

See also flagNames() and flagNamesChanged().

### void QtFlagPropertyManager::setValue ( QtProperty * property, int value ) `[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 2n, where `n` is the size of the list) and larger than (or equal to) 0.

See also value() and valueChanged().

### QtBoolPropertyManager * QtFlagPropertyManager::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.

See also QtAbstractPropertyBrowser::setFactoryForManager().

### void QtFlagPropertyManager::uninitializeProperty ( QtProperty * property ) `[virtual protected]`

Reimplemented from QtAbstractPropertyManager::uninitializeProperty().

### int QtFlagPropertyManager::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.

See also flagNames() and setValue().

### void QtFlagPropertyManager::valueChanged ( QtProperty * property, int value ) `[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.

See also setValue().

### QString QtFlagPropertyManager::valueText ( const QtProperty * property ) const `[virtual protected]`

Reimplemented from QtAbstractPropertyManager::valueText().