orangewidget.utils.messagewidget

class orangewidget.utils.messagewidget.MessagesWidget(parent=None, openExternalLinks=False, elideText=False, defaultStyleSheet='', **kwargs)[source]

An iconified multiple message display area.

MessagesWidget displays a short message along with an icon. If there are multiple messages they are summarized. The user can click on the widget to display the full message text in a popup view.

Information = 1

General informative message.

Warning = 2

A warning message severity.

Error = 3

An error message severity.

setMessage(message_id: Hashable, message: orangewidget.utils.messagewidget.Message) None[source]

Add a message for message_id to the current display.

Note

Set an empty Message instance to clear the message display but retain the relative ordering in the display should a message for message_id reactivate.

removeMessage(message_id: Hashable) None[source]

Remove message for message_id from the display.

Note

Setting an empty Message instance will also clear the display, however the relative ordering of the messages will be retained, should the message_id ‘reactivate’.

setMessages(messages: Union[Iterable[Tuple[Hashable, orangewidget.utils.messagewidget.Message]], Dict[Hashable, orangewidget.utils.messagewidget.Message]]) None[source]

Set multiple messages in a single call.

clear() None[source]

Clear all messages.

messages() List[orangewidget.utils.messagewidget.Message][source]

Return all set messages.

Returns

messages

Return type

List[Message]

summarize() orangewidget.utils.messagewidget.Message[source]

Summarize all the messages into a single message.

mousePressEvent(self, QMouseEvent)[source]
class orangewidget.utils.messagewidget.Severity(value)[source]

An enum defining a severity level.

Information = 1

General informative message.

Warning = 2

A warning message severity.

Error = 3

An error message severity.

class orangewidget.utils.messagewidget.Message(severity=Severity.Information, icon=<PyQt5.QtGui.QIcon object>, text='', informativeText='', detailedText='', textFormat=0)[source]

A stateful message/notification.

Parameters
  • severity (Severity) – Severity level (default: Severity.Information).

  • icon (QIcon) – Associated icon. If empty the QStyle.standardIcon will be used based on severity.

  • text (str) – Short message text.

  • informativeText (str) – Extra informative text to append to text (space permitting).

  • detailedText (str) – Extra detailed text (e.g. exception traceback)

  • textFormat (Qt.TextFormat) – If Qt.RichText then the contents of text, informativeText and detailedText will be rendered as html instead of plain text.

Severity

Alias for Severity

Information = 1

Alias for Severity.Information

Warning = 2

Alias for Severity.Warning

Error = 3

Alias for Severity.Error

asHtml(includeShortText=True) str[source]

Render the message as an HTML fragment.

isEmpty() bool[source]

Is this message instance empty (has no text or icon)

property icon

Alias for field number 1