# class KThemeStyle | KDE themed styles. More...
Definition | `#include <kthemestyle.h>`
Inherits | KThemeBase [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KThemeStyle (const QString &configFile = QString::null)
- ~KThemeStyle ()
- virtual void polish (QWidget* )
- virtual void unPolish (QWidget* )
- virtual void polish (QApplication *app)
- virtual void unPolish (QApplication*)
- virtual void polish (QPalette& pal)
- virtual void drawBaseButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, bool rounded = FALSE, WidgetType type=Bevel, const QBrush *fill = 0)
- virtual void drawBaseMask (QPainter *p, int x, int y, int w, int h, bool rounded)
- virtual void drawButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0)
- virtual void drawBevelButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0)
- virtual void drawKToolBarButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken=false, bool raised = true, bool enabled = true, bool popup = false, KToolButtonType type = Icon, const QString &btext=QString::null, const QPixmap *icon=NULL, QFont *font=NULL, QWidget *btn=NULL)
- void drawKBarHandle (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, KToolBarPos type, QBrush *fill=NULL)
- void drawKToolBar (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, KToolBarPos type, QBrush *fill=NULL)
- virtual QRect buttonRect (int x, int y, int w, int h)
- virtual void drawArrow (QPainter *p, Qt::ArrowType type, bool down, int x, int y, int w, int h, const QColorGroup &g, bool enabled=true, const QBrush *fill = 0)
- virtual QSize exclusiveIndicatorSize () const
- virtual void drawExclusiveIndicator (QPainter* p, int x, int y, int w, int h, const QColorGroup &g, bool on, bool down = FALSE, bool enabled = TRUE)
- virtual void drawExclusiveIndicatorMask (QPainter *p, int x, int y, int w, int h, bool on)
- virtual void drawIndicatorMask (QPainter *p, int x, int y, int w, int h, int state)
- virtual void drawButtonMask (QPainter *p, int x, int y, int w, int h)
- virtual void drawComboButtonMask (QPainter *p, int x, int y, int w, int h)
- virtual QSize indicatorSize () const
- virtual void drawIndicator (QPainter* p, int x, int y, int w, int h, const QColorGroup &g, int state, bool down = FALSE, bool enabled = TRUE)
- virtual void drawComboButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, bool editable = FALSE, bool enabled = TRUE, const QBrush *fill = 0)
- virtual void drawPushButton (QPushButton* btn, QPainter *p)
- virtual void getButtonShift (int &x, int &y)
- virtual int defaultFrameWidth () const
- virtual void scrollBarMetrics (const QScrollBar*, int&, int&, int&, int&)
- virtual void drawScrollBarControls (QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl)
- virtual ScrollControl scrollBarPointOver (const QScrollBar*, int sliderStart, const QPoint& )
- virtual int sliderLength () const
- virtual void drawSlider (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow)
- void drawSliderGroove (QPainter *p, int x, int y, int w, int h, const QColorGroup& g, QCOORD c, Orientation )
- virtual void drawSliderMask (QPainter *p, int x, int y, int w, int h, Orientation, bool tickAbove, bool tickBelow)
- virtual void drawScrollBarGroove (QPainter *p, const QScrollBar *sb, bool horizontal, QRect r, QColorGroup g)
- virtual void drawShade (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken, bool rounded, int hWidth, int bWidth, ShadeStyle style)
- virtual void drawPushButtonLabel (QPushButton *btn, QPainter *p)
- void drawKMenuBar (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool macMode, QBrush *fill=NULL)
- virtual void drawKMenuItem (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool active, QMenuItem *item, QBrush *fill=NULL)
- virtual int splitterWidth () const
- virtual void drawSplitter (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, Orientation)
- virtual void drawCheckMark (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool act, bool dis)
- virtual void drawPopupMenuItem (QPainter *p, bool checkable, int maxpmw, int tab, QMenuItem *mi, const QPalette &pal, bool act, bool enabled, int x, int y, int w, int h)
- int popupMenuItemHeight (bool checkable, QMenuItem *mi, const QFontMetrics &fm)
- void drawFocusRect (QPainter *p, const QRect &r, const QColorGroup &g, const QColor *c=0, bool atBorder=false)
- virtual void drawKProgressBlock (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, QBrush *fill)
- virtual void getKProgressBackground (const QColorGroup &g, QBrush &bg)
- virtual void tabbarMetrics (const QTabBar*, int&, int&, int&)
- virtual void drawTab (QPainter*, const QTabBar*, QTab*, bool selected)
- virtual void drawTabMask (QPainter*, const QTabBar*, QTab*, bool selected)

#### Protected Members

- QPalette oldPalette
- QPalette popupPalette
- QPalette indiPalette
- QPalette exIndiPalette
- Forward KThemeStylePrivate
- KThemeStylePrivate *d

## Detailed Description

KDE themed styles.

It provides methods for drawing most widgets with user-specified borders, highlights, pixmaps, etc. It also handles various other settings such as scrollbar types, rounded buttons, and shading types. For a full list of parameters this class handles refer to the KDE theme configuration documentation.

