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

Plasma

Plasma::PushButton

Plasma::PushButton Class Reference

Provides a plasma-themed KPushButton. More...

#include <Plasma/Widgets/PushButton>

Inheritance diagram for Plasma::PushButton:
QGraphicsProxyWidget

List of all members.

Signals

void clicked ()
void toggled (bool)

Public Member Functions

QAction * action () const
QIcon icon () const
QString image () const
bool isChecked () const
KPushButton * nativeWidget () const
 PushButton (QGraphicsWidget *parent=0)
void setAction (QAction *action)
void setCheckable (bool checkable)
void setChecked (bool checked)
void setIcon (const QIcon &icon)
void setImage (const QString &path)
void setStyleSheet (const QString &stylesheet)
void setText (const QString &text)
QString styleSheet ()
QString text () const
 ~PushButton ()

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
void resizeEvent (QGraphicsSceneResizeEvent *event)

Properties

QAction action
QString image
KPushButton nativeWidget
QGraphicsWidget parentWidget
QString stylesheet
QString text

Detailed Description

Provides a plasma-themed KPushButton.

Definition at line 39 of file pushbutton.h.


Constructor & Destructor Documentation

Plasma::PushButton::PushButton ( QGraphicsWidget *  parent = 0  )  [explicit]

Definition at line 152 of file pushbutton.cpp.

Plasma::PushButton::~PushButton (  ) 

Definition at line 173 of file pushbutton.cpp.


Member Function Documentation

QAction* Plasma::PushButton::action (  )  const
Returns:
the currently associated action, if any.
Since:
4.3
void Plasma::PushButton::clicked (  )  [signal]
void Plasma::PushButton::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event  )  [protected]

Definition at line 415 of file pushbutton.cpp.

void Plasma::PushButton::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event  )  [protected]

Definition at line 435 of file pushbutton.cpp.

QIcon Plasma::PushButton::icon (  )  const
Returns:
the icon of this button
Since:
4.3

Definition at line 246 of file pushbutton.cpp.

QString Plasma::PushButton::image (  )  const
Returns:
the image path being displayed currently, or an empty string if none.
bool Plasma::PushButton::isChecked (  )  const
Returns:
true if the button is checked; requires setIsCheckable(true) to be called
Since:
4.3

Definition at line 261 of file pushbutton.cpp.

KPushButton* Plasma::PushButton::nativeWidget (  )  const
Returns:
the native widget wrapped by this PushButton
void Plasma::PushButton::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
) [protected]

Definition at line 294 of file pushbutton.cpp.

void Plasma::PushButton::resizeEvent ( QGraphicsSceneResizeEvent *  event  )  [protected]

Definition at line 271 of file pushbutton.cpp.

void Plasma::PushButton::setAction ( QAction *  action  ) 

Associate an action with this IconWidget this makes the button follow the state of the action, using its icon, text, etc.

when the button is clicked, it will also trigger the action.

Since:
4.3

Definition at line 231 of file pushbutton.cpp.

void Plasma::PushButton::setCheckable ( bool  checkable  ) 

Sets whether or not this button can be toggled on/off.

Since:
4.3

Definition at line 251 of file pushbutton.cpp.

void Plasma::PushButton::setChecked ( bool  checked  ) 

Sets whether or not this button is checked.

Implies setIsCheckable(true).

Since:
4.3

Definition at line 256 of file pushbutton.cpp.

void Plasma::PushButton::setIcon ( const QIcon &  icon  ) 

sets the icon for this toolbutton

  • icon the icon we want to use
Since:
4.3

Definition at line 241 of file pushbutton.cpp.

void Plasma::PushButton::setImage ( const QString &  path  ) 

Sets the path to an image to display.

  • path the path to the image; if a relative path, then a themed image will be loaded.

Definition at line 188 of file pushbutton.cpp.

void Plasma::PushButton::setStyleSheet ( const QString &  stylesheet  ) 

Sets the stylesheet used to control the visual display of this PushButton.

  • stylesheet a CSS string

Definition at line 221 of file pushbutton.cpp.

void Plasma::PushButton::setText ( const QString &  text  ) 

Sets the display text for this PushButton.

  • text the text to display; should be translated.

Definition at line 178 of file pushbutton.cpp.

QString Plasma::PushButton::styleSheet (  ) 
Returns:
the stylesheet currently used with this widget

Definition at line 226 of file pushbutton.cpp.

QString Plasma::PushButton::text (  )  const
Returns:
the display text
void Plasma::PushButton::toggled ( bool   )  [signal]

Property Documentation

QAction * Plasma::PushButton::action [read, write]

Definition at line 48 of file pushbutton.h.

QString Plasma::PushButton::image [read, write]

Definition at line 45 of file pushbutton.h.

KPushButton * Plasma::PushButton::nativeWidget [read]

Definition at line 47 of file pushbutton.h.

QGraphicsWidget Plasma::PushButton::parentWidget [read]

Definition at line 43 of file pushbutton.h.

QString Plasma::PushButton::stylesheet [read, write]

Definition at line 46 of file pushbutton.h.

QString Plasma::PushButton::text [read, write]

Definition at line 44 of file pushbutton.h.


The documentation for this class was generated from the following files:
  • pushbutton.h
  • pushbutton.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