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
qquickpaddedrectangle_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKPADDEDRECTANGLE_P_H
5#define QQUICKPADDEDRECTANGLE_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 <QtQuick/private/qquickrectangle_p.h>
19#include <QtQuickControls2Impl/private/qtquickcontrols2implglobal_p.h>
20
22
23class Q_QUICKCONTROLS2IMPL_EXPORT QQuickPaddedRectangle : public QQuickRectangle
24{
26 Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged FINAL)
27 Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged FINAL)
28 Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding RESET resetLeftPadding NOTIFY leftPaddingChanged FINAL)
29 Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged FINAL)
30 Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged FINAL)
31 QML_NAMED_ELEMENT(PaddedRectangle)
33
34public:
35 QQuickPaddedRectangle(QQuickItem *parent = nullptr);
36
37 qreal padding() const;
38 void setPadding(qreal padding);
39 void resetPadding();
40
41 qreal topPadding() const;
42 void setTopPadding(qreal padding);
43 void resetTopPadding();
44
45 qreal leftPadding() const;
46 void setLeftPadding(qreal padding);
47 void resetLeftPadding();
48
49 qreal rightPadding() const;
50 void setRightPadding(qreal padding);
51 void resetRightPadding();
52
53 qreal bottomPadding() const;
54 void setBottomPadding(qreal padding);
55 void resetBottomPadding();
56
58 void paddingChanged();
59 void topPaddingChanged();
60 void leftPaddingChanged();
61 void rightPaddingChanged();
62 void bottomPaddingChanged();
63
64protected:
65 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
66
68 void setTopPadding(qreal padding, bool has);
69 void setLeftPadding(qreal padding, bool has);
70 void setRightPadding(qreal padding, bool has);
71 void setBottomPadding(qreal padding, bool has);
72
73 qreal m_padding = 0;
74 qreal m_topPadding = 0;
75 qreal m_leftPadding = 0;
76 qreal m_rightPadding = 0;
77 qreal m_bottomPadding = 0;
78 bool m_hasTopPadding = false;
79 bool m_hasLeftPadding = false;
80 bool m_hasRightPadding = false;
81 bool m_hasBottomPadding = false;
82};
83
85
86#endif // QQUICKPADDEDRECTANGLE_P_H
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
double qreal
Definition qtypes.h:187