Computer Assited Medical Intervention Tool Kit  version 5.0
QtFlagPropertyManager Class Reference

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

#include <qtpropertymanager.h>

+ Inheritance diagram for QtFlagPropertyManager:
+ Collaboration diagram for QtFlagPropertyManager:

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

QStringList flagNames (const QtProperty *property) const
 
 QtFlagPropertyManager (QObject *parent=nullptr)
 
QtBoolPropertyManagersubBoolPropertyManager () const
 
int value (const QtProperty *property) const
 
 ~QtFlagPropertyManager () override
 
- Public Member Functions inherited from QtAbstractPropertyManager
QtPropertyaddProperty (const QString &name=QString())
 
void clear () const
 
QSet< QtProperty * > properties () const
 
 QtAbstractPropertyManager (QObject *parent=nullptr)
 
 ~QtAbstractPropertyManager () override
 

Protected Member Functions

void initializeProperty (QtProperty *property) override
 
void uninitializeProperty (QtProperty *property) override
 
QString valueText (const QtProperty *property) const override
 
- Protected Member Functions inherited from QtAbstractPropertyManager
virtual QtPropertycreateProperty ()
 
virtual QString displayText (const QtProperty *property) const
 
virtual EchoMode echoMode (const QtProperty *) const
 
virtual bool hasValue (const QtProperty *property) const
 
virtual QIcon valueIcon (const QtProperty *property) const
 

Private Member Functions

 Q_PRIVATE_SLOT (d_func(), void slotBoolChanged(QtProperty *, bool)) Q_PRIVATE_SLOT(d_func()
 

Private Attributes

QtFlagPropertyManagerPrivated_ptr
 

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, QtBoolPropertyManager

Constructor & Destructor Documentation

◆ QtFlagPropertyManager()

QtFlagPropertyManager::QtFlagPropertyManager ( QObject *  parent = nullptr)

◆ ~QtFlagPropertyManager()

QtFlagPropertyManager::~QtFlagPropertyManager ( )
override

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

References QtAbstractPropertyManager::clear(), and d_ptr.

+ Here is the call graph for this function:

Member Function Documentation

◆ flagNames()

QStringList QtFlagPropertyManager::flagNames ( const QtProperty property) const

Returns the given property's list of flag names.

See also
value(), setFlagNames()

References d_ptr, QtFlagPropertyManagerPrivate::Data::flagNames, and QtFlagPropertyManagerPrivate::m_values.

Referenced by setFlagNames().

+ Here is the caller graph for this function:

◆ flagNamesChanged

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()

Referenced by setFlagNames().

+ Here is the caller graph for this function:

◆ initializeProperty()

void QtFlagPropertyManager::initializeProperty ( QtProperty property)
overrideprotectedvirtual

◆ Q_PRIVATE_SLOT()

QtFlagPropertyManager::Q_PRIVATE_SLOT ( d_func()  ,
void   slotBoolChangedQtProperty *, bool 
)
private

◆ setFlagNames

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(), flagNamesChanged()

References QtAbstractPropertyManager::addProperty(), d_ptr, flagNames(), QtFlagPropertyManagerPrivate::Data::flagNames, flagNamesChanged(), QtFlagPropertyManagerPrivate::m_boolPropertyManager, QtFlagPropertyManagerPrivate::m_flagToProperty, QtFlagPropertyManagerPrivate::m_propertyToFlags, QtFlagPropertyManagerPrivate::m_values, QtAbstractPropertyManager::propertyChanged(), QtProperty::setPropertyName(), QtFlagPropertyManagerPrivate::Data::val, and valueChanged().

+ Here is the call graph for this function:

◆ setValue

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 2\sup n, where n is the size of the list) and larger than (or equal to) 0.

See also
value(), valueChanged()

References d_ptr, QtFlagPropertyManagerPrivate::Data::flagNames, QtFlagPropertyManagerPrivate::m_boolPropertyManager, QtFlagPropertyManagerPrivate::m_propertyToFlags, QtFlagPropertyManagerPrivate::m_values, QtAbstractPropertyManager::propertyChanged(), QtBoolPropertyManager::setValue(), QtFlagPropertyManagerPrivate::Data::val, and valueChanged().

Referenced by QtFlagPropertyManagerPrivate::slotBoolChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subBoolPropertyManager()

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()

References d_ptr, and QtFlagPropertyManagerPrivate::m_boolPropertyManager.

◆ uninitializeProperty()

void QtFlagPropertyManager::uninitializeProperty ( QtProperty property)
overrideprotectedvirtual

◆ value()

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(), setValue()

References d_ptr, and QtFlagPropertyManagerPrivate::m_values.

◆ valueChanged

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()

Referenced by QtFlagPropertyManager(), setFlagNames(), and setValue().

+ Here is the caller graph for this function:

◆ valueText()

QString QtFlagPropertyManager::valueText ( const QtProperty property) const
overrideprotectedvirtual

Member Data Documentation

◆ d_ptr


The documentation for this class was generated from the following files: