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

Plasma

  • Plasma
  • ToolButton
Signals | Public Member Functions | Protected Member Functions | Properties

Plasma::ToolButton Class Reference

Provides a plasma-themed QToolButton. More...

#include <Plasma/Widgets/ToolButton>

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

List of all members.

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, const QString &elementid)
void setImage (const QString &path)
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 157 of file toolbutton.cpp.

Plasma::ToolButton::~ToolButton ( )

Definition at line 186 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 429 of file toolbutton.cpp.

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

Definition at line 386 of file toolbutton.cpp.

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

Definition at line 407 of file toolbutton.cpp.

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

Definition at line 272 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 287 of file toolbutton.cpp.

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

Definition at line 440 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 330 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 307 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 202 of file toolbutton.cpp.

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

Sets if the toolbutton has an autoraise behaviour.

  • raise

Definition at line 212 of file toolbutton.cpp.

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

Sets the status of the button to pressed.

  • down
    Since:
    4.5

Definition at line 282 of file toolbutton.cpp.

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

sets the icon for this toolbutton

  • icon the icon we want to use
Since:
4.3

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

  • 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 261 of file toolbutton.cpp.

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

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

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

  • stylesheet a CSS string

Definition at line 292 of file toolbutton.cpp.

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

Sets the display text for this ToolButton.

  • text the text to display; should be translated.

Definition at line 222 of file toolbutton.cpp.

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

Definition at line 451 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 [read, write]

Definition at line 49 of file toolbutton.h.

qreal Plasma::ToolButton::animationUpdate [read, write]

Definition at line 52 of file toolbutton.h.

bool Plasma::ToolButton::autoRaise [read, write]

Definition at line 45 of file toolbutton.h.

bool Plasma::ToolButton::down [read, write]

Definition at line 50 of file toolbutton.h.

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

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 [read, write]

Definition at line 47 of file toolbutton.h.

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

Definition at line 44 of file toolbutton.h.


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