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
00025 #ifndef QXTLABEL_H
00026 #define QXTLABEL_H
00027
00028 #include <QFrame>
00029 #include "qxtnamespace.h"
00030 #include "qxtglobal.h"
00031 #include "qxtpimpl.h"
00032
00033 class QxtLabelPrivate;
00034
00035 class QXT_GUI_EXPORT QxtLabel : public QFrame
00036 {
00037 Q_OBJECT
00038 QXT_DECLARE_PRIVATE(QxtLabel);
00039 Q_PROPERTY(QString text READ text WRITE setText)
00040 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
00041 Q_PROPERTY(Qt::TextElideMode elideMode READ elideMode WRITE setElideMode)
00042 Q_PROPERTY(Qxt::Rotation rotation READ rotation WRITE setRotation)
00043
00044 public:
00045 explicit QxtLabel(QWidget* parent = 0, Qt::WindowFlags flags = 0);
00046 explicit QxtLabel(const QString& text, QWidget* parent = 0, Qt::WindowFlags flags = 0);
00047 virtual ~QxtLabel();
00048
00049 QString text() const;
00050
00051 Qt::Alignment alignment() const;
00052 void setAlignment(Qt::Alignment alignment);
00053
00054 Qt::TextElideMode elideMode() const;
00055 void setElideMode(Qt::TextElideMode mode);
00056
00057 Qxt::Rotation rotation() const;
00058 void setRotation(Qxt::Rotation rotation);
00059
00060 virtual QSize sizeHint() const;
00061 virtual QSize minimumSizeHint() const;
00062
00063 public Q_SLOTS:
00064 void setText(const QString& text);
00065
00066 Q_SIGNALS:
00067 void clicked();
00068 void textChanged(const QString& text);
00069
00070 protected:
00071 virtual void changeEvent(QEvent* event);
00072 virtual void mousePressEvent(QMouseEvent* event);
00073 virtual void mouseReleaseEvent(QMouseEvent* event);
00074 virtual void paintEvent(QPaintEvent* event);
00075 };
00076
00077 #endif // QXTLABEL_H