digiKam
|
A dialog-like popup that displays messages without interrupting the user. More...
Public Types | |
enum | PopupStyle { Boxed , Balloon } |
Public Slots | |
void | setPopupStyle (int popupstyle) |
void | setTimeout (int delay) |
void | setVisible (bool visible) override |
void | show (const QPoint &p) |
Signals | |
void | clicked () |
void | clicked (const QPoint &pos) |
Public Member Functions | |
QPoint | anchor () const |
bool | autoDelete () const |
DNotificationPopup (QWidget *const parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags()) | |
DNotificationPopup (WId parent) | |
void | setAnchor (const QPoint &anchor) |
virtual void | setAutoDelete (bool autoDelete) |
virtual void | setView (const QString &caption, const QString &text, const QPixmap &icon) |
void | setView (const QString &caption, const QString &text=QString()) |
void | setView (QWidget *child) |
QWidget * | standardView (const QString &caption, const QString &text, const QPixmap &icon, QWidget *parent=nullptr) |
int | timeout () const |
QWidget * | view () const |
~DNotificationPopup () override | |
Static Public Member Functions | |
static DNotificationPopup * | message (const QString &caption, const QString &text, const QPixmap &icon, QSystemTrayIcon *parent, int timeout=-1) |
static DNotificationPopup * | message (const QString &caption, const QString &text, const QPixmap &icon, QWidget *parent, int timeout=-1, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (const QString &caption, const QString &text, const QPixmap &icon, WId parent, int timeout=-1, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (const QString &caption, const QString &text, QSystemTrayIcon *parent) |
static DNotificationPopup * | message (const QString &caption, const QString &text, QWidget *parent, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (const QString &text, QSystemTrayIcon *parent) |
static DNotificationPopup * | message (const QString &text, QWidget *parent, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (int popupStyle, const QString &caption, const QString &text, const QPixmap &icon, QSystemTrayIcon *parent, int timeout=-1) |
static DNotificationPopup * | message (int popupStyle, const QString &caption, const QString &text, const QPixmap &icon, QWidget *parent, int timeout=-1, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (int popupStyle, const QString &caption, const QString &text, const QPixmap &icon, WId parent, int timeout=-1, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (int popupStyle, const QString &caption, const QString &text, QSystemTrayIcon *parent) |
static DNotificationPopup * | message (int popupStyle, const QString &caption, const QString &text, QWidget *parent, const QPoint &p=QPoint()) |
static DNotificationPopup * | message (int popupStyle, const QString &text, QSystemTrayIcon *parent) |
static DNotificationPopup * | message (int popupStyle, const QString &text, QWidget *parent, const QPoint &p=QPoint()) |
Protected Member Functions | |
virtual QPoint | defaultLocation () const |
void | hideEvent (QHideEvent *) override |
void | mouseReleaseEvent (QMouseEvent *e) override |
void | moveNear (const QRect &target) |
void | paintEvent (QPaintEvent *pe) override |
virtual void | positionSelf () |
Properties | |
bool | autoDelete |
int | timeout |
A dialog-like popup that displays messages without interrupting the user.
The simplest uses of DNotificationPopup are by using the various message() static methods. The position the popup appears at depends on the type of the parent window:
Styles that a DNotificationPopup can have.
Enumerator | |
---|---|
Boxed | Information will appear in a framed box (default) |
Balloon | Information will appear in a comic-alike balloon. |
|
explicit |
Creates a popup for the specified widget.
Referenced by message().
|
explicit |
Creates a popup for the specified window.
|
override |
Cleans up.
QPoint Digikam::DNotificationPopup::anchor | ( | ) | const |
Returns the position to which this popup is anchored.
Referenced by setAnchor().
bool Digikam::DNotificationPopup::autoDelete | ( | ) | const |
Returns whether the popup will be deleted when it is hidden.
|
signal |
Emitted when the popup is clicked.
Referenced by mouseReleaseEvent().
|
signal |
Emitted when the popup is clicked.
|
protectedvirtual |
Returns a default location for popups when a better placement cannot be found.
The default implementation returns the top-left corner of the available work area of the desktop (ie: minus panels, etc).
Referenced by positionSelf().
|
overrideprotected |
@reimp
|
static |
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
|
static |
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
|
static |
Convenience method that displays popup with the specified icon, caption and message beside the icon of the specified window. Note that the returned object is destroyed when it is hidden.
|
static |
Convenience method that displays popup with the specified caption and message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
Referenced by message(), and Digikam::EditorWindow::slotLoadingFinished().
|
static |
Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
References DNotificationPopup(), moveNear(), setAutoDelete(), setPopupStyle(), setView(), show(), and timeout.
|
static |
Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
References DNotificationPopup(), setAutoDelete(), setPopupStyle(), setView(), show(), and timeout.
|
static |
Convenience method that displays popup with the specified popup-style, icon, caption and message beside the icon of the specified window. Note that the returned object is destroyed when it is hidden.
References DNotificationPopup(), setAutoDelete(), setPopupStyle(), setView(), show(), and timeout.
|
static |
Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified popup-style, caption and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified popup-style and message beside the icon of the specified QSystemTrayIcon. Note that the returned object is destroyed when it is hidden.
References message().
|
static |
Convenience method that displays popup with the specified popup-style and message beside the icon of the specified widget. Note that the returned object is destroyed when it is hidden.
References message().
|
overrideprotected |
@reimp
References clicked().
|
protected |
Moves the popup to be adjacent to target
.
The popup will be placed adjacent to, but outside of, target
, without going off the current desktop.
Reimplementations of positionSelf() can use this to actually position the popup.
References Balloon, and setAnchor().
Referenced by message(), and positionSelf().
|
overrideprotected |
@reimp
References Balloon.
|
protectedvirtual |
Positions the popup.
The default implementation attempts to place it by the taskbar entry; failing that it places it by the window of the associated widget; failing that it places it at the location given by defaultLocation().
References defaultLocation(), and moveNear().
Referenced by setVisible().
void Digikam::DNotificationPopup::setAnchor | ( | const QPoint & | anchor | ) |
Sets the anchor of this popup.
The popup is placed near to the anchor.
References anchor().
Referenced by moveNear(), and setVisible().
|
virtual |
Sets whether the popup will be deleted when it is hidden.
The default is false (unless created by one of the static message() overloads).
References autoDelete.
Referenced by message().
|
slot |
Sets the visual appearance of the popup.
References Balloon, and Boxed.
Referenced by message().
|
slot |
|
virtual |
Creates a standard view then calls setView(QWidget*) .
References setView(), and standardView().
void Digikam::DNotificationPopup::setView | ( | const QString & | caption, |
const QString & | text = QString() |
||
) |
Creates a standard view then calls setView(QWidget*) .
References setView().
void Digikam::DNotificationPopup::setView | ( | QWidget * | child | ) |
|
overrideslot |
@reimp
References Balloon, positionSelf(), and setAnchor().
|
slot |
Shows the popup in the given point
Referenced by message().
QWidget * Digikam::DNotificationPopup::standardView | ( | const QString & | caption, |
const QString & | text, | ||
const QPixmap & | icon, | ||
QWidget * | parent = nullptr |
||
) |
Returns a widget that is used as standard view if one of the setView() methods taking the QString arguments is used. You can use the returned widget to customize the passivepopup while keeping the look similar to the "standard" passivepopups.
After customizing the widget, pass it to setView( QWidget* )
caption | The window caption (title) on the popup |
text | The text for the popup |
icon | The icon to use for the popup |
parent | The parent widget used for the returned widget. If left 0, then "this", i.e. the passive popup object will be used. |
Referenced by setView().
int Digikam::DNotificationPopup::timeout | ( | ) | const |
Returns the delay before the popup is removed automatically.
QWidget * Digikam::DNotificationPopup::view | ( | ) | const |
Returns the main view.
|
readwrite |
Referenced by setAutoDelete().
|
readwrite |
Referenced by message().