liblancelot
#include <BasicWidget.h>
Public Member Functions | |
BasicWidget (QIcon icon, QString title=QString(), QString description=QString(), QGraphicsItem *parent=0) | |
BasicWidget (const Plasma::Svg &icon, QString title=QString(), QString description=QString(), QGraphicsItem *parent=0) | |
virtual | ~BasicWidget () |
Qt::Alignment | alignment () const |
QString | description () const |
QIcon | icon () const |
Plasma::Svg & | iconInSvg () const |
QSize | iconSize () const |
Qt::Orientation | innerOrientation () const |
void | setAlignment (Qt::Alignment alignment) |
void | setDescription (const QString &description) |
void | setIcon (QIcon icon) |
void | setIconInSvg (const Plasma::Svg &svg) |
void | setIconSize (QSize size) |
void | setInnerOrientation (Qt::Orientation orientation) |
virtual void | setShortcutKey (const QString &key) |
void | setTitle (const QString &title) |
QString | title () const |
Public Member Functions inherited from Lancelot::Widget | |
Widget (QGraphicsItem *parent=0) | |
virtual | ~Widget () |
Group * | group () const |
QString | groupName () const |
bool | isDown () const |
bool | isHovered () const |
virtual void | setGroup (Group *group=NULL) |
virtual void | setGroupByName (const QString &groupName) |
Protected Member Functions | |
void | drawText (QPainter *painter, const QRectF &rectangle, int flags, const QString &text, bool shortcutEnabled) |
L_Override void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
void | paintForeground (QPainter *painter) |
L_Override QSizeF | sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const |
Protected Member Functions inherited from Lancelot::Widget | |
L_Override void | hideEvent (QHideEvent *event) |
L_Override void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
L_Override void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
L_Override void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
L_Override void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
L_Override void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
void | paintBackground (QPainter *painter) |
void | paintBackground (QPainter *painter, const QString &element) |
void | setDown (bool value) |
void | setHovered (bool value) |
void | setPaintBackwardsWhenRTL (bool value) |
L_Override QSizeF | sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const |
Properties | |
QIcon | icon |
QSize | iconSize |
QString | title |
Properties inherited from Lancelot::Widget | |
bool | down |
QString | group |
Additional Inherited Members | |
Signals inherited from Lancelot::Widget | |
void | clicked () |
void | mouseHoverEnter () |
void | mouseHoverLeave () |
void | pressed () |
void | released () |
Detailed Description
Provides a common appearance with an icon, title and a description.
Layout can be vertical or horizontal.
The icon can be a QIcon or contained in a Plasma::Svg
Definition at line 44 of file BasicWidget.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new Lancelot::BasicWidget.
- Parameters
-
icon the icon for the widget title the title of the widget description the description of the widget parent parent item
Definition at line 132 of file BasicWidget.cpp.
|
explicit |
Creates a new Lancelot::BasicWidget.
- Parameters
-
icon Svg with active, inactive and disabled states title the title of the widget description the description of the widget parent parent item
Definition at line 140 of file BasicWidget.cpp.
|
virtual |
Destroys Lancelot::BasicWidget.
Definition at line 148 of file BasicWidget.cpp.
Member Function Documentation
Qt::Alignment Lancelot::BasicWidget::alignment | ( | ) | const |
- Returns
- alignment of this Lancelot::BasicWidget
Definition at line 502 of file BasicWidget.cpp.
QString Lancelot::BasicWidget::description | ( | ) | const |
- Returns
- description of this Lancelot::BasicWidget
Definition at line 480 of file BasicWidget.cpp.
|
protected |
Common implementation of text painting.
- See also
- QPainter::drawText
Definition at line 558 of file BasicWidget.cpp.
QIcon Lancelot::BasicWidget::icon | ( | ) | const |
- Returns
- icon of this Lancelot::BasicWidget
Plasma::Svg & Lancelot::BasicWidget::iconInSvg | ( | ) | const |
- Returns
- icon of this Lancelot::BasicWidget
Definition at line 444 of file BasicWidget.cpp.
QSize Lancelot::BasicWidget::iconSize | ( | ) | const |
- Returns
- icon size of this Lancelot::BasicWidget
Qt::Orientation Lancelot::BasicWidget::innerOrientation | ( | ) | const |
- Returns
- inner orientation of this Lancelot::BasicWidget
Definition at line 491 of file BasicWidget.cpp.
|
protected |
Definition at line 153 of file BasicWidget.cpp.
|
protected |
Common implementation of icon/text/description rendering.
Definition at line 177 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setAlignment | ( | Qt::Alignment | alignment | ) |
Sets alignment of this Lancelot::BasicWidget.
- Parameters
-
alignment new alignment
Definition at line 496 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setDescription | ( | const QString & | description | ) |
Sets description of this Lancelot::BasicWidget.
- Returns
- description new description
Definition at line 473 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setIcon | ( | QIcon | icon | ) |
Sets icon of this Lancelot::BasicWidget.
- Parameters
-
icon new icon
Definition at line 425 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setIconInSvg | ( | const Plasma::Svg & | svg | ) |
Sets icon of this Lancelot::BasicWidget.
- Parameters
-
svg new icon
Definition at line 437 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setIconSize | ( | QSize | size | ) |
Sets icon size of this Lancelot::BasicWidget.
- Parameters
-
size new icon size
Definition at line 413 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setInnerOrientation | ( | Qt::Orientation | orientation | ) |
Sets the inner orientation of this Lancelot::BasicWidget.
- Parameters
-
orientation new inner orientation
Definition at line 485 of file BasicWidget.cpp.
|
virtual |
Sets a shortcut key.
Reimplemented in Lancelot::ExtenderButton.
Definition at line 463 of file BasicWidget.cpp.
void Lancelot::BasicWidget::setTitle | ( | const QString & | title | ) |
Sets title of this Lancelot::BasicWidget.
- Parameters
-
title new title
Definition at line 449 of file BasicWidget.cpp.
|
protected |
Definition at line 507 of file BasicWidget.cpp.
QString Lancelot::BasicWidget::title | ( | ) | const |
- Returns
- title of this Lancelot::BasicWidget
Property Documentation
|
readwrite |
Definition at line 47 of file BasicWidget.h.
|
readwrite |
Definition at line 48 of file BasicWidget.h.
|
readwrite |
Definition at line 49 of file BasicWidget.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon Oct 13 2014 22:55:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.