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

Plasma

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

#include <Plasma/Widgets/ToolButton>

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

Signals

void clicked ()
 
void pressed ()
 
void released ()
 

Public Member Functions

 ToolButton (QGraphicsWidget *parent=0)
 
 ~ToolButton ()
 
QAction * action () const
 
bool autoRaise () const
 
QIcon icon () const
 
QString image () const
 
bool isDown () const
 
QToolButton * nativeWidget () const
 
void setAction (QAction *action)
 
void setAutoRaise (bool raise)
 
void setDown (bool down)
 
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)
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 
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
 
qreal animationUpdate
 
bool autoRaise
 
bool down
 
QString image
 
QToolButton nativeWidget
 
QGraphicsWidget parentWidget
 
QString styleSheet
 
QString text
 

Detailed Description

Provides a plasma-themed QToolButton.

Definition at line 39 of file toolbutton.h.

Constructor & Destructor Documentation

Plasma::ToolButton::ToolButton ( QGraphicsWidget *  parent = 0)
explicit

Definition at line 156 of file toolbutton.cpp.

Plasma::ToolButton::~ToolButton ( )

Definition at line 185 of file toolbutton.cpp.

Member Function Documentation

QAction* Plasma::ToolButton::action ( ) const
Returns
the currently associated action, if any.
Since
4.3
bool Plasma::ToolButton::autoRaise ( ) const
Returns
true if the toolbutton has an autoraise behaviour
void Plasma::ToolButton::changeEvent ( QEvent *  event)
protected

Definition at line 428 of file toolbutton.cpp.

void Plasma::ToolButton::clicked ( )
signal
void Plasma::ToolButton::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protected

Definition at line 385 of file toolbutton.cpp.

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

Definition at line 406 of file toolbutton.cpp.

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

Definition at line 271 of file toolbutton.cpp.

QString Plasma::ToolButton::image ( ) const
Returns
the image path being displayed currently, or an empty string if none.
bool Plasma::ToolButton::isDown ( ) const
Returns
true if the button is pressed down
Since
4.4

Definition at line 286 of file toolbutton.cpp.

QVariant Plasma::ToolButton::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protected

Definition at line 439 of file toolbutton.cpp.

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

Definition at line 329 of file toolbutton.cpp.

void Plasma::ToolButton::pressed ( )
signal
Since
4.4
void Plasma::ToolButton::released ( )
signal
Since
4.4
void Plasma::ToolButton::resizeEvent ( QGraphicsSceneResizeEvent *  event)
protected

Definition at line 306 of file toolbutton.cpp.

void Plasma::ToolButton::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 201 of file toolbutton.cpp.

void Plasma::ToolButton::setAutoRaise ( bool  raise)

Sets if the toolbutton has an autoraise behaviour.

Parameters
raise

Definition at line 211 of file toolbutton.cpp.

void Plasma::ToolButton::setDown ( bool  down)

Sets the status of the button to pressed.

Parameters
down
Since
4.5

Definition at line 281 of file toolbutton.cpp.

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

sets the icon for this toolbutton

Parameters
iconthe icon we want to use
Since
4.3

Definition at line 266 of file toolbutton.cpp.

void Plasma::ToolButton::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 232 of file toolbutton.cpp.

void Plasma::ToolButton::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 260 of file toolbutton.cpp.

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

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

Parameters
stylesheeta CSS string

Definition at line 291 of file toolbutton.cpp.

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

Sets the display text for this ToolButton.

Parameters
textthe text to display; should be translated.

Definition at line 221 of file toolbutton.cpp.

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

Definition at line 450 of file toolbutton.cpp.

QString Plasma::ToolButton::styleSheet ( )
Returns
the stylesheet currently used with this widget
QString Plasma::ToolButton::text ( ) const
Returns
the display text

Property Documentation

QAction * Plasma::ToolButton::action
readwrite

Definition at line 49 of file toolbutton.h.

qreal Plasma::ToolButton::animationUpdate
readwrite

Definition at line 52 of file toolbutton.h.

bool Plasma::ToolButton::autoRaise
readwrite

Definition at line 45 of file toolbutton.h.

bool Plasma::ToolButton::down
readwrite

Definition at line 50 of file toolbutton.h.

QString Plasma::ToolButton::image
readwrite

Definition at line 46 of file toolbutton.h.

QToolButton * Plasma::ToolButton::nativeWidget
read

Definition at line 48 of file toolbutton.h.

QGraphicsWidget Plasma::ToolButton::parentWidget
read

Definition at line 43 of file toolbutton.h.

QString Plasma::ToolButton::styleSheet
readwrite

Definition at line 47 of file toolbutton.h.

QString Plasma::ToolButton::text
readwrite

Definition at line 44 of file toolbutton.h.


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