Class: QgsMessageBar¶
-
class
qgis.gui.
QgsMessageBar
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QFrame
Constructor for QgsMessageBar
A bar for displaying non-blocking messages to the user.
- Parameters
parent –
-
actionEvent
(self, QActionEvent)¶
-
changeEvent
(self, QEvent)¶
-
childEvent
(self, QChildEvent)¶
-
clearWidgets
(self) → bool¶ Remove all items from the bar’s widget list
- Return type
bool
- Returns
True
if all items were removed,False
otherwise
-
closeEvent
(self, QCloseEvent)¶
-
connectNotify
(self, QMetaMethod)¶
-
contextMenuEvent
(self, QContextMenuEvent)¶
-
create
(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
-
createMessage
(text: str, parent: QWidget = None) → QgsMessageBarItem¶ make out a widget containing a message to be displayed on the bar
createMessage(title: str, text: str, parent: QWidget = None) -> QgsMessageBarItem make out a widget containing title and message to be displayed on the bar
createMessage(widget: QWidget, parent: QWidget = None) -> QgsMessageBarItem make out a widget containing title and message to be displayed on the bar
- Parameters
text (str) –
parent (QWidget = None) –
- Return type
-
currentItem
(self) → QgsMessageBarItem¶ - Return type
-
customEvent
(self, QEvent)¶
-
destroy
(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dragEnterEvent
(self, QDragEnterEvent)¶
-
dragLeaveEvent
(self, QDragLeaveEvent)¶
-
dragMoveEvent
(self, QDragMoveEvent)¶
-
drawFrame
(self, QPainter)¶
-
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)¶
-
initStyleOption
(self, QStyleOptionFrame)¶
-
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, e: QMouseEvent)¶ - Parameters
e (QMouseEvent) –
-
mouseReleaseEvent
(self, QMouseEvent)¶
-
moveEvent
(self, QMoveEvent)¶
-
nativeEvent
(self, Union[QByteArray, bytes, bytearray], sip.voidptr) → Tuple[bool, int]¶
-
paintEvent
(self, QPaintEvent)¶
-
popWidget
(self, item: QgsMessageBarItem) → bool¶ Remove the passed widget from the bar (if previously added), then display the next one in the stack if any or hide the bar
- Parameters
item (QgsMessageBarItem) – item to remove
- Returns
True
if the widget was removed,False
otherwise
popWidget(self) -> bool Remove the currently displayed widget from the bar and display the next in the stack if any or hide the bar.
- Return type
bool
- Returns
True
if the widget was removed,False
otherwise
-
pushCritical
(self, title: str, message: str)¶ Pushes a critical warning with default timeout to the message bar
- Parameters
title (str) – title string for message
message (str) – The message to be displayed
New in version 2.8.
-
pushInfo
(self, title: str, message: str)¶ Pushes a information message with default timeout to the message bar
- Parameters
title (str) – title string for message
message (str) – The message to be displayed
New in version 2.8.
-
pushItem
(self, item: QgsMessageBarItem)¶ Display a message item on the bar after hiding the currently visible one and putting it in a stack. The message bar will take ownership of the item.
- Parameters
item (QgsMessageBarItem) – Item to display
-
pushMessage
(self, text: str, level: Qgis.MessageLevel = Qgis.Info, duration: int = 5)¶ convenience method for pushing a message to the bar
pushMessage(self, title: str, text: str, level: Qgis.MessageLevel = Qgis.Info, duration: int = 5) convenience method for pushing a message with title to the bar
pushMessage(self, title: str, text: str, showMore: str, level: Qgis.MessageLevel = Qgis.Info, duration: int = 5) convenience method for pushing a message to the bar with a detail text which be shown when pressing a “more” button
- Parameters
text (str) –
level (Qgis.MessageLevel = Qgis.Info) –
duration (int = 5) –
-
pushSuccess
(self, title: str, message: str)¶ Pushes a success message with default timeout to the message bar
- Parameters
title (str) – title string for message
message (str) – The message to be displayed
New in version 2.8.
-
pushWarning
(self, title: str, message: str)¶ Pushes a warning with default timeout to the message bar
- Parameters
title (str) – title string for message
message (str) – The message to be displayed
New in version 2.8.
-
pushWidget
(self, widget: QWidget, level: Qgis.MessageLevel = Qgis.Info, duration: int = 0) → QgsMessageBarItem¶ Display a widget as a message on the bar after hiding the currently visible one and putting it in a stack.
- Parameters
widget (QWidget) – message widget to display
level (Qgis.MessageLevel = Qgis.Info) – is Qgis.Info, Warning, Critical or Success
duration (int = 0) – timeout duration of message in seconds, 0 value indicates no timeout
- Return type
-
receivers
(self, PYQT_SIGNAL) → int¶
-
resizeEvent
(self, QResizeEvent)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
showEvent
(self, QShowEvent)¶
-
tabletEvent
(self, QTabletEvent)¶
-
timerEvent
(self, QTimerEvent)¶
-
updateMicroFocus
(self)¶
-
wheelEvent
(self, QWheelEvent)¶
-
widgetAdded
¶ emitted when a message widget is added to the bar [signal]
- Parameters
item (QgsMessageBarItem) –
-
widgetRemoved
¶ emitted when a message widget was removed from the bar [signal]
- Parameters
item (QgsMessageBarItem) –