1// Copyright (C) 2022 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 QQUICKNINEPATCHIMAGE_P_H
5#define QQUICKNINEPATCHIMAGE_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/qquickimage_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQuickNinePatchImagePrivate;
23
24class QQuickNinePatchImage : public QQuickImage
25{
26 Q_OBJECT
27 Q_PROPERTY(qreal topPadding READ topPadding NOTIFY topPaddingChanged FINAL)
28 Q_PROPERTY(qreal leftPadding READ leftPadding NOTIFY leftPaddingChanged FINAL)
29 Q_PROPERTY(qreal rightPadding READ rightPadding NOTIFY rightPaddingChanged FINAL)
30 Q_PROPERTY(qreal bottomPadding READ bottomPadding NOTIFY bottomPaddingChanged FINAL)
31 Q_PROPERTY(qreal topInset READ topInset NOTIFY topInsetChanged FINAL)
32 Q_PROPERTY(qreal leftInset READ leftInset NOTIFY leftInsetChanged FINAL)
33 Q_PROPERTY(qreal rightInset READ rightInset NOTIFY rightInsetChanged FINAL)
34 Q_PROPERTY(qreal bottomInset READ bottomInset NOTIFY bottomInsetChanged FINAL)
35 QML_NAMED_ELEMENT(NinePatchImage)
36 QML_ADDED_IN_VERSION(2, 3)
37
38public:
39 explicit QQuickNinePatchImage(QQuickItem *parent = nullptr);
40
41 qreal topPadding() const;
42 qreal leftPadding() const;
43 qreal rightPadding() const;
44 qreal bottomPadding() const;
45
46 qreal topInset() const;
47 qreal leftInset() const;
48 qreal rightInset() const;
49 qreal bottomInset() const;
50
51Q_SIGNALS:
52 void topPaddingChanged();
53 void leftPaddingChanged();
54 void rightPaddingChanged();
55 void bottomPaddingChanged();
56
57 void topInsetChanged();
58 void leftInsetChanged();
59 void rightInsetChanged();
60 void bottomInsetChanged();
61
62protected:
63 void pixmapChange() override;
64 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
65
66private:
67 Q_DISABLE_COPY(QQuickNinePatchImage)
68 Q_DECLARE_PRIVATE(QQuickNinePatchImage)
69};
70
71QT_END_NAMESPACE
72
73QML_DECLARE_TYPE(QQuickNinePatchImage)
74
75#endif // QQUICKNINEPATCHIMAGE_P_H
76

source code of qtdeclarative/src/quickcontrolsimpl/qquickninepatchimage_p.h