• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

Plasma::PopupApplet

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>

Inheritance diagram for Plasma::PopupApplet:
Plasma::Applet QGraphicsWidget

List of all members.

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 setGraphicsWidget (QGraphicsWidget *widget)
void setPassivePopup (bool passive)
void setPopupIcon (const QString &iconName)
void setPopupIcon (const QIcon &icon)
void setWidget (QWidget *widget)
virtual QWidget * widget ()
 ~PopupApplet ()

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)

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().

Definition at line 51 of file popupapplet.h.


Constructor & Destructor Documentation

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

Definition at line 53 of file popupapplet.cpp.

Plasma::PopupApplet::~PopupApplet (  ) 

Definition at line 64 of file popupapplet.cpp.


Member Function Documentation

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

Definition at line 391 of file popupapplet.cpp.

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

Definition at line 403 of file popupapplet.cpp.

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

Definition at line 422 of file popupapplet.cpp.

bool Plasma::PopupApplet::eventFilter ( QObject *  o,
QEvent *  e 
) [protected]

For internal use only.

event filter; used for focus watching

if (layout() && watched == graphicsWidget() && (event->type() == QEvent::GraphicsSceneResize)) { sizes are recalculated in the constraintsevent so let's just call that. d->popupConstraintsEvent(Plasma::FormFactorConstraint);

resize vertically if necesarry. if (formFactor() == Plasma::MediaCenter || formFactor() == Plasma::Planar) { resize(QSizeF(size().width(), minimumHeight())); } }

Reimplemented from Plasma::Applet.

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

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

Hides the popup.

Definition at line 458 of file popupapplet.cpp.

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

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

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

Definition at line 345 of file popupapplet.cpp.

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

Definition at line 357 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 479 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 108 of file popupapplet.cpp.

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

Definition at line 474 of file popupapplet.cpp.

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

Definition at line 132 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 483 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 103 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 70 of file popupapplet.cpp.

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

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

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

Toggles the popup.

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


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

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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