KPopupTitle class Reference (kdeui Library)

| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KPopupTitle Class Reference

Title widget for use in KPopupMenu. KPopupMenu title widget. More...

`#include <kpopupmenu.h>`

Inheritance diagram for KPopupTitle:

[legend]
Collaboration diagram for KPopupTitle:

[legend]
List of all members.

## Public Slots
void | setText (const QString &text)
| Since: 3.1
void | setIcon (const QPixmap &pix)
| Since: 3.1
## Public Member Functions
| KPopupTitle (QWidget *parent=0, const char *name=0)
| Constructs a title widget with the user specified gradient, pixmap, and colors.
| KPopupTitle (KPixmapEffect::GradientType gradient, const QColor &color, const QColor &textColor, QWidget *parent=0, const char *name=0)
| Constructs a title widget with the specified gradient and colors.
| KPopupTitle (const KPixmap &background, const QColor &color, const QColor &textColor, QWidget *parent=0, const char *name=0)
| Constructs a title widget with the specified pixmap and colors.
void | setTitle (const QString &text, const QPixmap *icon=NULL)
| Sets the title string and optional icon for the title widget.
QString | title () const
| Returns the current title.
QPixmap | icon () const
| Returns the current icon.
QSize | sizeHint () const
## Protected Member Functions
void | paintEvent (QPaintEvent *ev)
virtual void | virtual_hook (int id, void *data)
## Protected Attributes
KPixmapEffect::GradientType | grType
QString | titleStr
KPixmap | fill
QPixmap | miniicon
QColor | fgColor
QColor | bgColor
QColor | grHigh
QColor | grLow
bool | useGradient

## Detailed Description

Title widget for use in KPopupMenu. KPopupMenu title widget.

You usually don't have to create this manually since KPopupMenu::insertTitle will do it for you, but it is allowed if you wish to customize it's look.

Author:
  Daniel M. Duley <mosfet@kde.org>

Definition at line 37 of file kpopupmenu.h.

## Constructor & Destructor Documentation

KPopupTitle::KPopupTitle | ( | QWidget * | parent = 0,
|  | const char * | name = 0
| ) |

| Constructs a title widget with the user specified gradient, pixmap, and colors. Definition at line 38 of file kpopupmenu.cpp. References QWidget::colorGroup(), KGlobal::config(), QColor::dark(), KGlobal::dirs(), QWidget::fontMetrics(), QString::fromLatin1(), KConfigBase::group(), QWidget::height(), QString::isEmpty(), QPixmap::isNull(), QColor::light(), KPixmap::load(), KStdAccel::name(), KConfigBase::readColorEntry(), KConfigBase::readEntry(), KConfigBase::setGroup(), and QWidget::setMinimumSize().

KPopupTitle::KPopupTitle | ( | KPixmapEffect::GradientType | gradient,
|  | const QColor & | color,
|  | const QColor & | textColor,
|  | QWidget * | parent = 0,
|  | const char * | name = 0
| ) |

| Constructs a title widget with the specified gradient and colors. Definition at line 89 of file kpopupmenu.cpp. References QColor::dark(), QWidget::fontMetrics(), QWidget::height(), QColor::light(), KStdAccel::name(), and QWidget::setMinimumSize().

KPopupTitle::KPopupTitle | ( | const KPixmap & | background,
|  | const QColor & | color,
|  | const QColor & | textColor,
|  | QWidget * | parent = 0,
|  | const char * | name = 0
| ) |

| Constructs a title widget with the specified pixmap and colors. Definition at line 103 of file kpopupmenu.cpp. References QColor::dark(), QWidget::fontMetrics(), QWidget::height(), QPixmap::isNull(), QColor::light(), KStdAccel::name(), and QWidget::setMinimumSize().

## Member Function Documentation

void KPopupTitle::setTitle | ( | const QString & | text,
|  | const QPixmap * | icon = NULL
| ) |

| Sets the title string and optional icon for the title widget. You will want to call this before inserting into a menu. Definition at line 121 of file kpopupmenu.cpp. References QWidget::fontMetrics(), QPixmap::height(), QWidget::height(), QPixmap::resize(), QWidget::setMinimumSize(), and QPixmap::width(). Referenced by KPopupMenu::insertTitle(), and KPopupMenu::setTitle().

QString KPopupTitle::title | ( |  | ) | const`[inline]`

| Returns the current title. Definition at line 68 of file kpopupmenu.h.

QPixmap KPopupTitle::icon | ( |  | ) | const`[inline]`

| Returns the current icon. Reimplemented from QWidget. Definition at line 72 of file kpopupmenu.h.

void KPopupTitle::setText | ( | const QString & | text | ) | `[slot]`

| Since: 3.1 Definition at line 135 of file kpopupmenu.cpp. References QWidget::fontMetrics(), QPixmap::height(), QWidget::height(), QWidget::setMinimumSize(), and QPixmap::width().

void KPopupTitle::setIcon | ( | const QPixmap & | pix | ) | `[slot]`

| Since: 3.1 Reimplemented from QWidget. Definition at line 143 of file kpopupmenu.cpp. References QWidget::fontMetrics(), QPixmap::height(), QWidget::height(), QWidget::setMinimumSize(), and QPixmap::width().

The documentation for this class was generated from the following files:

- kpopupmenu.h
- kpopupmenu.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:03:56 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001