Ubuntu.Components.ExclusiveGroup

ExclusiveGroup provides a way to declare several checkable controls as mutually exclusive. More...

Import Statement: import Ubuntu.Components 1.3
Since: Ubuntu.Components 1.3
Inherits:

ActionList

Properties

Methods

Detailed Description

The ExclusiveGroup will only allow a single object to have it's checkable property set to "true" at any one time. The exclusive group accepts child Actions, but objects other than Actions can be used by using the bindCheckable function as long as they support one of the required signals, and a "checked" property.

ExclusiveGroup {
Action {
parameterType: Action.Bool
state: true
}
Action {
parameterType: Action.Bool
state: false
}
}

Property Documentation

current : Action

Returns the currently checked action


Method Documentation

void bindCheckable(object object)

Explicitly bind an objects checkability to this exclusive group.

Note: This only works with objects which support the following signals signals:

  • toggled(bool)
Item {
ExclusiveGroup {
id: exclusiveGroup
}
Instantiator {
model: 4
onObjectAdded: exclusiveGroup.bindCheckable(object)
onObjectRemoved: exclusiveGroup.unbindCheckable(object)
Action {
checkable: true
}
}
}

See also ExclusiveGroup::unbindCheckable.


void unbindCheckable(object object)

Explicitly unbind an objects checkability from this exclusive group.

See also ExclusiveGroup::bindCheckable.