Subgroup: Layout

Class: QgsLayoutUnitsComboBox

class qgis.gui.QgsLayoutUnitsComboBox

Bases: PyQt5.QtWidgets.QComboBox

A custom combo box for selecting units for layout settings.

New in version 3.0: Methods

acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
addItem addItem(self, QIcon, str, userData: Any = None)
addItems
adjustSize
autoFillBackground
backgroundRole
baseSize
blockSignals
changeEvent
childAt childAt(self, int, int) -> QWidget
childEvent
children
childrenRect
childrenRegion
clear
clearEditText
clearFocus
clearMask
close
closeEvent
colorCount
completer
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
converter Returns the converter used when automatically converting units for linked widgets.
count
create
createWindowContainer
currentData
currentIndex
currentText
cursor
customEvent
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
duplicatesEnabled
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
find
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
findData
findText
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse grabMouse(self, Union[QCursor, Qt.CursorShape])
grabShortcut
graphicsEffect
graphicsProxyWidget
hasFocus
hasFrame
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
hidePopup
iconSize
inherits
initPainter
initStyleOption
inputMethodEvent
inputMethodHints
inputMethodQuery inputMethodQuery(self, Qt.InputMethodQuery, Any) -> Any
insertAction
insertActions
insertItem insertItem(self, int, QIcon, str, userData: Any = None)
insertItems
insertPolicy
insertSeparator
installEventFilter
isActiveWindow
isAncestorOf
isEditable
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
itemData
itemDelegate
itemIcon
itemText
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
lineEdit
linkToWidget Registers a spin box widget as linked with the combo box.
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maxCount
maxVisibleItems
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumContentsLength
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
model
modelColumn
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move move(self, int, int)
moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
physicalDpiX
physicalDpiY
pos
previousInFocusChain
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
raise_
receivers
rect
releaseKeyboard
releaseMouse
releaseShortcut
removeAction
removeEventFilter
removeItem
render render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren))
repaint repaint(self, int, int, int, int)
resize resize(self, int, int)
resizeEvent
restoreGeometry
rootModelIndex
saveGeometry
scroll scroll(self, int, int, QRect)
sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize setBaseSize(self, QSize)
setCompleter
setContentsMargins setContentsMargins(self, QMargins)
setContextMenuPolicy
setConverter Sets a converter to use when automatically converting units for linked widgets.
setCurrentIndex
setCurrentText
setCursor
setDisabled
setDuplicatesEnabled
setEditText
setEditable
setEnabled
setFixedHeight
setFixedSize setFixedSize(self, int, int)
setFixedWidth
setFocus setFocus(self, Qt.FocusReason)
setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setFrame
setGeometry setGeometry(self, int, int, int, int)
setGraphicsEffect
setHidden
setIconSize
setInputMethodHints
setInsertPolicy
setItemData
setItemDelegate
setItemIcon
setItemText
setLayout
setLayoutDirection
setLineEdit
setLocale
setMask setMask(self, QRegion)
setMaxCount
setMaxVisibleItems
setMaximumHeight
setMaximumSize setMaximumSize(self, QSize)
setMaximumWidth
setMinimumContentsLength
setMinimumHeight
setMinimumSize setMinimumSize(self, QSize)
setMinimumWidth
setModel
setModelColumn
setMouseTracking
setObjectName
setPalette
setParent setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType])
setProperty
setRootModelIndex
setShortcutAutoRepeat
setShortcutEnabled
setSizeAdjustPolicy
setSizeIncrement setSizeIncrement(self, QSize)
setSizePolicy setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy)
setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setToolTip
setToolTipDuration
setUnit Sets the unit currently selected in the combo box.
setUpdatesEnabled
setValidator
setView
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
showPopup
signalsBlocked
size
sizeAdjustPolicy
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
toolTip
toolTipDuration
tr
underMouse
ungrabGesture
unit Returns the unit currently selected in the combo box.
unsetCursor
unsetLayoutDirection
unsetLocale
update update(self, QRect)
updateGeometry
updateMicroFocus
updatesEnabled
validator
view
visibleRegion
whatsThis
wheelEvent
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y

Attributes

AdjustToContents
AdjustToContentsOnFirstShow
AdjustToMinimumContentsLength
AdjustToMinimumContentsLengthWithIcon
DrawChildren
DrawWindowBackground
IgnoreMask
InsertAfterCurrent
InsertAlphabetically
InsertAtBottom
InsertAtCurrent
InsertAtTop
InsertBeforeCurrent
NoInsert
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
activated activated(self, int) [signal]
changed Emitted when the unit is changed.
currentIndexChanged currentIndexChanged(self, int) [signal]
currentTextChanged currentTextChanged(self, str) [signal]
customContextMenuRequested customContextMenuRequested(self, QPoint) [signal]
destroyed destroyed(self, QObject = None) [signal]
editTextChanged editTextChanged(self, str) [signal]
highlighted highlighted(self, int) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
windowIconChanged windowIconChanged(self, QIcon) [signal]
windowIconTextChanged windowIconTextChanged(self, str) [signal]
windowTitleChanged windowTitleChanged(self, str) [signal]
actionEvent()
changeEvent()
changed

Emitted when the unit is changed. [signal]

childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
converter(self) → QgsLayoutMeasurementConverter

Returns the converter used when automatically converting units for linked widgets.

See also

setConverter()

create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
linkToWidget(self, widget: QDoubleSpinBox)

Registers a spin box widget as linked with the combo box.

Registered spin boxes will automatically be upodated whenever the unit is changed. I.e. a spin box with a value of 100 will be set to 1 when the unit is changed from centimeters to meters.

A measurement converter() must be set in order for the automatic unit conversion to occur.

See also

setConverter()

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setConverter(self, converter: QgsLayoutMeasurementConverter)

Sets a converter to use when automatically converting units for linked widgets. The ownership of converter is not transferred, and converter must exist for the life of the combo box.

See also

converter()

setUnit(self, unit: QgsUnitTypes.LayoutUnit)

Sets the unit currently selected in the combo box.

See also

unit()

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
unit(self) → QgsUnitTypes.LayoutUnit

Returns the unit currently selected in the combo box.

See also

setUnit()

updateMicroFocus()
wheelEvent()