Class: QgsAlignmentComboBox¶
A combo box which allows choice of alignment settings (e.g. left, right, …).
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.
List of all members, including inherited members
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. |
|
Returns the current alignment choice as a QGIS horizontal text alignment enum. |
|
Sets the available alignment choices shown in the combo box. |
|
Sets the current alignment choice. |
|
Returns the current alignment choice as a QGIS horizontal text alignment enum. |
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.AlignmentFlag[source]¶
Returns the current alignment choice.
See also
- Return type:
Qt.AlignmentFlag
- customizeAlignmentDisplay(self, alignment: Qt.AlignmentFlag, text: str | None = '', icon: QIcon = QIcon())[source]¶
Sets the
textandiconto use for a particularalignmentoption, replacing the default text or icon.If
textoriconis 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 (Qt.AlignmentFlag)
text (Optional[str] = '')
icon (QIcon = QIcon())
- horizontalAlignment(self) Qgis.TextHorizontalAlignment[source]¶
Returns the current alignment choice as a QGIS horizontal text alignment enum.
See also
Added in version 4.0.
- Return type:
- setAvailableAlignments(self, alignments: Qt.AlignmentFlag)[source]¶
Sets the available alignment choices shown in the combo box.
- Parameters:
alignments (Qt.AlignmentFlag)
- setCurrentAlignment(self, alignment: Qt.AlignmentFlag)[source]¶
Sets the current
alignmentchoice.See also
setCurrentAlignment(self, alignment: Qgis.TextHorizontalAlignment) Sets the current
alignmentchoice from a QGIS horizontal text alignment enum.Added in version 4.0.
setCurrentAlignment(self, alignment: Qgis.TextVerticalAlignment) Sets the current
alignmentchoice from a QGIS vertical text alignment enum.Added in version 4.0.
- Parameters:
alignment (Qt.AlignmentFlag)
- verticalAlignment(self) Qgis.TextVerticalAlignment[source]¶
Returns the current alignment choice as a QGIS horizontal text alignment enum.
See also
Added in version 4.0.
- Return type: