Class: QgsStatusBar

class qgis.gui.QgsStatusBar

Bases: PyQt5.QtWidgets.QWidget

A proxy widget for QStatusBar.

Unlike QStatusBar, QgsStatusBar allows finer control of widget placement, including the option to locate permanent widgets on the left side of the bar.

QgsStatusBar is designed to be embedded into an existing window’s QStatusBar, as a permanent widget. This allows reuse of the special QStatusBar handling for resize grips and other platform specific status bar tweaks.

Instead of adding child widgets and showing messages directly in the window’s status bar, these widgets (and messages) should instead be added into the embedded QgsStatusBar.

QgsStatusBar(parent: QWidget = None) Constructor for QgsStatusBar.

Methods

actionEvent

addPermanentWidget

Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a child of this object.

changeEvent

param event:

childEvent

clearMessage

Removes any temporary message being shown.

closeEvent

connectNotify

contextMenuEvent

create

currentMessage

Returns the current message shown in the status bar.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

removeWidget

Removes a widget from the status bar.

resizeEvent

sender

senderSignalIndex

setParentStatusBar

Sets the parent status bar.

sharedPainter

showEvent

showMessage

Displays the given message for the specified number of milli-seconds (timeout).

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Attributes

AnchorLeft

AnchorRight

class Anchor

Bases: int

AnchorLeft = 0
AnchorRight = 1
actionEvent(self, QActionEvent)
addPermanentWidget(self, widget: QWidget, stretch: int = 0, anchor: QgsStatusBar.Anchor = QgsStatusBar.AnchorRight)

Adds the given widget permanently to this status bar, reparenting the widget if it isn’t already a child of this object.

The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.

The anchor parameter controls which side of the status bar the widget should be anchored to.

Parameters:
  • widget (QWidget) –

  • stretch (int = 0) –

  • anchor (QgsStatusBar.Anchor = QgsStatusBar.AnchorRight) –

changeEvent(self, event: QEvent)
Parameters:

event (QEvent) –

childEvent(self, QChildEvent)
clearMessage(self)

Removes any temporary message being shown.

See also

showMessage()

closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentMessage(self) str

Returns the current message shown in the status bar.

See also

showMessage()

Return type:

str

customEvent(self, QEvent)
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)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
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
removeWidget(self, widget: QWidget)

Removes a widget from the status bar. Ownership of the widget remains unchanged, and the widget itself is not deleted.

Parameters:

widget (QWidget) –

resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setParentStatusBar(self, statusBar: QStatusBar)

Sets the parent status bar. Messages that are shown on the parent status bar will be intercepted and shown on this status bar too.

New in version 3.8.

Parameters:

statusBar (QStatusBar) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
showMessage(self, message: str, timeout: int = 0)

Displays the given message for the specified number of milli-seconds (timeout). If timeout is 0 (default), the message remains displayed until the clearMessage() slot is called or until the showMessage() slot is called again to change the message.

See also

clearMessage()

See also

currentMessage()

Parameters:
  • message (str) –

  • timeout (int = 0) –

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)