spinetoolbox.widgets.notification

Contains a notification widget.

Module Contents

Classes

Notification

Custom pop-up notification widget with fade-in and fade-out effect.

ButtonNotification

A notification with a button.

LinkNotification

A notification that may have a link.

ChangeNotifier

param parent

class spinetoolbox.widgets.notification.Notification(parent, txt, anim_duration=_FADE_IN_OUT_DURATION, life_span=None, word_wrap=True, corner=Qt.TopRightCorner)[source]

Bases: PySide6.QtWidgets.QFrame

Custom pop-up notification widget with fade-in and fade-out effect.

Parameters
  • parent (QWidget) – Parent widget

  • txt (str) – Text to display in notification

  • anim_duration (int) – Duration of the animation in msecs

  • life_span (int) – How long does the notification stays in place in msecs

  • word_wrap (bool) –

  • corner (Qt.Corner) –

_FADE_IN_OUT_DURATION = 500[source]
opacity[source]
show()[source]

Shows widget and moves it to the selected corner of the parent widget.

get_opacity()[source]

opacity getter.

set_opacity(op)[source]

opacity setter.

update_opacity(value)[source]

Updates graphics effect opacity.

start_self_destruction()[source]

Starts fade-out animation and closing of the notification.

enterEvent(e)[source]

Pauses timer as the mouse hovers the notification.

leaveEvent(e)[source]

Starts self destruction after the mouse leaves the notification.

remaining_time()[source]
class spinetoolbox.widgets.notification.ButtonNotification(*args, button_text='', button_slot=None, **kwargs)[source]

Bases: Notification

A notification with a button.

Parameters
  • parent (QWidget) – Parent widget

  • txt (str) – Text to display in notification

  • anim_duration (int) – Duration of the animation in msecs

  • life_span (int) – How long does the notification stays in place in msecs

  • word_wrap (bool) –

  • corner (Qt.Corner) –

class spinetoolbox.widgets.notification.LinkNotification(*args, open_link=None, **kwargs)[source]

Bases: Notification

A notification that may have a link.

Parameters
  • parent (QWidget) – Parent widget

  • txt (str) – Text to display in notification

  • anim_duration (int) – Duration of the animation in msecs

  • life_span (int) – How long does the notification stays in place in msecs

  • word_wrap (bool) –

  • corner (Qt.Corner) –

class spinetoolbox.widgets.notification.ChangeNotifier(parent, undo_stack, settings, settings_key, corner=Qt.BottomRightCorner)[source]

Bases: PySide6.QtCore.QObject

Parameters
  • parent (QWidget) –

  • undo_stack (QUndoStack) –

  • settings (QSettings) –

  • settings_key (str) –

  • corner (int) –

_ANIMATION_LIFE_SPAN = 5000[source]
_push_notification(index)[source]
tear_down()[source]

Tears down the notifier.