# eric7.UI.NotificationWidget

Module implementing a Notification widget.

### Global Attributes

None

### Classes

NotificationFrame | Class implementing a Notification widget.
NotificationTypes | Class implementing the notification types.
NotificationWidget | Class implementing a Notification list widget.

### Functions

None

## NotificationFrame

Class implementing a Notification widget.

### Derived from

QFrame, Ui_NotificationFrame

### Class Attributes

NotificationStyleSheetTemplate

### Class Methods

getIcon | Class method to get the icon for a specific notification kind.
getStyleSheet | Class method to get a style sheet for specific notification kind.

### Methods

NotificationFrame | Constructor

### Static Methods

None

#### NotificationFrame.getIcon (class method)

getIcon(kind)

Class method to get the icon for a specific notification kind.

kind (NotificationTypes)
  notification kind

Return:
  icon for the notification kind

Return Type:
  QPixmap

#### NotificationFrame.getStyleSheet (class method)

getStyleSheet(kind)

Class method to get a style sheet for specific notification kind.

kind (NotificationTypes)
  notification kind

Return:
  string containing the style sheet for the notification kind

Return Type:
  str

#### NotificationFrame (Constructor)

NotificationFrame(icon, heading, text, kind=NotificationTypes.INFORMATION, parent=None)

Constructor

icon (QPixmap)
  icon to be used
heading (str)
  heading to be used
text (str)
  text to be used
kind (NotificationTypes)
  kind of notification to be shown
parent (QWidget)
  reference to the parent widget

Up

## NotificationTypes

Class implementing the notification types.

### Derived from

enum.Enum

### Class Attributes

CRITICAL
INFORMATION
OTHER
WARNING

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## NotificationWidget

Class implementing a Notification list widget.

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

NotificationWidget | Constructor
__adjustSizeAndPosition | Private slot to adjust the notification list widget size and position.
__removeNotification | Private method to remove a notification from the list.
mouseMoveEvent | Protected method to handle dragging the window.
mousePressEvent | Protected method to handle presses of a mouse button.
mouseReleaseEvent | Protected method to handle releases of a mouse button.
showNotification | Public method to show a notification.

### Static Methods

None

#### NotificationWidget (Constructor)

NotificationWidget(parent=None, setPosition=False)

Constructor

parent (QWidget)
  reference to the parent widget
setPosition (bool)
  flag indicating to set the display position interactively

#### NotificationWidget.__adjustSizeAndPosition

__adjustSizeAndPosition()

Private slot to adjust the notification list widget size and position.

#### NotificationWidget.__removeNotification

__removeNotification(notification)

Private method to remove a notification from the list.

notification (NotificationFrame)
  reference to the notification to be removed

#### NotificationWidget.mouseMoveEvent

mouseMoveEvent(evt)

Protected method to handle dragging the window.

evt
  reference to the mouse event (QMouseEvent)

#### NotificationWidget.mousePressEvent

mousePressEvent(evt)

Protected method to handle presses of a mouse button.

evt
  reference to the mouse event (QMouseEvent)

#### NotificationWidget.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method to handle releases of a mouse button.

evt
  reference to the mouse event (QMouseEvent)

#### NotificationWidget.showNotification

showNotification(icon, heading, text, kind=NotificationTypes.INFORMATION, timeout=0)

Public method to show a notification.

icon (QPixmap)
  icon to be used
heading (str)
  heading to be used
text (str)
  text to be used
kind (NotificationTypes)
  kind of notification to be shown
timeout (int)
  timeout in seconds after which the notification is to be removed (0 = do not remove until it is clicked on)

Up