libplasma
label.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PLASMA_LABEL_H
00022 #define PLASMA_LABEL_H
00023
00024 #include <QtGui/QGraphicsProxyWidget>
00025
00026 #include <plasma/plasma_export.h>
00027 #include <plasma/dataengine.h>
00028
00029 class QLabel;
00030
00031 namespace Plasma
00032 {
00033
00034 class LabelPrivate;
00035
00036 class PLASMA_EXPORT Label : public QGraphicsProxyWidget
00037 {
00038 Q_OBJECT
00039
00040 Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
00041 Q_PROPERTY(QString text READ text WRITE setText)
00042 Q_PROPERTY(QString image READ image WRITE setImage)
00043 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00044 Q_PROPERTY(QLabel* nativeWidget READ nativeWidget)
00045
00046 public:
00047 explicit Label(QGraphicsWidget *parent = 0);
00048 ~Label();
00049
00055 void setText(const QString &text);
00056
00060 QString text() const;
00061
00067 void setImage(const QString &path);
00068
00072 QString image() const;
00073
00079 void setStyleSheet(const QString &stylesheet);
00080
00084 QString styleSheet();
00085
00089 QLabel* nativeWidget() const;
00090
00091 public Q_SLOTS:
00092 void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
00093
00094 protected:
00095 void resizeEvent(QGraphicsSceneResizeEvent *event);
00096
00097 private:
00098 Q_PRIVATE_SLOT(d, void setPalette())
00099
00100 LabelPrivate * const d;
00101 };
00102
00103 }
00104
00105 #endif // multiple inclusion guard