Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcommonstyle.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCOMMONSTYLE_H
5#define QCOMMONSTYLE_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qstyle.h>
9
11
13
14class Q_WIDGETS_EXPORT QCommonStyle: public QStyle
15{
17
18public:
21
23 const QWidget *w = nullptr) const override;
24 void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
25 const QWidget *w = nullptr) const override;
26 QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
28 const QWidget *w = nullptr) const override;
30 const QPoint &pt, const QWidget *w = nullptr) const override;
32 const QWidget *w = nullptr) const override;
34 const QSize &contentsSize, const QWidget *widget = nullptr) const override;
35
36 int pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override;
37
38 int styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *w = nullptr,
39 QStyleHintReturn *shret = nullptr) const override;
40
41 QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = nullptr,
42 const QWidget *widget = nullptr) const override;
44 const QWidget *widget = nullptr) const override;
45
47 const QStyleOption *opt) const override;
49 Qt::Orientation orientation, const QStyleOption *option = nullptr,
50 const QWidget *widget = nullptr) const override;
51
52 void polish(QPalette &) override;
53 void polish(QApplication *app) override;
54 void polish(QWidget *widget) override;
55 void unpolish(QWidget *widget) override;
56 void unpolish(QApplication *application) override;
57
58protected:
60
61private:
62 Q_DECLARE_PRIVATE(QCommonStyle)
63 Q_DISABLE_COPY(QCommonStyle)
64#if QT_CONFIG(animation)
65 Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
66#endif
67};
68
70
71#endif // QCOMMONSTYLE_H
The QApplication class manages the GUI application's control flow and main settings.
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
Mode
This enum type describes the mode for which a pixmap is intended to be used.
Definition qicon.h:22
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionMenuItem::menuItemType
The QStyleOption class stores the parameters used by QStyle functions.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Definition qstyle.h:29
ContentsType
This enum describes the available contents types.
Definition qstyle.h:544
virtual void polish(QWidget *widget)
Initializes the appearance of the given widget.
Definition qstyle.cpp:436
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=nullptr) const =0
Draws the given control using the provided painter with the style options specified by option.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
StyleHint
This enum describes the available style hints.
Definition qstyle.h:582
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
virtual int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
StandardPixmap
This enum describes the available standard pixmaps.
Definition qstyle.h:714
ControlElement
This enum represents a control element.
Definition qstyle.h:170
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const =0
Returns the sub-area for the given element as described in the provided style option.
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=nullptr) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
PixelMetric
This enum describes the various available pixel metrics.
Definition qstyle.h:413
ComplexControl
This enum describes the available complex controls.
Definition qstyle.h:331
PrimitiveElement
This enum describes the various primitive elements.
Definition qstyle.h:102
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const =0
Returns a copy of the given pixmap, styled to conform to the specified iconMode and taking into accou...
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const =0
virtual void unpolish(QWidget *widget)
Uninitialize the given {widget}'s appearance.
Definition qstyle.cpp:455
SubElement
This enum represents a sub-area of a widget.
Definition qstyle.h:242
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
SubControl
This enum describes the available sub controls.
Definition qstyle.h:347
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
QStyleOptionButton opt
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:97
const GLfloat * m
GLfloat GLfloat GLfloat w
[0]
GLboolean r
[2]
GLfloat GLfloat p
[1]
GLuint GLenum option
#define sp
#define Q_OBJECT
#define Q_PRIVATE_SLOT(d, signature)
QApplication app(argc, argv)
[0]
widget render & pixmap