# class KTitleWidget

###

Module | kdeui
Namespace |
Class | KTitleWidget
Inherits | QWidget

Standard title widget with a white background and round border.

This class provides a widget often used for dialog titles.

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 left aligned pixmap:

    KTitleWidget *titleWidget = new KTitleWidget(this);
    titleWidget->setText(i18n("Title"));
    titleWidget->setPixmap(KIcon("screen").pixmap(22, 22), KTitleWidget.ImageLeft);

Use it with a 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 Author Urs Wolfer \<uwolfer @kde.org\>

### enums

- ImageAlignment { ImageLeft, ImageRight }
- MessageType { PlainMessage, InfoMessage, WarningMessage, ErrorMessage }

enum details

### methods

- KTitleWidget (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Constructs a title widget with the given parent. -

- KTitleWidget (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KTitleWidget |

- KTitleWidget (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- autoHideTimeout ( )

  returns int

  Get the current timeout value in milliseconds Returns timeout value in msecs

- changeEvent (e)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  e | QEvent |

- comment ( )

  returns QString

  Returns the text displayed in the comment below the title, if any

  See also setComment()

- eventFilter (object, event)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  object | QObject |
  event | QEvent |

- pixmap ( )

  returns QPixmap

  Returns the pixmap displayed in the title

  See also setPixmap()

- setAutoHideTimeout (msecs)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  msecs | int |

  Set the autohide timeout of the label Set value to 0 to disable autohide, which is the default.

  msecs - timeout value in milliseconds

- setBuddy (buddy)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  buddy | QWidget |

  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

- setComment (comment, type)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  comment | QString |
  type | KTitleWidget.MessageType | KTitleWidget.PlainMessage

  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 (pixmap, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pixmap | QPixmap |
  alignment | KTitleWidget.ImageAlignment | KTitleWidget.ImageRight

  pixmap - Pixmap displayed in the header. The pixmap is by default right, but

  alignment - can be used to display it also left.

  See also pixmap()

- setPixmap (icon, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  icon | QString |
  alignment | KTitleWidget.ImageAlignment | KTitleWidget.ImageRight

  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.

  See also pixmap()

- setPixmap (icon, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  icon | QIcon |
  alignment | KTitleWidget.ImageAlignment | KTitleWidget.ImageRight

  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 (type, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  type | KTitleWidget.MessageType |
  alignment | KTitleWidget.ImageAlignment | KTitleWidget.ImageRight

  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 (text, alignment)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  alignment | Qt.Alignment | Qt.AlignLeft|Qt.AlignVCenter

  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.

  See also text()

- setText (text, type)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  type | KTitleWidget.MessageType |

  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

  See also MessageType

  See also text()

- setWidget (widget)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  widget | QWidget |

  widget - Widget displayed on the title widget.

- showEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QShowEvent |

- text ( )

  returns QString

  Returns the text displayed in the title

  See also setText()

### enums - detail

- ImageAlignment { ImageLeft, ImageRight }

  Possible title pixmap alignments.

- ImageLeft: Display the pixmap left
- ImageRight: Display the pixmap right (default)

| ImageLeft | - | - |
| ImageRight | - | - |

- MessageType { PlainMessage, InfoMessage, WarningMessage, ErrorMessage }

  Comment message types

  | PlainMessage | - | - |
  | InfoMessage | - | - |
  | WarningMessage | - | - |
  | ErrorMessage | - | - |