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

Plasma

  • Plasma
  • PushButton
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
Plasma::PushButton Class Reference

#include <Plasma/Widgets/PushButton>

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

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 QIcon &icon)
 
void setIcon (const KIcon &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 182 of file pushbutton.cpp.

Plasma::PushButton::~PushButton ( )

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

void Plasma::PushButton::click ( )
slot

Performs a visual click and emits the associated signals.

Since
4.6

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

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

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

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

Definition at line 334 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 353 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 344 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 284 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 309 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 319 of file pushbutton.cpp.

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

sets the icon for this push button

Parameters
iconthe icon to use
Since
4.3

Definition at line 299 of file pushbutton.cpp.

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

sets the icon for this push button using a KIcon

Parameters
iconthe icon to use
Since
4.4

Definition at line 294 of file pushbutton.cpp.

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

Sets the path to an image to display.

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

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

Parameters
paththe path to the image; if a relative path, then a themed image will be loaded.
elementidthe id of a svg element.
Since
4.4

Definition at line 262 of file pushbutton.cpp.

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

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

Parameters
stylesheeta CSS string

Definition at line 273 of file pushbutton.cpp.

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

Sets the display text for this PushButton.

Parameters
textthe text to display; should be translated.

Definition at line 223 of file pushbutton.cpp.

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

Definition at line 519 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
readwrite

Definition at line 50 of file pushbutton.h.

bool Plasma::PushButton::checkable
readwrite

Definition at line 52 of file pushbutton.h.

bool Plasma::PushButton::checked
readwrite

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
readwrite

Definition at line 51 of file pushbutton.h.

QString Plasma::PushButton::image
readwrite

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
readwrite

Definition at line 48 of file pushbutton.h.

QString Plasma::PushButton::text
readwrite

Definition at line 46 of file pushbutton.h.


The documentation for this class was generated from the following files:
  • pushbutton.h
  • pushbutton.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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 API Reference

Skip menu "kdelibs API Reference"
  • 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal