Plasma
Plasma::PopupApplet Class Reference
Allows applets to automatically 'collapse' into an icon when put in an panel, and is a convenient base class for any applet that wishes to use extenders. More...
#include <popupapplet.h>

Public Slots | |
void | hidePopup () |
void | showPopup (uint displayTime=0) |
void | togglePopup () |
Public Member Functions | |
virtual QGraphicsWidget * | graphicsWidget () |
bool | isPassivePopup () const |
bool | isPopupShowing () const |
PopupApplet (QObject *parent, const QVariantList &args) | |
QIcon | popupIcon () const |
Plasma::PopupPlacement | popupPlacement () const |
void | setPassivePopup (bool passive) |
void | setPopupIcon (const QString &iconName) |
void | setPopupIcon (const QIcon &icon) |
virtual QWidget * | widget () |
~PopupApplet () | |
Protected Member Functions | |
bool | eventFilter (QObject *watched, QEvent *event) |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
virtual void | popupEvent (bool show) |
Detailed Description
Allows applets to automatically 'collapse' into an icon when put in an panel, and is a convenient base class for any applet that wishes to use extenders.Applets that subclass this class should implement either widget() or graphicsWidget() to return a widget that will be displayed in the applet if the applet is in a Planar or MediaCenter form factor. If the applet is put in a panel, an icon will be displayed instead, which shows the widget in a popup when clicked.
If you use this class as a base class for your extender using applet, the extender will automatically be used for the popup; reimplementing graphicsWidget() is unnecessary in this case.
Definition at line 49 of file popupapplet.h.
Constructor & Destructor Documentation
Plasma::PopupApplet::PopupApplet | ( | QObject * | parent, | |
const QVariantList & | args | |||
) |
Definition at line 46 of file popupapplet.cpp.
Plasma::PopupApplet::~PopupApplet | ( | ) |
Definition at line 55 of file popupapplet.cpp.
Member Function Documentation
For internal use only.
event filter; used for focus watching
Reimplemented from Plasma::Applet.
Definition at line 347 of file popupapplet.cpp.
QGraphicsWidget * Plasma::PopupApplet::graphicsWidget | ( | ) | [virtual] |
Implement either this function or widget().
- Returns:
- the widget that will get shown in either a layout, in the applet or in a Dialog, depending on the form factor of the applet.
Definition at line 109 of file popupapplet.cpp.
void Plasma::PopupApplet::hidePopup | ( | ) | [slot] |
bool Plasma::PopupApplet::isPassivePopup | ( | ) | const |
- Returns:
- true if the dialog will be treated as a passive poup
Definition at line 430 of file popupapplet.cpp.
bool Plasma::PopupApplet::isPopupShowing | ( | ) | const [virtual] |
- Returns:
- true if the applet is popped up
Reimplemented from Plasma::Applet.
Definition at line 435 of file popupapplet.cpp.
void Plasma::PopupApplet::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 325 of file popupapplet.cpp.
void Plasma::PopupApplet::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 337 of file popupapplet.cpp.
void Plasma::PopupApplet::popupEvent | ( | bool | show | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive an event before the popup is shown or hidden.
- show true if the popup is going to be shown, false if the popup is going to be hidden. Note that showing and hiding the popup on click is already done in PopupApplet.
Definition at line 411 of file popupapplet.cpp.
QIcon Plasma::PopupApplet::popupIcon | ( | ) | const |
- Returns:
- the icon that is displayed when the applet is in a panel.
Definition at line 99 of file popupapplet.cpp.
Plasma::PopupPlacement Plasma::PopupApplet::popupPlacement | ( | ) | const |
- Returns:
- the placement of the popup relating to the icon
Definition at line 406 of file popupapplet.cpp.
void Plasma::PopupApplet::setPassivePopup | ( | bool | passive | ) |
Sets whether or not the dialog popup that gets created should be a "passive" popup that does not steal focus from other windows or not.
- passive true if the dialog should be treated as a passive popup
Definition at line 415 of file popupapplet.cpp.
void Plasma::PopupApplet::setPopupIcon | ( | const QString & | iconName | ) |
- icon the icon that has to be displayed when the applet is in a panel.
Definition at line 94 of file popupapplet.cpp.
void Plasma::PopupApplet::setPopupIcon | ( | const QIcon & | icon | ) |
- icon the icon that has to be displayed when the applet is in a panel.
Definition at line 61 of file popupapplet.cpp.
void Plasma::PopupApplet::showPopup | ( | uint | displayTime = 0 |
) | [slot] |
Shows the dialog showing the widget if the applet is in a panel.
- displayTime the time in ms that the popup should be displayed, defaults to 0 which means always (until the user closes it again, that is).
Definition at line 370 of file popupapplet.cpp.
void Plasma::PopupApplet::togglePopup | ( | ) | [slot] |
QWidget * Plasma::PopupApplet::widget | ( | ) | [virtual] |
Implement either this function or graphicsWidget().
- Returns:
- the widget that will get shown in either a layout, in the applet or in a Dialog, depending on the form factor of the applet.
Definition at line 104 of file popupapplet.cpp.
The documentation for this class was generated from the following files: