Plasma
frame.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_FRAME_H
00021 #define PLASMA_FRAME_H
00022
00023 #include <QtGui/QGraphicsWidget>
00024
00025 #include <plasma/plasma_export.h>
00026
00027 class QFrame;
00028
00029 namespace Plasma
00030 {
00031
00032 class FramePrivate;
00033
00042 class PLASMA_EXPORT Frame : public QGraphicsWidget
00043 {
00044 Q_OBJECT
00045 Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow)
00046 Q_PROPERTY(QString text READ text WRITE setText)
00047 Q_PROPERTY(QString image READ image WRITE setImage)
00048 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00049 Q_ENUMS(Shadow)
00050
00051 public:
00052 enum Shadow {
00053 Plain = 1,
00054 Raised = 2,
00055 Sunken = 3
00056 };
00057
00063 explicit Frame(QGraphicsWidget *parent = 0);
00064 ~Frame();
00065
00071 void setFrameShadow(Shadow shadow);
00072
00076 Shadow frameShadow() const;
00077
00083 void setText(QString text);
00084
00088 QString text() const;
00089
00095 void setImage(const QString &path);
00096
00100 QString image() const;
00101
00107 void setStyleSheet(const QString &stylesheet);
00108
00112 QString styleSheet() const;
00113
00117 QWidget *nativeWidget() const;
00118
00119 protected:
00120 void paint(QPainter *painter,
00121 const QStyleOptionGraphicsItem *option,
00122 QWidget *widget = 0);
00123
00124 void resizeEvent(QGraphicsSceneResizeEvent *event);
00125 QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;
00126
00127 private:
00128 FramePrivate * const d;
00129
00130 Q_PRIVATE_SLOT(d, void syncBorders())
00131 };
00132
00133 }
00134
00135 #endif // multiple inclusion guard