KThemeStyle (const QString &configFile = QString::null) | ### KThemeStyle

Construct a new KThemeStyle object.

Parameters:

configFile | A KConfig file to use as the theme configuration. Defaults to ~/.kderc.

~KThemeStyle () | ### ~KThemeStyle

void polish (QWidget* ) | ### polish

[virtual]

void unPolish (QWidget* ) | ### unPolish

[virtual]

void polish (QApplication *app) | ### polish

[virtual]

By default this just sets the background brushes to the pixmapped background.

void unPolish (QApplication*) | ### unPolish

[virtual]

void polish (QPalette& pal) | ### polish

[virtual]

void drawBaseButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, bool rounded = FALSE, WidgetType type=Bevel, const QBrush *fill = 0) | ### drawBaseButton

[virtual]

This is a convenience method for drawing widgets with borders, highlights, pixmaps, colors, etc... You specify the widget type and it will draw it according to the config file settings.

Parameters:

p | The QPainter to draw on.
g | The color group to use.
rounded | `true` if the widget is rounded, `false` if rectangular.
type | The widget type to paint.
fill | An optional fill brush. Currently ignored (the config file is used instead).

void drawBaseMask (QPainter *p, int x, int y, int w, int h, bool rounded) | ### drawBaseMask

[virtual]

Draw a mask with for widgets that may be rounded.

Currently used by pushbuttons and comboboxes.

Parameters:

p | The QPainter to draw on.
rounded | `true` if the widget is rounded, `false` if rectangular.

void drawButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0) | ### drawButton

[virtual]

Draw a pushbutton.

This calls drawBaseButton() with `PushButton` as the widget type.

void drawBevelButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, const QBrush *fill = 0) | ### drawBevelButton

[virtual]

Draw a bevel button.

This calls drawBaseButton() with Bevel as the widget type.

void drawKToolBarButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken=false, bool raised = true, bool enabled = true, bool popup = false, KToolButtonType type = Icon, const QString &btext=QString::null, const QPixmap *icon=NULL, QFont *font=NULL, QWidget *btn=NULL) | ### drawKToolBarButton

[virtual]

Draw a toolbar button.

Reimplemented from KStyle.

void drawKBarHandle (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, KToolBarPos type, QBrush *fill=NULL) | ### drawKBarHandle

Draw the handle used in toolbars.

Reimplemented from KStyle.

void drawKToolBar (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, KToolBarPos type, QBrush *fill=NULL) | ### drawKToolBar

Draw a toolbar.

Reimplemented from KStyle.

QRect buttonRect (int x, int y, int w, int h) | ### buttonRect

[virtual]

Return the space available in a pushbutton, taking configurable borders and highlights into account.

void drawArrow (QPainter *p, Qt::ArrowType type, bool down, int x, int y, int w, int h, const QColorGroup &g, bool enabled=true, const QBrush *fill = 0) | ### drawArrow

[virtual]

Draw an arrow in the style specified by the config file.

QSize exclusiveIndicatorSize () | ### exclusiveIndicatorSize

[const virtual]

Return the size of the exclusive indicator pixmap if one is specified in the config file, otherwise it uses the base style's size.

void drawExclusiveIndicator (QPainter* p, int x, int y, int w, int h, const QColorGroup &g, bool on, bool down = FALSE, bool enabled = TRUE) | ### drawExclusiveIndicator

[virtual]

Draw an exclusive indicator widget.

If a pixmap is specified in the config file that is used, otherwise the base style's widget is drawn.

void drawExclusiveIndicatorMask (QPainter *p, int x, int y, int w, int h, bool on) | ### drawExclusiveIndicatorMask

[virtual]

Set the mask of an exclusive indicator widget.

If a pixmap is specified it is masked according to it's transparent pixels, otherwise the base style's mask is used.

void drawIndicatorMask (QPainter *p, int x, int y, int w, int h, int state) | ### drawIndicatorMask

[virtual]

Set the mask of an indicator widget.

If a pixmap is specified it is masked according to it's transparent pixels, otherwise the base style's mask is used.

void drawButtonMask (QPainter *p, int x, int y, int w, int h) | ### drawButtonMask

[virtual]

Set the mask for pushbuttons.

void drawComboButtonMask (QPainter *p, int x, int y, int w, int h) | ### drawComboButtonMask

[virtual]

Set the mask for combo boxes.

QSize indicatorSize () | ### indicatorSize

[const virtual]

Return the size of the indicator pixmap if one is specified in the config file, otherwise it uses the base style's size.

void drawIndicator (QPainter* p, int x, int y, int w, int h, const QColorGroup &g, int state, bool down = FALSE, bool enabled = TRUE) | ### drawIndicator

[virtual]

Draw an indicator widget.

If a pixmap is specified in the config file that is used, otherwise the base style's widget is drawn.

void drawComboButton (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken = FALSE, bool editable = FALSE, bool enabled = TRUE, const QBrush *fill = 0) | ### drawComboButton

[virtual]

Draw a combobox.

void drawPushButton (QPushButton* btn, QPainter *p) | ### drawPushButton

[virtual]

Draw a pushbutton.

