Qt 4.8
qgtkstyle.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QGTKSTYLE_H
43 #define QGTKSTYLE_H
44 
45 #include <QtGui/QCleanlooksStyle>
46 #include <QtGui/QPalette>
47 #include <QtGui/QFont>
48 #include <QtGui/QFileDialog>
49 
51 
53 
54 QT_MODULE(Gui)
55 
56 #if !defined(QT_NO_STYLE_GTK)
57 
58 class QPainterPath;
59 class QGtkStylePrivate;
60 
62 {
63  Q_OBJECT
65 
66 public:
67  QGtkStyle();
69 
70  ~QGtkStyle();
71 
72  QPalette standardPalette() const;
73 
74  void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
75  QPainter *painter, const QWidget *widget) const;
76  void drawControl(ControlElement control, const QStyleOption *option,
77  QPainter *painter, const QWidget *widget) const;
78  void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
79  QPainter *painter, const QWidget *widget) const;
80  void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
81  const QPixmap &pixmap) const;
82  void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
83  bool enabled, const QString& text, QPalette::ColorRole textRole) const;
84 
85  int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
86  const QWidget *widget = 0) const;
87  int styleHint(StyleHint hint, const QStyleOption *option,
88  const QWidget *widget, QStyleHintReturn *returnData) const;
89 
91  const QPoint &pt, const QWidget *w) const;
92 
94  SubControl subControl, const QWidget *widget) const;
95  QRect subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const;
96  QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
97 
98 
100  const QSize &size, const QWidget *widget) const;
102  const QWidget *widget) const;
103  QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
104  const QStyleOption *opt) const;
105 
106  void polish(QWidget *widget);
107  void polish(QApplication *app);
108  void polish(QPalette &palette);
109 
110  void unpolish(QWidget *widget);
111  void unpolish(QApplication *app);
112 
113  static bool getGConfBool(const QString &key, bool fallback = 0);
114  static QString getGConfString(const QString &key, const QString &fallback = QString());
115 
116 
117 protected Q_SLOTS:
118  QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option,
119  const QWidget *widget = 0) const;
120 };
121 
122 #endif
123 
125 
127 
128 #endif //QGTKSTYLE_H
void polish(QWidget *widget)
Reimplemented Function
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
Reimplemented Function
int type
Definition: qmetatype.cpp:239
SubControl
This enum describes the available sub controls.
Definition: qstyle.h:402
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
StyleHint
This enum describes the available style hints.
Definition: qstyle.h:640
The QStyleHintReturn class provides style hints that return more than basic data types.
Definition: qstyleoption.h:907
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
Definition: qpalette.h:93
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
ComplexControl
This enum describes the available complex controls.
Definition: qstyle.h:386
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
PixelMetric
This enum describes the various available pixel metrics.
Definition: qstyle.h:474
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
#define Q_SLOTS
Definition: qobjectdefs.h:71
The QString class provides a Unicode character string.
Definition: qstring.h:83
void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
Reimplemented Function
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const
Reimplemented Function
StandardPixmap
This enum describes the available standard pixmaps.
Definition: qstyle.h:755
void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
Reimplemented Function
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
ContentsType
This enum describes the available contents types.
Definition: qstyle.h:602
Mode
This enum type describes the mode for which a pixmap is intended to be used.
Definition: qicon.h:63
#define Q_OBJECT
Definition: qobjectdefs.h:157
The QCleanlooksStyle class provides a widget style similar to the Clearlooks style available in GNOME...
PrimitiveElement
This enum describes the various primitive elements.
Definition: qstyle.h:145
QPalette standardPalette() const
Reimplemented Function
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
ControlElement
This enum represents a control element.
Definition: qstyle.h:217
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
Reimplemented Function
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
Definition: qstyleoption.h:687
void drawPrimitive(PrimitiveElement elem, const QStyleOption *option, QPainter *painter, const QWidget *widget=0) const
Reimplemented Function
#define QT_END_HEADER
Definition: qglobal.h:137
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
Reimplemented Function
#define enabled
void unpolish(QWidget *widget)
Reimplemented Function
#define text
Definition: qobjectdefs.h:80
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const
Reimplemented Function
SubElement
This enum represents a sub-area of a widget.
Definition: qstyle.h:289
static QMenuBar * fallback
Definition: qmenu_mac.mm:1617
The QGtkStyle class provides a widget style rendered by GTK+.
Definition: qgtkstyle.h:61
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const
Draws the given text in the specified rectangle using the provided painter and palette.
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61
The QIcon class provides scalable icons in different modes and states.
Definition: qicon.h:60