• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

ktitlewidget.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB. If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
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(QPixmap pixmap READ pixmap WRITE setPixmap)
00067     Q_PROPERTY(int autoHideTimeout READ autoHideTimeout WRITE setAutoHideTimeout)
00068 
00069 public:
00076     enum ImageAlignment {
00077         ImageLeft, 
00078         ImageRight 
00079     };
00080 
00084     enum MessageType {
00085         PlainMessage, 
00086         InfoMessage, 
00087         WarningMessage, 
00088         ErrorMessage 
00089     };
00090 
00094     explicit KTitleWidget(QWidget *parent = 0);
00095 
00096     virtual ~KTitleWidget();
00097 
00101     void setWidget(QWidget *widget);
00102 
00107     QString text() const;
00108 
00113     QString comment() const;
00114 
00119     const QPixmap *pixmap() const;
00120 
00128     void setBuddy(QWidget *buddy);
00129 
00134     int autoHideTimeout() const;
00135 
00136 public Q_SLOTS:
00143     void setText(const QString &text, Qt::Alignment alignment = Qt::AlignLeft | Qt::AlignVCenter);
00150     void setText(const QString &text, MessageType type);
00151 
00158     void setComment(const QString &comment, MessageType type = PlainMessage);
00159 
00165     void setPixmap(const QPixmap &pixmap, ImageAlignment alignment = ImageRight);
00166 
00172     void setPixmap(const QString &icon, ImageAlignment alignment = ImageRight);
00173 
00179     void setPixmap(const QIcon& icon, ImageAlignment alignment = ImageRight);
00180 
00186     void setPixmap(MessageType type, ImageAlignment alignment = ImageRight);
00187 
00193     void setAutoHideTimeout(int msecs);
00194 
00195 protected:
00196     void changeEvent(QEvent *e);
00197     void showEvent(QShowEvent *event);
00198     bool eventFilter(QObject *object, QEvent *event);
00199 
00200 private:
00201     class Private;
00202     Private* const d;
00203 
00204     Q_PRIVATE_SLOT(d, void _k_timeoutFinished())
00205     Q_DISABLE_COPY(KTitleWidget)
00206 };
00207 
00208 #endif

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal