Orange.widgets.utils.messagewidget

class Orange.widgets.utils.messagewidget.MessagesWidget(parent=None, openExternalLinks=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.

linkActivated

Signal emitted when an embedded html link is clicked (if openExternalLinks is False).

linkHovered

Signal emitted when an embedded html link is hovered.

Information = 1

General informative message.

Warning = 2

A warning message severity.

Error = 3

An error message severity.

sizeHint(self) → QSize[source]
minimumSizeHint(self) → QSize[source]

If True then linkActivated signal will be emitted when the user clicks on an html link in a message, otherwise links are opened using QDesktopServices.openUrl

setDefaultStyleSheet(css)[source]

Set a default css to apply to the rendered text.

Parameters:css (str) – A css style sheet as supported by Qt’s Rich Text support.

Note

Not to be confused with QWidget.styleSheet

defaultStyleSheet()[source]
Returns:css – The current style sheet
Return type:str
setMessage(message_id, message)[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)[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)[source]

Set multiple messages in a single call.

clear()[source]

Clear all messages.

messages()[source]

Return all set messages.

Returns:messages
Return type:List[Message]
summarize()[source]

Summarize all the messages into a single message.

mousePressEvent(self, QMouseEvent)[source]
enterEvent(self, QEvent)[source]
leaveEvent(self, QEvent)[source]
changeEvent(self, QEvent)[source]
paintEvent(self, QPaintEvent)[source]
class Orange.widgets.utils.messagewidget.Severity[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 Orange.widgets.utils.messagewidget.Message[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()[source]

Render the message as an HTML fragment.

isEmpty()[source]

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

icon

Alias for field number 1