PyANGKernel.GKPreferencesGroup¶
- class GKPreferencesGroup¶
A collection of preference’s groups and attributes.
Details
A preferences group is a holder for attributes. It groups attributes that are related and is used, also, to control how attributes will be shown to the user in the GKPreferencesEditor.
A group can be only relevant for the whole system, for a particula model or for both. The scope (
setScope) defines is a preference group will be visible and editable in system or/and in model preferences. By default a group is editable in both.And example of group creation follows:
subgroup = new GKPreferencesGroup(); subgroup->setName( "GKModel::LanguageGroup" ); subgroup->setExternalName( QObject::tr("Language") ); subgroup->setEditorPlace( GKPreferencesGroup::eBox ); group->addGroup( subgroup );
See also
Synopsis¶
Methods¶
def
__init__()def
addAttribute()def
addGroup()def
getAttribute()def
getAttributes()def
getEditorPlace()def
getGroup()def
getGroups()def
getName()def
getPriority()def
isModelScope()def
isSystemScope()def
removeGroup()def
setEditorPlace()def
setName()def
setPriority()def
setScope()def
sort()def
takeAttribute()def
takeGroup()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- class GKPreferencesEditorPlace¶
- __init__()¶
- addAttribute(attribute)¶
- Parameters:
attribute –
GKPreferencesAttribute
Add a new attribute to this group. If the attribute was already in the group (searching by name) it will not be added.
The pointer to the attribute is adopted.
- addDisableCondition(attr, value)¶
- Parameters:
attr –
GKPreferencesAttributevalue – str
- addGroup(group)¶
- Parameters:
group –
GKPreferencesGroup
Add a new group to this group. If the group was already in the group (searching by name) it will not be added.
The pointer to the group is adopted.
- addNewAttribute()¶
- Return type:
Creates and adds a new attribute to this group. It is returned.
- getAttribute(name)¶
- Parameters:
name – str
- Return type:
Get an attribute by name looking in this group and its subgroups. If no attribute is found it returns nullptr.
- getAttributes()¶
- Return type:
.list of GKPreferencesAttribute
Returns all the attributes in this group.
- getDisableConditions()¶
- Return type:
.list of std.pairGKPreferencesAttribute,QString
- getEditorPlace()¶
- Return type:
Returns the place in the editor for this group.
Get the external name of this object.
- getGroup(name)¶
- Parameters:
name – str
- Return type:
Get a group by name looking in this group and its subgroups. If no group is found it returns nullptr.
- getGroups()¶
- Return type:
.list of GKPreferencesGroup
Returns all the groups in this group (not recursively).
Get the name of this object.
Gets the priority of this group related to other siblings groups. Used to show the groups in order.
See also
Can this group be edited and view in the Model preferences?
Can this group be edited and view in the System preferences?
- removeAttribute(attribute)¶
- Parameters:
attribute –
GKPreferencesAttribute- Return type:
Removes an attribute from this groups. The attribute object is deleted (no use of it can be done after this call).
- removeGroup(group)¶
- Parameters:
group –
GKPreferencesGroup- Return type:
Removes a group from this group. Any attribute and group inside it will be removed too. The group object is deleted (no use of it can be done after this call).
- setEditorPlace(position)¶
- Parameters:
position –
GKPreferencesEditorPlace
Set in which place a group will appear in the GKPreferencesEditor.
- setExternalName(aname)¶
- Parameters:
aname – str
Set the external name of this object. This name will be used to label this attribute when it is presented to the user.
- setName(aname)¶
- Parameters:
aname – str
Set the name for this object. Must be unique. Is it resposibility of the developer to ensure that it is unique.
- setPriority(level)¶
- Parameters:
level – int
Sets the priority of this group related to other siblings groups. Used to show the groups in order.
See also
- setScope(system, model)¶
- Parameters:
system – bool
model – bool
Defines the scope (where it can be used) of this group.
- sort()¶
Sort the groups in this group (if any) by priority (from low to high priority). A lower number means that will be presented first.
Sub groups will be sorted too (so calling
sortwill sort everything)The default priority value is 100. GKKernel and
GGuipreferences will use priorities lower than 100. Plug-ins should use priorities greater (or equal) than 100.- takeAttribute(attribute)¶
- Parameters:
attribute –
GKPreferencesAttribute- Return type:
Removes an attribute from this group but no data is deleted. Use this method to move an attribute from its location inside a group to a new one.
- takeGroup(group)¶
- Parameters:
group –
GKPreferencesGroup- Return type:
Removes a group (an any group and attribute inside) from this group but no data is deleted. Use this method to move a group from its location inside a group to a new one.