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

Plasma

  • Plasma
  • PushButton
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties

Plasma::PushButton Class Reference

Provides a plasma-themed KPushButton. More...

#include <Plasma/Widgets/PushButton>

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

List of all members.

Public Slots

void click ()
void setChecked (bool checked)

Signals

void clicked ()
void pressed ()
void released ()
void toggled (bool)

Public Member Functions

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

Protected Member Functions

void changeEvent (QEvent *event)
void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
void resizeEvent (QGraphicsSceneResizeEvent *event)
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint) const

Properties

QAction action
bool checkable
bool checked
bool down
QIcon icon
QString image
KPushButton nativeWidget
QGraphicsWidget parentWidget
QString styleSheet
QString text

Detailed Description

Provides a plasma-themed KPushButton.

Definition at line 41 of file pushbutton.h.


Constructor & Destructor Documentation

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

Definition at line 163 of file pushbutton.cpp.

Plasma::PushButton::~PushButton ( )

Definition at line 198 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::changeEvent ( QEvent *  event) [protected]

Definition at line 487 of file pushbutton.cpp.

void Plasma::PushButton::click ( ) [slot]

Performs a visual click and emits the associated signals.

Since:
4.6

Definition at line 304 of file pushbutton.cpp.

void Plasma::PushButton::clicked ( ) [signal]

Emitted when the button is pressed then released, completing a click.

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

Definition at line 468 of file pushbutton.cpp.

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

Definition at line 493 of file pushbutton.cpp.

QIcon Plasma::PushButton::icon ( ) const
Returns:
the icon of this button
Since:
4.3
QString Plasma::PushButton::image ( ) const
Returns:
the image path being displayed currently, or an empty string if none.
bool Plasma::PushButton::isCheckable ( ) const
Returns:
true if the button is checkable
See also:
setCheckable
Since:
4.4

Definition at line 294 of file pushbutton.cpp.

bool Plasma::PushButton::isChecked ( ) const
Returns:
true if the button is checked; requires setIsCheckable(true) to be called
Since:
4.3

Definition at line 309 of file pushbutton.cpp.

bool Plasma::PushButton::isDown ( ) const
Returns:
true if the button is pressed down
Since:
4.4

Definition at line 314 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 347 of file pushbutton.cpp.

void Plasma::PushButton::pressed ( ) [signal]

Emitted when the button is pressed down; usually the clicked() signal will suffice, however.

Since:
4.4
void Plasma::PushButton::released ( ) [signal]

Emitted when the button is released; usually the clicked() signal will suffice, however.

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

Definition at line 324 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 264 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 289 of file pushbutton.cpp.

void Plasma::PushButton::setChecked ( bool  checked) [slot]

Sets whether or not this button is checked.

Implies setIsCheckable(true).

Since:
4.3

Definition at line 299 of file pushbutton.cpp.

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

sets the icon for this push button

  • icon the icon to use
Since:
4.3

Definition at line 279 of file pushbutton.cpp.

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

sets the icon for this push button using a KIcon

  • icon the icon to use
Since:
4.4

Definition at line 274 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 214 of file pushbutton.cpp.

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

Sets the path to an svg image to display and the id of the used svg element, if necessary.

  • path the path to the image; if a relative path, then a themed image will be loaded.
  • elementid the id of a svg element.
Since:
4.4

Definition at line 242 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 253 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 203 of file pushbutton.cpp.

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

Definition at line 513 of file pushbutton.cpp.

QString Plasma::PushButton::styleSheet ( )
Returns:
the stylesheet currently used with this widget
QString Plasma::PushButton::text ( ) const
Returns:
the display text
void Plasma::PushButton::toggled ( bool  ) [signal]

Emitted when the button changes state from up to down.


Property Documentation

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

Definition at line 50 of file pushbutton.h.

bool Plasma::PushButton::checkable [read, write]

Definition at line 52 of file pushbutton.h.

bool Plasma::PushButton::checked [read, write]

Definition at line 53 of file pushbutton.h.

bool Plasma::PushButton::down [read]

Definition at line 54 of file pushbutton.h.

QIcon Plasma::PushButton::icon [read, write]

Definition at line 51 of file pushbutton.h.

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

Definition at line 47 of file pushbutton.h.

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

Definition at line 49 of file pushbutton.h.

QGraphicsWidget Plasma::PushButton::parentWidget [read]

Definition at line 45 of file pushbutton.h.

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

Definition at line 48 of file pushbutton.h.

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

Definition at line 46 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
  • 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.3
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