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
00022
00023
00024 #ifndef KLFDISPLAYLABEL_H
00025 #define KLFDISPLAYLABEL_H
00026
00027 #include <QLabel>
00028 #include <QTemporaryFile>
00029
00030 #include <klfdefs.h>
00031
00034 class KLF_EXPORT KLFDisplayLabel : public QLabel
00035 {
00036 Q_OBJECT
00037
00038 Q_PROPERTY(QSize labelFixedSize READ labelFixedSize WRITE setLabelFixedSize) ;
00039 Q_PROPERTY(bool enableToolTipPreview READ enableToolTipPreview WRITE setEnableToolTipPreview) ;
00040
00041 Q_PROPERTY(QString bigPreviewText READ bigPreviewText) ;
00042 Q_PROPERTY(bool glowEffect READ glowEffect WRITE setGlowEffect) ;
00043 Q_PROPERTY(QColor glowEffectColor READ glowEffectColor WRITE setGlowEffectColor) ;
00044 Q_PROPERTY(int glowEffectRadius READ glowEffectRadius WRITE setGlowEffectRadius) ;
00045 public:
00046 KLFDisplayLabel(QWidget *parent);
00047 virtual ~KLFDisplayLabel();
00048
00049 virtual QSize labelFixedSize() const { return pLabelFixedSize; }
00050 virtual bool enableToolTipPreview() const { return pEnableToolTipPreview; }
00051
00052 virtual QString bigPreviewText() const { return _bigPreviewText; }
00053
00054 inline bool glowEffect() const { return pGE; }
00055 inline QColor glowEffectColor() const { return pGEcolor; }
00056 inline int glowEffectRadius() const { return pGEradius; }
00057
00058 signals:
00059 void labelDrag();
00060
00061 public slots:
00062 virtual void setLabelFixedSize(const QSize& size);
00063 virtual void setEnableToolTipPreview(bool enable) { pEnableToolTipPreview = enable; }
00064
00065 virtual void displayClear();
00066 virtual void display(QImage displayimg, QImage tooltipimage, bool labelenabled = true);
00067 virtual void displayError(bool labelenabled = false);
00068
00070 void setGlowEffect(bool on) { pGE = on; }
00072 void setGlowEffectColor(const QColor& color) { pGEcolor = color; }
00074 void setGlowEffectRadius(int r) { pGEradius = r; }
00075
00076 protected:
00077 virtual void mouseMoveEvent(QMouseEvent *e);
00078
00079 private:
00080
00081 QSize pLabelFixedSize;
00082 bool pEnableToolTipPreview;
00083 QTemporaryFile *mToolTipFile;
00084
00085 QPalette pDefaultPalette;
00086 QPalette pErrorPalette;
00087
00088 QString _bigPreviewText;
00089
00090 bool pGE;
00091 QColor pGEcolor;
00092 int pGEradius;
00093
00094 void set_error(bool error_on);
00095 };
00096
00097
00098
00099
00100
00101
00102
00103 #endif