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
qquickmacstyle_mac_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QMACSTYLE_MAC_P_H
5#define QMACSTYLE_MAC_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qquickcommonstyle.h"
19#include "private/qglobal_p.h"
20
21#define QQC2_NAMESPACE QQC2
22
24
25class QPalette;
26
27namespace QQC2_NAMESPACE {
28
31
32class QMacStyle : public QCommonStyle
33{
35public:
36 QMacStyle();
37 ~QMacStyle();
38
39 void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override;
40 void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override;
41 void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override;
42
43 QRect subElementRect(SubElement r, const QStyleOption *opt) const override;
46
47 QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override;
48 QFont font(ControlElement element, const QStyle::State state) const override;
50
51 int pixelMetric(PixelMetric pm, const QStyleOption *opt = 0) const override;
52 int styleHint(StyleHint sh, const QStyleOption *opt = 0, QStyleHintReturn *shret = 0) const override;
53
55 QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override;
56
57 void drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal,
58 bool enabled, const QString &text,
59 QPalette::ColorRole textRole = QPalette::NoRole) const override;
60
62
63private:
64 Q_DISABLE_COPY_MOVE(QMacStyle)
65 Q_DECLARE_PRIVATE(QMacStyle)
66};
67
68} // QQC2_NAMESPACE
69
71
72#endif // QMACSTYLE_MAC_P_H
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
\reentrant
Definition qfont.h:22
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
\inmodule QtCore
Definition qmargins.h:24
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:25
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=0) const override
int styleHint(StyleHint sh, const QStyleOption *opt=0, QStyleHintReturn *shret=0) const override
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt) const override
QMargins ninePatchMargins(ComplexControl cc, const QStyleOptionComplex *opt, const QSize &imageSize) const override
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
int pixelMetric(PixelMetric pm, const QStyleOption *opt=0) const override
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc) const override
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt) const override
void drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const override
Draws the given text in the specified rectangle using the provided painter and palette.
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionHeaderV2::textElideMode
\variable QStyleOptionMenuItem::menuItemType
The QStyleOption class stores the parameters used by QStyle functions.
ContentsType
This enum describes the available contents types.
Definition qstyle.h:546
StyleHint
This enum describes the available style hints.
Definition qstyle.h:584
StandardPixmap
This enum describes the available standard pixmaps.
Definition qstyle.h:716
ControlElement
This enum represents a control element.
Definition qstyle.h:170
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
SubElement
This enum represents a sub-area of a widget.
Definition qstyle.h:242
SubControl
This enum describes the available sub controls.
Definition qstyle.h:347
QString text
drawPrimitive(PE_IndicatorCheckBox, &subopt, p, widget)
QStyleOptionButton opt
p drawControl(QStyle::CE_CheckBox, opt)
else opt state
[0]
Combined button and popup list for selecting options.
GLboolean r
[2]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLbitfield flags
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLfloat GLfloat p
[1]
#define sp
#define Q_OBJECT
widget render & pixmap