spinetoolbox.widgets.notification

Contains a notification widget.

author
  1. Savolainen (VTT)

date

12.12.2019

Module Contents

Classes

Notification

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

InteractiveNotification

A notification that doesn’t dissapear when the cursor is on it.

ButtonNotification

A notification with a button.

LinkNotification

A notification that may have a link.

NotificationStack

ChangeNotifier

param parent

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

Bases: PySide2.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) –

opacity[source]
show(self)[source]
get_opacity(self)[source]

opacity getter.

set_opacity(self, op)[source]

opacity setter.

update_opacity(self, value)[source]

Updates graphics effect opacity.

start_self_destruction(self)[source]

Starts fade-out animation and closing of the notification.

enterEvent(self, e)[source]
dragEnterEvent(self, e)[source]
remaining_time(self)[source]
class spinetoolbox.widgets.notification.InteractiveNotification(parent, txt, anim_duration=500, life_span=None, word_wrap=True, corner=Qt.TopRightCorner)[source]

Bases: Notification

A notification that doesn’t dissapear when the cursor is on it.

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) –

enterEvent(self, e)[source]

Pauses timer as the mouse hovers the notification.

leaveEvent(self, e)[source]

Starts self destruction after the mouse leaves the notification.

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

Bases: InteractiveNotification

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: InteractiveNotification

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.NotificationStack(parent, anim_duration=500, life_span=None)[source]

Bases: PySide2.QtCore.QObject

push_notification(self, notification)[source]

Pushes a notification to the stack with the given text.

push(self, txt)[source]
handle_notification_destroyed(self, notification, height)[source]

Removes from the stack the given notification and move up subsequent ones.

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

Bases: PySide2.QtCore.QObject

Parameters
  • parent (QWidget) –

  • undo_stack (QUndoStack) –

  • settings (QSettings) –

  • settings_key (str) –

_push_notification(self, index)[source]