KTitleWidget Class Reference
from PyKDE5.kwidgetsaddons import *
Inherits: QWidget → QObject
Detailed Description
Standard title widget.
This class provides a widget often used for dialog titles.

"KTitleWidget with title and icon"
KTitleWidget uses the general application font at 1.4 times its size to style the text. This is a visual change from 4.x.
Usage KTitleWidget is very simple to use. You can either use its default text (and pixmap) properties or display your own widgets in the title widget.
A title text with a right-aligned pixmap:
KTitleWidget *titleWidget = new KTitleWidget(this); titleWidget->setText(i18n("Title")); titleWidget->setPixmap(QIcon.fromTheme("screen").pixmap(22, 22));
Use it with an own widget:
KTitleWidget *checkboxTitleWidget = new KTitleWidget(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);
- See also:
- KPageView
Enumerations | |
ImageAlignment | { ImageLeft, ImageRight } |
MessageType | { PlainMessage, InfoMessage, WarningMessage, ErrorMessage } |
Methods | |
__init__ (self, QWidget parent=0) | |
int | autoHideTimeout (self) |
changeEvent (self, QEvent e) | |
QString | comment (self) |
bool | eventFilter (self, QObject object, QEvent event) |
QPixmap | pixmap (self) |
setAutoHideTimeout (self, int msecs) | |
setBuddy (self, QWidget buddy) | |
setComment (self, QString comment, KTitleWidget::MessageType type=KTitleWidget.MessageType.PlainMessage) | |
setPixmap (self, QPixmap pixmap, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight) | |
setPixmap (self, QString icon, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight) | |
setPixmap (self, QIcon icon, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight) | |
setPixmap (self, KTitleWidget::MessageType type, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight) | |
setText (self, QString text, Qt::Alignment alignment=Qt.AlignLeft|Qt.AlignVCenter) | |
setText (self, QString text, KTitleWidget::MessageType type) | |
setWidget (self, QWidget widget) | |
showEvent (self, QShowEvent event) | |
QString | text (self) |
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0 | |||
) |
Constructs a title widget with the given
- Parameters:
-
parent.
int autoHideTimeout | ( | self ) |
Get the current timeout value in milliseconds
- Returns:
- timeout value in msecs
changeEvent | ( | self, | ||
QEvent | e | |||
) |
QString comment | ( | self ) |
- Returns:
- the text displayed in the comment below the title, if any
- See also:
- setComment()
bool eventFilter | ( | self, | ||
QObject | object, | |||
QEvent | event | |||
) |
QPixmap pixmap | ( | self ) |
- Returns:
- the pixmap displayed in the title
- See also:
- setPixmap()
setAutoHideTimeout | ( | self, | ||
int | msecs | |||
) |
Set the autohide timeout of the label Set value to 0 to disable autohide, which is the default.
- Parameters:
-
msecs timeout value in milliseconds
setBuddy | ( | self, | ||
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.
- Parameters:
-
buddy the widget to activate when the shortcut key is activated
setComment | ( | self, | ||
QString | comment, | |||
KTitleWidget::MessageType | type=KTitleWidget.MessageType.PlainMessage | |||
) |
- Parameters:
-
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. - See also:
- MessageType
- See also:
- comment()
setPixmap ( self, QPixmap pixmap, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight ) - Parameters:
-
pixmap the icon to display in the header. The pixmap is by default right, but alignment can be used to display it also left.
- See also:
- pixmap()
setPixmap ( self, QString icon, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight ) - Parameters:
-
pixmap the icon to display in the header. The pixmap is by default right, but alignment can be used to display it also left.
- See also:
- pixmap()
setPixmap ( self, QIcon icon, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight ) - Parameters:
-
pixmap the icon to display in the header. The pixmap is by default right, but alignment can be used to display it also left.
- See also:
- pixmap()
setPixmap ( self, KTitleWidget::MessageType type, KTitleWidget::ImageAlignment alignment=KTitleWidget.ImageAlignment.ImageRight ) - Parameters:
-
pixmap the icon to display in the header. The pixmap is by default right, but alignment can be used to display it also left.
- See also:
- pixmap()
setText ( self, QString text, Qt::Alignment alignment=Qt.AlignLeft|Qt.AlignVCenter ) - Parameters: