Plasma
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 #ifndef PLASMA_LABEL_H
00021 #define PLASMA_LABEL_H
00022
00023 #include <QtGui/QGraphicsProxyWidget>
00024
00025 #include <plasma/plasma_export.h>
00026 #include <plasma/dataengine.h>
00027
00028 class QLabel;
00029
00030 namespace Plasma
00031 {
00032
00033 class LabelPrivate;
00034
00040 class PLASMA_EXPORT Label : public QGraphicsProxyWidget
00041 {
00042 Q_OBJECT
00043
00044 Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
00045 Q_PROPERTY(QString text READ text WRITE setText)
00046 Q_PROPERTY(QString image READ image WRITE setImage)
00047 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
00048 Q_PROPERTY(bool hasScaledContents READ hasScaledContents WRITE setScaledContents)
00049 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00050 Q_PROPERTY(QLabel *nativeWidget READ nativeWidget)
00051
00052 public:
00053 explicit Label(QGraphicsWidget *parent = 0);
00054 ~Label();
00055
00061 void setText(const QString &text);
00062
00066 QString text() const;
00067
00073 void setImage(const QString &path);
00074
00078 QString image() const;
00079
00085 void setAlignment(Qt::Alignment alignment);
00086
00090 Qt::Alignment alignment() const;
00091
00097 void setScaledContents(bool scaled);
00098
00102 bool hasScaledContents() const;
00103
00109 void setStyleSheet(const QString &stylesheet);
00110
00114 QString styleSheet();
00115
00119 QLabel *nativeWidget() const;
00120
00121 Q_SIGNALS:
00122 void linkActivated(const QString &link);
00123
00124 public Q_SLOTS:
00125 void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
00126
00127 protected:
00128 void resizeEvent(QGraphicsSceneResizeEvent *event);
00129
00130 private:
00131 Q_PRIVATE_SLOT(d, void setPalette())
00132
00133 LabelPrivate * const d;
00134 };
00135
00136 }
00137
00138 #endif // multiple inclusion guard