• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeplasma-addons API Reference
  • KDE Home
  • Contact Us
 

liblancelot

  • Lancelot
  • BasicWidget
Public Member Functions | Protected Member Functions | Properties | List of all members
Lancelot::BasicWidget Class Reference

#include <BasicWidget.h>

Inheritance diagram for Lancelot::BasicWidget:
Inheritance graph
[legend]

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.

Author
Ivan Cukic

The icon can be a QIcon or contained in a Plasma::Svg

Definition at line 44 of file BasicWidget.h.

Constructor & Destructor Documentation

Lancelot::BasicWidget::BasicWidget ( QIcon  icon,
QString  title = QString(),
QString  description = QString(),
QGraphicsItem *  parent = 0 
)
explicit

Creates a new Lancelot::BasicWidget.

Parameters
iconthe icon for the widget
titlethe title of the widget
descriptionthe description of the widget
parentparent item

Definition at line 132 of file BasicWidget.cpp.

Lancelot::BasicWidget::BasicWidget ( const Plasma::Svg &  icon,
QString  title = QString(),
QString  description = QString(),
QGraphicsItem *  parent = 0 
)
explicit

Creates a new Lancelot::BasicWidget.

Parameters
iconSvg with active, inactive and disabled states
titlethe title of the widget
descriptionthe description of the widget
parentparent item

Definition at line 140 of file BasicWidget.cpp.

Lancelot::BasicWidget::~BasicWidget ( )
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.

void Lancelot::BasicWidget::drawText ( QPainter *  painter,
const QRectF &  rectangle,
int  flags,
const QString &  text,
bool  shortcutEnabled 
)
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.

void Lancelot::BasicWidget::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
protected

Definition at line 153 of file BasicWidget.cpp.

void Lancelot::BasicWidget::paintForeground ( QPainter *  painter)
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
alignmentnew 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
iconnew icon

Definition at line 425 of file BasicWidget.cpp.

void Lancelot::BasicWidget::setIconInSvg ( const Plasma::Svg &  svg)

Sets icon of this Lancelot::BasicWidget.

Parameters
svgnew icon

Definition at line 437 of file BasicWidget.cpp.

void Lancelot::BasicWidget::setIconSize ( QSize  size)

Sets icon size of this Lancelot::BasicWidget.

Parameters
sizenew 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
orientationnew inner orientation

Definition at line 485 of file BasicWidget.cpp.

void Lancelot::BasicWidget::setShortcutKey ( const QString &  key)
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
titlenew title

Definition at line 449 of file BasicWidget.cpp.

QSizeF Lancelot::BasicWidget::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint = QSizeF() 
) const
protected

Definition at line 507 of file BasicWidget.cpp.

QString Lancelot::BasicWidget::title ( ) const
Returns
title of this Lancelot::BasicWidget

Property Documentation

QIcon Lancelot::BasicWidget::icon
readwrite

Definition at line 47 of file BasicWidget.h.

QSize Lancelot::BasicWidget::iconSize
readwrite

Definition at line 48 of file BasicWidget.h.

QString Lancelot::BasicWidget::title
readwrite

Definition at line 49 of file BasicWidget.h.


The documentation for this class was generated from the following files:
  • BasicWidget.h
  • BasicWidget.cpp
This file is part of the KDE documentation.
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.

liblancelot

Skip menu "liblancelot"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeplasma-addons API Reference

Skip menu "kdeplasma-addons API Reference"
  •     GroupingDesktop
  •   liblancelot

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