Class: QgsAlignmentComboBox

class qgis.gui.QgsAlignmentComboBox(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QComboBox

Constructor for QgsAlignmentComboBox, with the specified parent widget.

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.

New in version 3.10.

Parameters

parent

actionEvent()
changeEvent()
changed

Emitted when the alignment is changed. [signal]

childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
currentAlignment(self) → Qt.Alignment

Returns the current alignment choice.

Return type

Qt.Alignment

customEvent()
customizeAlignmentDisplay(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag], text: str = '', icon: QIcon = QIcon())

Sets the text and icon to use for a particular alignment option, replacing the default text or icon.

If text or icon 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) –

  • text (str = '') –

  • icon (QIcon = QIcon()) –

destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setAvailableAlignments(self, alignments: Union[Qt.Alignment, Qt.AlignmentFlag])

Sets the available alignment choices shown in the combo box.

Parameters

alignments (Union[Qt.Alignment) –

setCurrentAlignment(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag])

Sets the current alignment choice.

Parameters

alignment (Union[Qt.Alignment) –

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()