1 | /****************************************************************************
|
---|
2 | ** $Id: metal.h 2 2005-11-16 15:49:26Z dmik $
|
---|
3 | **
|
---|
4 | ** Definition of the Metal Style for the themes example
|
---|
5 | **
|
---|
6 | ** Created : 979899
|
---|
7 | **
|
---|
8 | ** Copyright (C) 1997 by Trolltech AS. All rights reserved.
|
---|
9 | **
|
---|
10 | ** This file is part of an example program for Qt. This example
|
---|
11 | ** program may be used, distributed and modified without limitation.
|
---|
12 | **
|
---|
13 | *****************************************************************************/
|
---|
14 |
|
---|
15 | #ifndef METAL_H
|
---|
16 | #define METAL_H
|
---|
17 |
|
---|
18 |
|
---|
19 | #include <qpalette.h>
|
---|
20 |
|
---|
21 | #ifndef QT_NO_STYLE_WINDOWS
|
---|
22 |
|
---|
23 | #include <qwindowsstyle.h>
|
---|
24 |
|
---|
25 |
|
---|
26 | class MetalStyle : public QWindowsStyle
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | MetalStyle();
|
---|
30 | void polish( QApplication*);
|
---|
31 | void unPolish( QApplication*);
|
---|
32 | void polish( QWidget* );
|
---|
33 | void unPolish( QWidget* );
|
---|
34 |
|
---|
35 | void drawPrimitive( PrimitiveElement pe,
|
---|
36 | QPainter *p,
|
---|
37 | const QRect &r,
|
---|
38 | const QColorGroup &cg,
|
---|
39 | SFlags flags = Style_Default,
|
---|
40 | const QStyleOption& = QStyleOption::Default) const;
|
---|
41 |
|
---|
42 | void drawControl( ControlElement element,
|
---|
43 | QPainter *p,
|
---|
44 | const QWidget *widget,
|
---|
45 | const QRect &r,
|
---|
46 | const QColorGroup &cg,
|
---|
47 | SFlags how = Style_Default,
|
---|
48 | const QStyleOption& = QStyleOption::Default ) const;
|
---|
49 |
|
---|
50 | void drawComplexControl( ComplexControl cc,
|
---|
51 | QPainter *p,
|
---|
52 | const QWidget *widget,
|
---|
53 | const QRect &r,
|
---|
54 | const QColorGroup &cg,
|
---|
55 | SFlags how = Style_Default,
|
---|
56 | SCFlags sub = SC_All,
|
---|
57 | SCFlags subActive = SC_None,
|
---|
58 | const QStyleOption& = QStyleOption::Default ) const;
|
---|
59 | int pixelMetric( PixelMetric, const QWidget * ) const;
|
---|
60 |
|
---|
61 |
|
---|
62 | private:
|
---|
63 | void drawMetalFrame( QPainter *p, int x, int y, int w, int h ) const;
|
---|
64 | void drawMetalGradient( QPainter *p, int x, int y, int w, int h,
|
---|
65 | bool sunken, bool horz, bool flat=FALSE ) const;
|
---|
66 | void drawMetalButton( QPainter *p, int x, int y, int w, int h,
|
---|
67 | bool sunken, bool horz, bool flat=FALSE ) const;
|
---|
68 | QPalette oldPalette;
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | #endif
|
---|