• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
ktitlewidget.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2007-2009 Urs Wolfer <uwolfer @ kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KTITLEWIDGET_H
20#define KTITLEWIDGET_H
21
22#include <kdeui_export.h>
23
24#include <QtGui/QWidget>
25
61class KDEUI_EXPORT KTitleWidget : public QWidget
62{
63 Q_OBJECT
64 Q_ENUMS(ImageAlignment)
65 Q_PROPERTY(QString text READ text WRITE setText)
66 Q_PROPERTY(QString comment READ comment WRITE setComment)
67 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
68 Q_PROPERTY(int autoHideTimeout READ autoHideTimeout WRITE setAutoHideTimeout)
69
70public:
77 enum ImageAlignment {
78 ImageLeft,
79 ImageRight
80 };
81
85 enum MessageType {
86 PlainMessage,
87 InfoMessage,
88 WarningMessage,
89 ErrorMessage
90 };
91
95 explicit KTitleWidget(QWidget *parent = 0);
96
97 virtual ~KTitleWidget();
98
102 void setWidget(QWidget *widget);
103
108 QString text() const;
109
114 QString comment() const;
115
120 const QPixmap *pixmap() const;
121
129 void setBuddy(QWidget *buddy);
130
135 int autoHideTimeout() const;
136
137public Q_SLOTS:
144 void setText(const QString &text, Qt::Alignment alignment = Qt::AlignLeft | Qt::AlignVCenter);
151 void setText(const QString &text, MessageType type);
152
159 void setComment(const QString &comment, MessageType type = PlainMessage);
160
166 void setPixmap(const QPixmap &pixmap, ImageAlignment alignment = ImageRight);
167
173 void setPixmap(const QString &icon, ImageAlignment alignment = ImageRight);
174
180 void setPixmap(const QIcon& icon, ImageAlignment alignment = ImageRight);
181
187 void setPixmap(MessageType type, ImageAlignment alignment = ImageRight);
188
194 void setAutoHideTimeout(int msecs);
195
196protected:
197 void changeEvent(QEvent *e);
198 void showEvent(QShowEvent *event);
199 bool eventFilter(QObject *object, QEvent *event);
200
201private:
202 class Private;
203 Private* const d;
204
205 Q_PRIVATE_SLOT(d, void _k_timeoutFinished())
206 Q_DISABLE_COPY(KTitleWidget)
207};
208
209#endif
KTitleWidget
Standard title widget with a white background and round border.
Definition: ktitlewidget.h:62
KTitleWidget::ImageAlignment
ImageAlignment
Possible title pixmap alignments.
Definition: ktitlewidget.h:77
KTitleWidget::ImageLeft
@ ImageLeft
Display the pixmap on the left.
Definition: ktitlewidget.h:78
KTitleWidget::MessageType
MessageType
Comment message types.
Definition: ktitlewidget.h:85
KTitleWidget::InfoMessage
@ InfoMessage
Information the user should be alerted to.
Definition: ktitlewidget.h:87
KTitleWidget::PlainMessage
@ PlainMessage
Normal comment.
Definition: ktitlewidget.h:86
KTitleWidget::WarningMessage
@ WarningMessage
A warning the user should be alerted to.
Definition: ktitlewidget.h:88
QObject
QWidget
kdeui_export.h
MessageType
MessageType
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal