PyANGKernel.GKSelection¶
- class GKSelection¶
-
Inherited by:
GKGeoSelectionSynopsis¶
Methods¶
def
__init__()def
anySelected()def
atLeast()def
canBeCopied()def
canBeCutted()def
canBeDeleted()def
canBeModified()def
cut()def
deselect()def
getAny()def
getModel()def
getObjects()def
isEmpty()def
isSelected()def
remove()def
select()def
setModel()def
size()
Virtual methods¶
def
clear()def
deselectAll()def
selectMultiple()
Signals¶
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
Detailed Description¶
This class represents a generic collection of selected objects from the model. Objects are selected or deselected through select and deselect calls or using the
selectMultiple/endSelectMultipleanddeselectMultiple/endSelectMultiple.The first calls are used to select (or deselect) a single object. The second set of calls are used when more than one object will be selected (or deselected). The difference is when they emit the
selectionChangedsignal.Selection can also be removed, that is, all the selected objects are destroyed. Destroyed means objects removed from the model and the model and inserted in a delete command. This operation, then, can be undone. After undone, all the objects are deselected.
Selection in this class is handled internally, so the objects are not selected at model level.
GKGeoSelection, which is derived from this class, takes care of if at geoModel level (and thus it handles ‘selected’ flag in GKGeoObjects).- class MatchMode¶
- __init__()¶
Returns true if the type of any of the selected objects is “byType” (or a subclass of “byType” if allowSubclass is true) Equivalent to call
atLeastwith a minimum of 1.- atLeast(minimum, byType, mm)¶
Returns true if at least “minimum” number of object of type “byType” are selected (or a subclass of “byType” mm is eThisAndSubclasses).
This method is faster than
sizeas it stops when the minimum is reached.Selection can be copied (usually yes but maybe a turn is selected and they cannot be copied)?
Selection can be cutted (usually yes but maybe a turn is selected and they cannot be copied)?
Selection can be deleted?
Selection can be modified?
- clear()¶
Clears the selection internally, without throwing out the
selectionChanged()signal.- cut()¶
Removes (deletes) all the selected objects that allows the CUT command (GKObject::allowClipboardOperations) using a command (to UNDO the operation).
Deselects a single object (remove it from the selection list) and emits a
selectionChangedsignal- deselectAll()¶
Deselect all the selected objects.
As deselect but without emiting the signal
- endSelectMultiple()¶
Emits the signal since all the objects that will be selected have been selected now.
Get any selected object of type “byType” (or a subclass of “byType” if mm is eThisAndSubclasses)
The model in where this selection is
Iter over the selection
Returns the type of the selection. That is the common type of all the selected objects going down in the hierarchy. If the selection is empty or there is not a common base class it returns NULL.
Returns true if the selection is empty
Is object selected in this selection?
- remove()¶
Removes (deletes) all the selected objects using a command (to UNDO the operation).
Selects a single object (add it to the selection list) and emits a
selectionChangedsignalAs select but without emiting the signal
- selectionChanged(model, me)¶
- Parameters:
model –
GKModelme –
GKSelection
Emitted when the selection has been changed, with its model and itself as a parameter.
The model in where this selection is
Number of selected objects
Number of selected objects of type “byType” (or a subclass of “byType” if mm is eThisAndSubclasses)