Class: QgsAlignmentComboBox

class qgis.gui.QgsAlignmentComboBox

Bases: PyQt5.QtWidgets.QComboBox

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.

QgsAlignmentComboBox(parent: QWidget = None) Constructor for QgsAlignmentComboBox, with the specified parent widget.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentAlignment

Returns the current alignment choice.

customEvent

customizeAlignmentDisplay

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

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

Sets the available alignment choices shown in the combo box.

setCurrentAlignment

Sets the current alignment choice.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

changed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentAlignment(self) Qt.Alignment

Returns the current alignment choice.

Return type:

Qt.Alignment

customEvent(self, QEvent)
customizeAlignmentDisplay(self, alignment: 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(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionComboBox)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setAvailableAlignments(self, alignments: Qt.Alignment | Qt.AlignmentFlag)

Sets the available alignment choices shown in the combo box.

Parameters:

alignments (Union[Qt.Alignment) –

setCurrentAlignment(self, alignment: Qt.Alignment | Qt.AlignmentFlag)

Sets the current alignment choice.

Parameters:

alignment (Union[Qt.Alignment) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)