Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpixmapstyle_p.h
Go to the documentation of this file.
1
// Copyright (C) 2014 BlackBerry Limited. All rights reserved.
2
// Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
3
// Copyright (C) 2016 The Qt Company Ltd.
4
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
5
6
#ifndef QPIXMAPSTYLE_H
7
#define QPIXMAPSTYLE_H
8
9
#include <QtWidgets/private/qtwidgetsglobal_p.h>
10
#include <QtWidgets/QCommonStyle>
11
#include <QtWidgets/QTileRules>
12
13
//
14
// W A R N I N G
15
// -------------
16
//
17
// This file is not part of the Qt API. It exists purely as an
18
// implementation detail. This header file may change from version to
19
// version without notice, or even be removed.
20
//
21
// We mean it.
22
//
23
24
QT_BEGIN_NAMESPACE
25
26
class
QPixmapStylePrivate
;
27
28
class
Q_WIDGETS_EXPORT
QPixmapStyle
:
public
QCommonStyle
29
{
30
Q_OBJECT
31
32
public
:
33
enum
ControlDescriptor
{
34
BG_Background
,
35
LE_Enabled
,
// QLineEdit
36
LE_Disabled
,
37
LE_Focused
,
38
PB_Enabled
,
// QPushButton
39
PB_Pressed
,
40
PB_PressedDisabled
,
41
PB_Checked
,
42
PB_Disabled
,
43
TE_Enabled
,
// QTextEdit
44
TE_Disabled
,
45
TE_Focused
,
46
PB_HBackground
,
// Horizontal QProgressBar
47
PB_HContent
,
48
PB_HComplete
,
49
PB_VBackground
,
// Vertical QProgressBar
50
PB_VContent
,
51
PB_VComplete
,
52
SG_HEnabled
,
// Horizontal QSlider groove
53
SG_HDisabled
,
54
SG_HActiveEnabled
,
55
SG_HActivePressed
,
56
SG_HActiveDisabled
,
57
SG_VEnabled
,
// Vertical QSlider groove
58
SG_VDisabled
,
59
SG_VActiveEnabled
,
60
SG_VActivePressed
,
61
SG_VActiveDisabled
,
62
DD_ButtonEnabled
,
// QComboBox (DropDown)
63
DD_ButtonDisabled
,
64
DD_ButtonPressed
,
65
DD_PopupDown
,
66
DD_PopupUp
,
67
DD_ItemSelected
,
68
ID_Selected
,
// QStyledItemDelegate
69
SB_Horizontal
,
// QScrollBar
70
SB_Vertical
71
};
72
73
enum
ControlPixmap
{
74
CB_Enabled
,
// QCheckBox
75
CB_Checked
,
76
CB_Pressed
,
77
CB_PressedChecked
,
78
CB_Disabled
,
79
CB_DisabledChecked
,
80
RB_Enabled
,
// QRadioButton
81
RB_Checked
,
82
RB_Pressed
,
83
RB_Disabled
,
84
RB_DisabledChecked
,
85
SH_HEnabled
,
// Horizontal QSlider handle
86
SH_HDisabled
,
87
SH_HPressed
,
88
SH_VEnabled
,
// Vertical QSlider handle
89
SH_VDisabled
,
90
SH_VPressed
,
91
DD_ArrowEnabled
,
// QComboBox (DropDown) arrow
92
DD_ArrowDisabled
,
93
DD_ArrowPressed
,
94
DD_ArrowOpen
,
95
DD_ItemSeparator
,
96
ID_Separator
// QStyledItemDelegate separator
97
};
98
99
public
:
100
QPixmapStyle
();
101
~QPixmapStyle
();
102
103
void
polish(
QApplication
*application)
override
;
104
void
polish(
QPalette
&
palette
)
override
;
105
void
polish(
QWidget
*
widget
)
override
;
106
void
unpolish(
QApplication
*application)
override
;
107
void
unpolish(
QWidget
*
widget
)
override
;
108
109
void
drawPrimitive
(PrimitiveElement element,
const
QStyleOption
*
option
,
110
QPainter
*
painter
,
const
QWidget
*
widget
=
nullptr
)
const override
;
111
void
drawControl
(ControlElement element,
const
QStyleOption
*
option
,
112
QPainter
*
painter
,
const
QWidget
*
widget
=
nullptr
)
const override
;
113
void
drawComplexControl(ComplexControl cc,
const
QStyleOptionComplex
*
option
,
114
QPainter
*
painter
,
const
QWidget
*
widget
=
nullptr
)
const override
;
115
116
QSize
sizeFromContents(ContentsType
type
,
const
QStyleOption
*
option
,
117
const
QSize
&contentsSize,
const
QWidget
*
widget
=
nullptr
)
const override
;
118
QRect
subElementRect(SubElement element,
const
QStyleOption
*
option
,
119
const
QWidget
*
widget
=
nullptr
)
const override
;
120
QRect
subControlRect(ComplexControl cc,
const
QStyleOptionComplex
*
option
,
121
SubControl sc,
const
QWidget
*
widget
=
nullptr
)
const override
;
122
123
int
pixelMetric(PixelMetric metric,
const
QStyleOption
*
option
=
nullptr
,
124
const
QWidget
*
widget
=
nullptr
)
const override
;
125
int
styleHint(StyleHint
hint
,
const
QStyleOption
*
option
,
126
const
QWidget
*
widget
,
QStyleHintReturn
*returnData)
const override
;
127
SubControl hitTestComplexControl(ComplexControl control,
const
QStyleOptionComplex
*
option
,
128
const
QPoint
&
pos
,
const
QWidget
*
widget
)
const override
;
129
130
bool
eventFilter(
QObject
*watched,
QEvent
*
event
)
override
;
131
132
void
addDescriptor(ControlDescriptor control,
const
QString
&
fileName
,
133
QMargins
margins =
QMargins
(),
134
QTileRules
tileRules =
QTileRules
(
Qt::RepeatTile
,
Qt::RepeatTile
));
135
void
copyDescriptor(ControlDescriptor
source
, ControlDescriptor dest);
136
void
drawCachedPixmap(ControlDescriptor control,
const
QRect
&
rect
,
QPainter
*
p
)
const
;
137
138
void
addPixmap(ControlPixmap control,
const
QString
&
fileName
,
139
QMargins
margins =
QMargins
());
140
void
copyPixmap(ControlPixmap
source
, ControlPixmap dest);
141
142
protected
:
143
void
drawPushButton(
const
QStyleOption
*
option
,
144
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
145
void
drawLineEdit(
const
QStyleOption
*
option
,
146
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
147
void
drawTextEdit(
const
QStyleOption
*
option
,
148
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
149
void
drawCheckBox(
const
QStyleOption
*
option
,
150
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
151
void
drawRadioButton(
const
QStyleOption
*
option
,
152
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
153
void
drawPanelItemViewItem(
const
QStyleOption
*
option
,
154
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
155
void
drawProgressBarBackground(
const
QStyleOption
*
option
,
156
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
157
void
drawProgressBarLabel(
const
QStyleOption
*
option
,
158
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
159
void
drawProgressBarFill(
const
QStyleOption
*
option
,
160
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
161
void
drawSlider(
const
QStyleOptionComplex
*
option
,
162
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
163
void
drawComboBox(
const
QStyleOptionComplex
*
option
,
164
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
165
void
drawScrollBar(
const
QStyleOptionComplex
*
option
,
166
QPainter
*
painter
,
const
QWidget
*
widget
)
const
;
167
168
QSize
pushButtonSizeFromContents(
const
QStyleOption
*
option
,
169
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
170
QSize
lineEditSizeFromContents(
const
QStyleOption
*
option
,
171
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
172
QSize
progressBarSizeFromContents(
const
QStyleOption
*
option
,
173
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
174
QSize
sliderSizeFromContents(
const
QStyleOption
*
option
,
175
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
176
QSize
comboBoxSizeFromContents(
const
QStyleOption
*
option
,
177
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
178
QSize
itemViewSizeFromContents(
const
QStyleOption
*
option
,
179
const
QSize
&contentsSize,
const
QWidget
*
widget
)
const
;
180
181
QRect
comboBoxSubControlRect(
const
QStyleOptionComplex
*
option
,
QPixmapStyle::SubControl
sc,
182
const
QWidget
*
widget
)
const
;
183
QRect
scrollBarSubControlRect(
const
QStyleOptionComplex
*
option
,
QPixmapStyle::SubControl
sc,
184
const
QWidget
*
widget
)
const
;
185
186
protected
:
187
QPixmapStyle
(
QPixmapStylePrivate
&dd);
188
189
private
:
190
Q_DECLARE_PRIVATE(
QPixmapStyle
)
191
};
192
193
QT_END_NAMESPACE
194
195
#endif
// QPIXMAPSTYLE_H
QApplication
The QApplication class manages the GUI application's control flow and main settings.
Definition
qapplication.h:32
QCommonStyle
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
Definition
qcommonstyle.h:15
QEvent
\inmodule QtCore
Definition
qcoreevent.h:45
QMargins
\inmodule QtCore
Definition
qmargins.h:24
QObject
\inmodule QtCore
Definition
qobject.h:103
QPainter
The QPainter class performs low-level painting on widgets and other paint devices.
Definition
qpainter.h:46
QPalette
The QPalette class contains color groups for each widget state.
Definition
qpalette.h:19
QPixmapStylePrivate
Definition
qpixmapstyle_p_p.h:39
QPixmapStyle
The QPixmapStyle class provides mechanism for writing pixmap based styles.
Definition
qpixmapstyle_p.h:29
QPixmapStyle::ControlDescriptor
ControlDescriptor
Definition
qpixmapstyle_p.h:33
QPixmapStyle::PB_PressedDisabled
@ PB_PressedDisabled
Definition
qpixmapstyle_p.h:40
QPixmapStyle::PB_HBackground
@ PB_HBackground
Definition
qpixmapstyle_p.h:46
QPixmapStyle::ID_Selected
@ ID_Selected
Definition
qpixmapstyle_p.h:68
QPixmapStyle::PB_VBackground
@ PB_VBackground
Definition
qpixmapstyle_p.h:49
QPixmapStyle::SB_Horizontal
@ SB_Horizontal
Definition
qpixmapstyle_p.h:69
QPixmapStyle::DD_ButtonPressed
@ DD_ButtonPressed
Definition
qpixmapstyle_p.h:64
QPixmapStyle::DD_ButtonEnabled
@ DD_ButtonEnabled
Definition
qpixmapstyle_p.h:62
QPixmapStyle::SG_VActiveDisabled
@ SG_VActiveDisabled
Definition
qpixmapstyle_p.h:61
QPixmapStyle::SG_HActiveEnabled
@ SG_HActiveEnabled
Definition
qpixmapstyle_p.h:54
QPixmapStyle::LE_Disabled
@ LE_Disabled
Definition
qpixmapstyle_p.h:36
QPixmapStyle::SG_HActivePressed
@ SG_HActivePressed
Definition
qpixmapstyle_p.h:55
QPixmapStyle::DD_PopupDown
@ DD_PopupDown
Definition
qpixmapstyle_p.h:65
QPixmapStyle::SG_VDisabled
@ SG_VDisabled
Definition
qpixmapstyle_p.h:58
QPixmapStyle::PB_HContent
@ PB_HContent
Definition
qpixmapstyle_p.h:47
QPixmapStyle::LE_Enabled
@ LE_Enabled
Definition
qpixmapstyle_p.h:35
QPixmapStyle::PB_VContent
@ PB_VContent
Definition
qpixmapstyle_p.h:50
QPixmapStyle::PB_Pressed
@ PB_Pressed
Definition
qpixmapstyle_p.h:39
QPixmapStyle::DD_ItemSelected
@ DD_ItemSelected
Definition
qpixmapstyle_p.h:67
QPixmapStyle::TE_Focused
@ TE_Focused
Definition
qpixmapstyle_p.h:45
QPixmapStyle::PB_VComplete
@ PB_VComplete
Definition
qpixmapstyle_p.h:51
QPixmapStyle::SG_HEnabled
@ SG_HEnabled
Definition
qpixmapstyle_p.h:52
QPixmapStyle::SG_HDisabled
@ SG_HDisabled
Definition
qpixmapstyle_p.h:53
QPixmapStyle::PB_HComplete
@ PB_HComplete
Definition
qpixmapstyle_p.h:48
QPixmapStyle::SG_VActivePressed
@ SG_VActivePressed
Definition
qpixmapstyle_p.h:60
QPixmapStyle::PB_Enabled
@ PB_Enabled
Definition
qpixmapstyle_p.h:38
QPixmapStyle::TE_Enabled
@ TE_Enabled
Definition
qpixmapstyle_p.h:43
QPixmapStyle::SG_VEnabled
@ SG_VEnabled
Definition
qpixmapstyle_p.h:57
QPixmapStyle::TE_Disabled
@ TE_Disabled
Definition
qpixmapstyle_p.h:44
QPixmapStyle::SG_VActiveEnabled
@ SG_VActiveEnabled
Definition
qpixmapstyle_p.h:59
QPixmapStyle::LE_Focused
@ LE_Focused
Definition
qpixmapstyle_p.h:37
QPixmapStyle::PB_Disabled
@ PB_Disabled
Definition
qpixmapstyle_p.h:42
QPixmapStyle::DD_ButtonDisabled
@ DD_ButtonDisabled
Definition
qpixmapstyle_p.h:63
QPixmapStyle::BG_Background
@ BG_Background
Definition
qpixmapstyle_p.h:34
QPixmapStyle::PB_Checked
@ PB_Checked
Definition
qpixmapstyle_p.h:41
QPixmapStyle::SG_HActiveDisabled
@ SG_HActiveDisabled
Definition
qpixmapstyle_p.h:56
QPixmapStyle::DD_PopupUp
@ DD_PopupUp
Definition
qpixmapstyle_p.h:66
QPixmapStyle::ControlPixmap
ControlPixmap
Definition
qpixmapstyle_p.h:73
QPixmapStyle::CB_Disabled
@ CB_Disabled
Definition
qpixmapstyle_p.h:78
QPixmapStyle::RB_DisabledChecked
@ RB_DisabledChecked
Definition
qpixmapstyle_p.h:84
QPixmapStyle::RB_Disabled
@ RB_Disabled
Definition
qpixmapstyle_p.h:83
QPixmapStyle::CB_Checked
@ CB_Checked
Definition
qpixmapstyle_p.h:75
QPixmapStyle::CB_PressedChecked
@ CB_PressedChecked
Definition
qpixmapstyle_p.h:77
QPixmapStyle::DD_ArrowPressed
@ DD_ArrowPressed
Definition
qpixmapstyle_p.h:93
QPixmapStyle::DD_ArrowOpen
@ DD_ArrowOpen
Definition
qpixmapstyle_p.h:94
QPixmapStyle::RB_Checked
@ RB_Checked
Definition
qpixmapstyle_p.h:81
QPixmapStyle::SH_HEnabled
@ SH_HEnabled
Definition
qpixmapstyle_p.h:85
QPixmapStyle::CB_DisabledChecked
@ CB_DisabledChecked
Definition
qpixmapstyle_p.h:79
QPixmapStyle::SH_HDisabled
@ SH_HDisabled
Definition
qpixmapstyle_p.h:86
QPixmapStyle::RB_Enabled
@ RB_Enabled
Definition
qpixmapstyle_p.h:80
QPixmapStyle::DD_ArrowDisabled
@ DD_ArrowDisabled
Definition
qpixmapstyle_p.h:92
QPixmapStyle::RB_Pressed
@ RB_Pressed
Definition
qpixmapstyle_p.h:82
QPixmapStyle::CB_Enabled
@ CB_Enabled
Definition
qpixmapstyle_p.h:74
QPixmapStyle::CB_Pressed
@ CB_Pressed
Definition
qpixmapstyle_p.h:76
QPixmapStyle::DD_ArrowEnabled
@ DD_ArrowEnabled
Definition
qpixmapstyle_p.h:91
QPixmapStyle::DD_ItemSeparator
@ DD_ItemSeparator
Definition
qpixmapstyle_p.h:95
QPixmapStyle::SH_VDisabled
@ SH_VDisabled
Definition
qpixmapstyle_p.h:89
QPixmapStyle::SH_HPressed
@ SH_HPressed
Definition
qpixmapstyle_p.h:87
QPixmapStyle::SH_VPressed
@ SH_VPressed
Definition
qpixmapstyle_p.h:90
QPixmapStyle::SH_VEnabled
@ SH_VEnabled
Definition
qpixmapstyle_p.h:88
QPoint
\inmodule QtCore\reentrant
Definition
qpoint.h:25
QRect
\inmodule QtCore\reentrant
Definition
qrect.h:30
QSize
\inmodule QtCore
Definition
qsize.h:25
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:129
QStyleHintReturn
\variable QStyleOptionGraphicsItem::exposedRect
Definition
qstyleoption.h:689
QStyleOptionComplex
\variable QStyleOptionMenuItem::menuItemType
Definition
qstyleoption.h:480
QStyleOption
The QStyleOption class stores the parameters used by QStyle functions.
Definition
qstyleoption.h:39
QStyle::SubControl
SubControl
This enum describes the available sub controls.
Definition
qstyle.h:347
QWidget
The QWidget class is the base class of all user interface objects.
Definition
qwidget.h:99
widget
QOpenGLWidget * widget
[1]
Definition
doc_gui_widgets_qopenglwidget.cpp:53
drawPrimitive
drawPrimitive(PE_IndicatorCheckBox, &subopt, p, widget)
rect
rect
[4]
Definition
doc_src_styles.cpp:43
drawControl
p drawControl(QStyle::CE_CheckBox, opt)
palette
palette
Definition
doc_src_styles.cpp:44
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
Qt::RepeatTile
@ RepeatTile
Definition
qnamespace.h:135
type
GLenum type
Definition
qopengles2ext.h:150
source
GLsizei GLsizei GLchar * source
Definition
qopengles2ext.h:952
event
struct _cl_event * event
Definition
qopenglext.h:2998
p
GLfloat GLfloat p
[1]
Definition
qopenglext.h:12698
option
GLuint GLenum option
Definition
qopenglext.h:5929
hint
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
Definition
qstylehints.cpp:13
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:119
pos
pos
[7]
Definition
src_corelib_io_qsettings.cpp:57
fileName
fileName
[0]
Definition
src_gui_dialogs_qfiledialog.cpp:5
painter
QPainter painter(this)
[7]
QTileRules
The QTileRules class provides the rules used to draw a pixmap or image split into nine segments.
Definition
qdrawutil.h:88
qtbase
src
widgets
styles
qpixmapstyle_p.h
Generated by
1.10.0