KDEUI
ktitlewidget.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 #ifndef KTITLEWIDGET_H
00020 #define KTITLEWIDGET_H
00021
00022 #include <kdeui_export.h>
00023
00024 #include <QtGui/QWidget>
00025
00061 class KDEUI_EXPORT KTitleWidget : public QWidget
00062 {
00063 Q_OBJECT
00064 Q_ENUMS(ImageAlignment)
00065 Q_PROPERTY(QString text READ text WRITE setText)
00066 Q_PROPERTY(QString comment READ comment WRITE setComment)
00067 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
00068 Q_PROPERTY(int autoHideTimeout READ autoHideTimeout WRITE setAutoHideTimeout)
00069
00070 public:
00077 enum ImageAlignment {
00078 ImageLeft,
00079 ImageRight
00080 };
00081
00085 enum MessageType {
00086 PlainMessage,
00087 InfoMessage,
00088 WarningMessage,
00089 ErrorMessage
00090 };
00091
00095 explicit KTitleWidget(QWidget *parent = 0);
00096
00097 virtual ~KTitleWidget();
00098
00102 void setWidget(QWidget *widget);
00103
00108 QString text() const;
00109
00114 QString comment() const;
00115
00120 const QPixmap *pixmap() const;
00121
00129 void setBuddy(QWidget *buddy);
00130
00135 int autoHideTimeout() const;
00136
00137 public Q_SLOTS:
00144 void setText(const QString &text, Qt::Alignment alignment = Qt::AlignLeft | Qt::AlignVCenter);
00151 void setText(const QString &text, MessageType type);
00152
00159 void setComment(const QString &comment, MessageType type = PlainMessage);
00160
00166 void setPixmap(const QPixmap &pixmap, ImageAlignment alignment = ImageRight);
00167
00173 void setPixmap(const QString &icon, ImageAlignment alignment = ImageRight);
00174
00180 void setPixmap(const QIcon& icon, ImageAlignment alignment = ImageRight);
00181
00187 void setPixmap(MessageType type, ImageAlignment alignment = ImageRight);
00188
00194 void setAutoHideTimeout(int msecs);
00195
00196 protected:
00197 void changeEvent(QEvent *e);
00198 void showEvent(QShowEvent *event);
00199 bool eventFilter(QObject *object, QEvent *event);
00200
00201 private:
00202 class Private;
00203 Private* const d;
00204
00205 Q_PRIVATE_SLOT(d, void _k_timeoutFinished())
00206 Q_DISABLE_COPY(KTitleWidget)
00207 };
00208
00209 #endif