void getButtonShift (int &x, int &y) | ### getButtonShift

[virtual]

Return the amount of button content displacement specified by the config file.

int defaultFrameWidth () | ### defaultFrameWidth

[const virtual]

Return the frame width.

void scrollBarMetrics (const QScrollBar*, int&, int&, int&, int&) | ### scrollBarMetrics

[virtual]

Calculate the metrics of the scrollbar controls according to the layout specified by the config file.

void drawScrollBarControls (QPainter*, const QScrollBar*, int sliderStart, uint controls, uint activeControl) | ### drawScrollBarControls

[virtual]

Draw a themed scrollbar.

ScrollControl scrollBarPointOver (const QScrollBar*, int sliderStart, const QPoint& ) | ### scrollBarPointOver

[virtual]

Return the control that the given point is over according to the layout in the config file.

int sliderLength () | ### sliderLength

[const virtual]

Return the configurable default slider length.

void drawSlider (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, Orientation, bool tickAbove, bool tickBelow) | ### drawSlider

[virtual]

Draw a slider control.

void drawSliderGroove (QPainter *p, int x, int y, int w, int h, const QColorGroup& g, QCOORD c, Orientation ) | ### drawSliderGroove

Draw a slider groove.

void drawSliderMask (QPainter *p, int x, int y, int w, int h, Orientation, bool tickAbove, bool tickBelow) | ### drawSliderMask

[virtual]

Draw the mask for a slider (both the control and groove.

void drawScrollBarGroove (QPainter *p, const QScrollBar *sb, bool horizontal, QRect r, QColorGroup g) | ### drawScrollBarGroove

[virtual]

Convience method for drawing themed scrollbar grooves.

Since the grooves may be a scaled pixmap you cannot just bitblt the pixmap at any offset. This generates a cached pixmap at full size if needed and then copies the requested area.

Parameters:

p | The painter to draw on.
sb | The scrollbar (usually given by drawScrollBarControls).
horizontal | Is the scrollBar horizontal?
r | The rectangle to fill.
g | The color group to use.

void drawShade (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool sunken, bool rounded, int hWidth, int bWidth, ShadeStyle style) | ### drawShade

[virtual]

Draw a shaded rectangle using the given style.

Parameters:

p | The painter to draw on.
g | The color group to use.
rounded | Draws a rounded shape if true. Requires bWidth to be at least 1.
hWidth | The highlight width.
bWidth | The border width.
style | The shading style to use.

void drawPushButtonLabel (QPushButton *btn, QPainter *p) | ### drawPushButtonLabel

[virtual]

Draw the text for a pushbutton.

void drawKMenuBar (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool macMode, QBrush *fill=NULL) | ### drawKMenuBar

Draw a menubar.

Reimplemented from KStyle.

void drawKMenuItem (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool active, QMenuItem *item, QBrush *fill=NULL) | ### drawKMenuItem

[virtual]

Draw a menubar item.

Reimplemented from KStyle.

int splitterWidth () | ### splitterWidth

[const virtual]

Return the width of the splitter as specified in the config file.

void drawSplitter (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, Orientation) | ### drawSplitter

[virtual]

Draw a splitter widget.

void drawCheckMark (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, bool act, bool dis) | ### drawCheckMark

[virtual]

Draw a checkmark.

void drawPopupMenuItem (QPainter *p, bool checkable, int maxpmw, int tab, QMenuItem *mi, const QPalette &pal, bool act, bool enabled, int x, int y, int w, int h) | ### drawPopupMenuItem

[virtual]

Draw a menu item.

Note: This method manually handles applying inactive menu backgrounds to the entire widget.

int popupMenuItemHeight (bool checkable, QMenuItem *mi, const QFontMetrics &fm) | ### popupMenuItemHeight

void drawFocusRect (QPainter *p, const QRect &r, const QColorGroup &g, const QColor *c=0, bool atBorder=false) | ### drawFocusRect

Draw the focus rectangle.

void drawKProgressBlock (QPainter *p, int x, int y, int w, int h, const QColorGroup &g, QBrush *fill) | ### drawKProgressBlock

[virtual]

Draw a KProgess bar.

Reimplemented from KStyle.

void getKProgressBackground (const QColorGroup &g, QBrush &bg) | ### getKProgressBackground

[virtual]

Return the background for KProgress.

Reimplemented from KStyle.

void tabbarMetrics (const QTabBar*, int&, int&, int&) | ### tabbarMetrics

[virtual]

void drawTab (QPainter*, const QTabBar*, QTab*, bool selected) | ### drawTab

[virtual]

void drawTabMask (QPainter*, const QTabBar*, QTab*, bool selected) | ### drawTabMask

[virtual]

QPalette oldPalette | ### oldPalette

[protected]

QPalette popupPalette | ### popupPalette

[protected]

QPalette indiPalette | ### indiPalette

[protected]

QPalette exIndiPalette | ### exIndiPalette

[protected]

KThemeStylePrivate * d | ### d

[protected]

Generated by: root@sparc.ports.openbsd.org on Wed May 2 09:37:45 2001, using kdoc 2.0a53.