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
Returns the current alignment choice.
Sets the
text
andicon
to use for a particularalignment
option, replacing the default text or icon.Sets the available alignment choices shown in the combo box.
Sets the current
alignment
choice.Signals
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.
See also
- Return type:
Qt.Alignment
- customEvent(self, QEvent)¶
- customizeAlignmentDisplay(self, alignment: Qt.Alignment | Qt.AlignmentFlag, text: str = '', icon: QIcon = QIcon())¶
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) –
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.See also
- Parameters:
alignment (Union[Qt.Alignment) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