Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qcleanlooksstyle.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 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 QCLEANLOOKSSTYLE_H
43 #define QCLEANLOOKSSTYLE_H
44 
45 #include <QtWidgets/qproxystyle.h>
46 #include <QtCore/qelapsedtimer.h>
47 
48 QT_BEGIN_HEADER
49 
50 QT_BEGIN_NAMESPACE
51 
52 class QProgressBar;
53 
54 class QCleanlooksStyle : public QProxyStyle
55 {
56  Q_OBJECT
57 
58 public:
61 
62  QPalette standardPalette () const Q_DECL_OVERRIDE;
63  void drawPrimitive(PrimitiveElement elem,
64  const QStyleOption *option,
65  QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
66  void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter,
67  const QWidget *widget) const Q_DECL_OVERRIDE;
68  int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
69  void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
70  QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
71  QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
72  QSize sizeFromContents(ContentsType type, const QStyleOption *option,
73  const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE;
74  SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
75  const QPoint &pt, const QWidget *w = 0) const Q_DECL_OVERRIDE;
76  QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
77  SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE;
78  QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
79  const QStyleOption *opt) const Q_DECL_OVERRIDE;
80  int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
81  QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE;
82  QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
83  QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
84  const QWidget *widget = 0) const Q_DECL_OVERRIDE;
85  QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
86  const QWidget *widget = 0) const Q_DECL_OVERRIDE;
87  void drawItemPixmap(QPainter *painter, const QRect &rect,
88  int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
89  void drawItemText(QPainter *painter, const QRect &rect,
90  int flags, const QPalette &pal, bool enabled,
91  const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
92  void polish(QWidget *widget) Q_DECL_OVERRIDE;
93  void polish(QApplication *app) Q_DECL_OVERRIDE;
94  void polish(QPalette &pal) Q_DECL_OVERRIDE;
95  void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
96  void unpolish(QApplication *app) Q_DECL_OVERRIDE;
97 
98 
99 protected:
100  void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
101  bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
102  void startProgressAnimation(QObject *o, QProgressBar *bar);
103  void stopProgressAnimation(QObject *o, QProgressBar *bar);
104 
105 private:
106  int animateStep;
107  int animateTimer;
108  QElapsedTimer startTime;
109  QList<QProgressBar *> animatedProgressBars;
110 };
111 
112 QT_END_NAMESPACE
113 
114 QT_END_HEADER
115 
116 #endif // QCLEANLOOKSSTYLE_H
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const Q_DECL_OVERRIDE
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE
void drawPrimitive(PrimitiveElement elem, const QStyleOption *option, QPainter *painter, const QWidget *widget=0) const Q_DECL_OVERRIDE
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const Q_DECL_OVERRIDE
QPalette standardPalette() const Q_DECL_OVERRIDE
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const Q_DECL_OVERRIDE
int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const Q_DECL_OVERRIDE
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const Q_DECL_OVERRIDE
void stopProgressAnimation(QObject *o, QProgressBar *bar)
void startProgressAnimation(QObject *o, QProgressBar *bar)
void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const Q_DECL_OVERRIDE
void polish(QWidget *widget) Q_DECL_OVERRIDE
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE
void unpolish(QWidget *widget) Q_DECL_OVERRIDE
void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const Q_DECL_OVERRIDE
bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const Q_DECL_OVERRIDE