#include <atitlewidget.h>
Classes | |
class | Private |
Public Types | |
enum | ImageAlignment { ImageLeft, ImageRight } |
enum | MessageType { PlainMessage, InfoMessage, WarningMessage, ErrorMessage } |
Public Slots | |
void | setText (const QString &text, Qt::Alignment alignment=Qt::AlignLeft|Qt::AlignVCenter) |
void | setText (const QString &text, MessageType type) |
void | setComment (const QString &comment, MessageType type=PlainMessage) |
void | setPixmap (const QPixmap &pixmap, ImageAlignment alignment=ImageRight) |
void | setPixmap (const QString &icon, ImageAlignment alignment=ImageRight) |
void | setPixmap (const QIcon &icon, ImageAlignment alignment=ImageRight) |
void | setPixmap (MessageType type, ImageAlignment alignment=ImageRight) |
Public Member Functions | |
ATitleWidget (QWidget *parent=0) | |
virtual | ~ATitleWidget () |
void | setWidget (QWidget *widget) |
QString | text () const |
QString | comment () const |
const QPixmap * | pixmap () const |
void | setBuddy (QWidget *buddy) |
int | autoHideTimeout () const |
Protected Member Functions | |
void | changeEvent (QEvent *e) |
Properties | |
QString | text |
QString | comment |
QPixmap | pixmap |
This class provides a widget often used for dialog titles.
ATitleWidget with title and icon
A title text with a left aligned pixmap:
ATitleWidget *titleWidget = new ATitleWidget(this); titleWidget->setText(tr("Title")); titleWidget->setPixmap(KIcon("screen").pixmap(22, 22), ATitleWidget::ImageLeft);
Use it with an own widget:
ATitleWidget *checkboxTitleWidget = new ATitleWidget(this); QWidget *checkBoxTitleMainWidget = new QWidget(this); QVBoxLayout *titleLayout = new QVBoxLayout(checkBoxTitleMainWidget); titleLayout->setMargin(6); QCheckBox *checkBox = new QCheckBox("Text Checkbox", checkBoxTitleMainWidget); titleLayout->addWidget(checkBox); checkboxTitleWidget->setWidget(checkBoxTitleMainWidget);
Definition at line 41 of file atitlewidget.h.
Possible title pixmap alignments.
Definition at line 56 of file atitlewidget.h.
Comment message types
PlainMessage | Normal comment |
InfoMessage | Information the user should be alerted to |
WarningMessage | A warning the user should be alerted to |
ErrorMessage | An error message |
Definition at line 65 of file atitlewidget.h.
ATitleWidget::ATitleWidget | ( | QWidget * | parent = 0 |
) | [explicit] |
Constructs a title widget with the given
parent. |
Definition at line 52 of file atitlewidget.cpp.
ATitleWidget::~ATitleWidget | ( | ) | [virtual] |
Definition at line 90 of file atitlewidget.cpp.
int ATitleWidget::autoHideTimeout | ( | ) | const |
Get the current timeout value in milliseconds
void ATitleWidget::changeEvent | ( | QEvent * | e | ) | [protected] |
Definition at line 120 of file atitlewidget.cpp.
QString ATitleWidget::comment | ( | ) | const |
const QPixmap* ATitleWidget::pixmap | ( | ) | const |
void ATitleWidget::setBuddy | ( | QWidget * | buddy | ) |
Sets this label's buddy to buddy. When the user presses the shortcut key indicated by the label in this title widget, the keyboard focus is transferred to the label's buddy widget.
buddy | the widget to activate when the shortcut key is activated |
Definition at line 115 of file atitlewidget.cpp.
void ATitleWidget::setComment | ( | const QString & | comment, | |
MessageType | type = PlainMessage | |||
) | [slot] |
comment | Text displayed beneath the main title as a comment. It can either be plain text or rich text. | |
type | The sort of message it is. |
Definition at line 150 of file atitlewidget.cpp.
void ATitleWidget::setPixmap | ( | MessageType | type, | |
ImageAlignment | alignment = ImageRight | |||
) | [slot] |
pixmap | the icon to display in the header. The pixmap is by default right, but | |
alignment | can be used to display it also left. |
Definition at line 217 of file atitlewidget.cpp.
void ATitleWidget::setPixmap | ( | const QIcon & | icon, | |
ImageAlignment | alignment = ImageRight | |||
) | [slot] |
pixmap | the icon to display in the header. The pixmap is by default right, but | |
alignment | can be used to display it also left. |
Definition at line 212 of file atitlewidget.cpp.
void ATitleWidget::setPixmap | ( | const QString & | icon, | |
ImageAlignment | alignment = ImageRight | |||
) | [slot] |
icon | name of the icon to display in the header. The pixmap is by default right, but | |
alignment | can be used to display it also left. |
Definition at line 207 of file atitlewidget.cpp.
void ATitleWidget::setPixmap | ( | const QPixmap & | pixmap, | |
ImageAlignment | alignment = ImageRight | |||
) | [slot] |
pixmap | Pixmap displayed in the header. The pixmap is by default right, but | |
alignment | can be used to display it also left. |
Definition at line 177 of file atitlewidget.cpp.
void ATitleWidget::setText | ( | const QString & | text, | |
MessageType | type | |||
) | [slot] |
text | Text displayed on the label. It can either be plain text or rich text. If it is plain text, the text is displayed as a bold title text. | |
type | The sort of message it is; will also set the icon accordingly |
Definition at line 144 of file atitlewidget.cpp.
void ATitleWidget::setText | ( | const QString & | text, | |
Qt::Alignment | alignment = Qt::AlignLeft | Qt::AlignVCenter | |||
) | [slot] |
text | Text displayed on the label. It can either be plain text or rich text. If it is plain text, the text is displayed as a bold title text. | |
alignment | Alignment of the text. Default is left and vertical centered. |
Definition at line 130 of file atitlewidget.cpp.
void ATitleWidget::setWidget | ( | QWidget * | widget | ) |
widget | Widget displayed on the title widget. |
Definition at line 95 of file atitlewidget.cpp.
QString ATitleWidget::text | ( | ) | const |
QString ATitleWidget::comment [read, write] |
Definition at line 46 of file atitlewidget.h.
const QPixmap * ATitleWidget::pixmap [read, write] |
Definition at line 47 of file atitlewidget.h.
QString ATitleWidget::text [read, write] |
Definition at line 45 of file atitlewidget.h.