Class: QgsAlignmentComboBox¶
A combo box which allows choice of alignment settings (e.g. left, right, …).
Currently only horizontal alignments are supported. Available alignment
choices can be manually specified by calling
setAvailableAlignments()
, which is useful when only a subset
of Qt’s alignment options should be exposed.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
Methods
Returns the current alignment choice. |
|
Sets the text and icon to use for a particular alignment option, replacing the default text or icon. |
|
Sets the available alignment choices shown in the combo box. |
|
Sets the current alignment choice. |
Signals
Emitted when the alignment is changed. |
- class qgis.gui.QgsAlignmentComboBox[source]¶
Bases:
QComboBox
- __init__(parent: QWidget | None = None)
Constructor for QgsAlignmentComboBox, with the specified parent widget.
- Parameters:
parent (Optional[QWidget] = None)
- currentAlignment(self) Qt.Alignment [source]¶
Returns the current alignment choice.
See also
- Return type:
Qt.Alignment
- customizeAlignmentDisplay(self, alignment: Qt.Alignment | Qt.AlignmentFlag, text: str | None = '', icon: QIcon = QIcon())[source]¶
Sets the
text
andicon
to use for a particularalignment
option, replacing the default text or icon.If
text
oricon
is not specified, they will not be changed from the default.Note
This must be called after first filtering the available alignment options via
setAvailableAlignments()
.- Parameters:
alignment (Union[Qt.Alignment, Qt.AlignmentFlag])
text (Optional[str] = '')
icon (QIcon = QIcon())
- setAvailableAlignments(self, alignments: Qt.Alignment | Qt.AlignmentFlag)[source]¶
Sets the available alignment choices shown in the combo box.
- Parameters:
alignments (Union[Qt.Alignment, Qt.AlignmentFlag])