• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

Plasma

  • Plasma
  • PopupApplet
Public Slots | Public Member Functions | Protected Member Functions | Properties
Plasma::PopupApplet Class Reference

#include <popupapplet.h>

Inheritance diagram for Plasma::PopupApplet:
Inheritance graph
[legend]

List of all members.

Public Slots

void hidePopup ()
void showPopup (uint displayTime=0)
void togglePopup ()

Public Member Functions

 PopupApplet (QObject *parent, const QVariantList &args)
 ~PopupApplet ()
virtual QGraphicsWidget * graphicsWidget ()
bool isIconified () const
bool isPassivePopup () const
bool isPopupShowing () const
Qt::AlignmentFlag popupAlignment () const
QIcon popupIcon () const
Plasma::PopupPlacement popupPlacement () const
void setGraphicsWidget (QGraphicsWidget *widget)
void setPassivePopup (bool passive)
void setPopupAlignment (Qt::AlignmentFlag alignment)
void setPopupIcon (const QIcon &icon)
void setPopupIcon (const QString &iconName)
void setWidget (QWidget *widget)
virtual QWidget * widget ()

Protected Member Functions

void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
void dropEvent (QGraphicsSceneDragDropEvent *event)
bool eventFilter (QObject *watched, QEvent *event)
void mousePressEvent (QGraphicsSceneMouseEvent *event)
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void popupEvent (bool show)
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
void timerEvent (QTimerEvent *event)

Properties

Qt::AlignmentFlag popupAlignment

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. If you need a popup that does not steal window focus when openend or used, set window flag Qt::X11BypassWindowManagerHint the widget returned by widget() or graphicsWidget().


Constructor & Destructor Documentation

Plasma::PopupApplet::PopupApplet ( QObject *  parent,
const QVariantList &  args 
)

Definition at line 58 of file popupapplet.cpp.

Plasma::PopupApplet::~PopupApplet ( )

Definition at line 70 of file popupapplet.cpp.


Member Function Documentation

void Plasma::PopupApplet::dragEnterEvent ( QGraphicsSceneDragDropEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 520 of file popupapplet.cpp.

void Plasma::PopupApplet::dragLeaveEvent ( QGraphicsSceneDragDropEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 532 of file popupapplet.cpp.

void Plasma::PopupApplet::dropEvent ( QGraphicsSceneDragDropEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 551 of file popupapplet.cpp.

bool Plasma::PopupApplet::eventFilter ( QObject *  watched,
QEvent *  event 
) [protected]

Reimplemented from QGraphicsLayoutItem.

Reimplemented from Plasma::Applet.

Definition at line 478 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. If you set a popup icon you must also set a minimum size of the applet. When the applet is smaller than this minimum size, it will be displayed as that icon.

Definition at line 161 of file popupapplet.cpp.

void Plasma::PopupApplet::hidePopup ( ) [slot]

Hides the popup.

Definition at line 606 of file popupapplet.cpp.

bool Plasma::PopupApplet::isIconified ( ) const
Returns:
true if the applet is collapsed to an icon
Since:
4.6

Definition at line 662 of file popupapplet.cpp.

bool Plasma::PopupApplet::isPassivePopup ( ) const
Returns:
true if the dialog will be treated as a passive poup

Definition at line 652 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 657 of file popupapplet.cpp.

void Plasma::PopupApplet::mousePressEvent ( QGraphicsSceneMouseEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 456 of file popupapplet.cpp.

void Plasma::PopupApplet::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 468 of file popupapplet.cpp.

Qt::AlignmentFlag Plasma::PopupApplet::popupAlignment ( ) const
Returns:
the default alignment of the popup relative to the applet
Since:
4.6
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.

Parameters:
showtrue 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 640 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 120 of file popupapplet.cpp.

Plasma::PopupPlacement Plasma::PopupApplet::popupPlacement ( ) const
Returns:
the placement of the popup relating to the applet

Definition at line 625 of file popupapplet.cpp.

void Plasma::PopupApplet::setGraphicsWidget ( QGraphicsWidget *  widget)

Definition at line 170 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.

Parameters:
passivetrue if the dialog should be treated as a passive popup

Definition at line 647 of file popupapplet.cpp.

void Plasma::PopupApplet::setPopupAlignment ( Qt::AlignmentFlag  alignment)

Sets the default alignment of the popup relative to the applet.

Parameters:
alignmentthe alignment to use; Qt::AlignLeft or Qt::AlignRight
Since:
4.6

Definition at line 630 of file popupapplet.cpp.

void Plasma::PopupApplet::setPopupIcon ( const QIcon &  icon)
Parameters:
iconthe icon that has to be displayed when the applet is in a panel. Passing in a null icon means that the popup applet itself will provide an interface for when the PopupApplet is not showing the widget() or graphicsWidget() directly.

Definition at line 76 of file popupapplet.cpp.

void Plasma::PopupApplet::setPopupIcon ( const QString &  iconName)
Parameters:
iconthe icon that has to be displayed when the applet is in a panel. Passing in an empty QString() means that the popup applet itself will provide an interface for when the PopupApplet is not showing the widget() or graphicsWidget() directly.

If you set a popup icon you must also set a minimum size of the applet. When the applet is smaller than this minimum size, it will be displayed as that icon.

Definition at line 93 of file popupapplet.cpp.

void Plasma::PopupApplet::setWidget ( QWidget *  widget)

Definition at line 130 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.

Parameters:
displayTimethe 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 563 of file popupapplet.cpp.

QSizeF Plasma::PopupApplet::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint = QSizeF() 
) const [protected]

Reimplemented from QGraphicsLayoutItem.

Reimplemented from Plasma::Applet.

Definition at line 435 of file popupapplet.cpp.

void Plasma::PopupApplet::timerEvent ( QTimerEvent *  event) [protected]

Reimplemented from QGraphicsLayoutItem.

Reimplemented from Plasma::Applet.

Definition at line 581 of file popupapplet.cpp.

void Plasma::PopupApplet::togglePopup ( ) [slot]

Toggles the popup.

Definition at line 620 of file popupapplet.cpp.

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 125 of file popupapplet.cpp.


Property Documentation

Qt::AlignmentFlag Plasma::PopupApplet::popupAlignment [read, write]

Definition at line 55 of file popupapplet.h.


The documentation for this class was generated from the following files:
  • popupapplet.h
  • popupapplet.cpp

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal