20 #ifndef LANCELOT_BASIC_WIDGET_H
21 #define LANCELOT_BASIC_WIDGET_H
23 #include <QtGui/QGraphicsScene>
24 #include <QtGui/QIcon>
47 Q_PROPERTY ( QIcon icon READ icon WRITE setIcon )
48 Q_PROPERTY ( QSize iconSize READ iconSize WRITE setIconSize )
49 Q_PROPERTY ( QString title READ title WRITE setTitle )
L_EXTRA ( i18n )
50 Q_PROPERTY ( QString description READ description WRITE setDescription )
L_EXTRA ( i18n )
51 Q_PROPERTY ( Qt::Orientation innerOrientation READ innerOrientation WRITE setInnerOrientation )
69 explicit
BasicWidget(QString title, QString description = QString(),
70 QGraphicsItem * parent = 0);
79 explicit
BasicWidget(QIcon icon, QString title = QString(),
80 QString description = QString(), QGraphicsItem * parent = 0);
89 explicit
BasicWidget(const Plasma::Svg & icon, QString title = QString(),
90 QString description = QString(), QGraphicsItem * parent = 0);
106 void setIcon(QIcon icon);
111 Plasma::Svg & iconInSvg() const;
117 void setIconInSvg(const Plasma::Svg & svg);
122 QSize iconSize() const;
128 void setIconSize(QSize size);
133 Qt::Orientation innerOrientation() const;
139 void setInnerOrientation(Qt::Orientation orientation);
144 Qt::Alignment alignment() const;
150 void setAlignment(Qt::Alignment alignment);
155 QString title() const;
161 void setTitle(const QString & title);
166 QString description() const;
172 void setDescription(const QString & description);
177 virtual
void setShortcutKey(const QString & key);
184 void paintForeground(QPainter * painter);
190 void drawText(QPainter * painter, const QRectF & rectangle,
int flags,
191 const QString & text,
bool shortcutEnabled);
194 const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
195 L_Override QSizeF sizeHint(Qt::SizeHint which,
196 const QSizeF & constraint = QSizeF()) const;