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 QQUICKBORDERIMAGE_P_P_H |
5 | #define QQUICKBORDERIMAGE_P_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 "qquickimagebase_p_p.h" |
19 | #include "qquickscalegrid_p_p.h" |
20 | |
21 | #include <private/qqmlglobal_p.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | #if QT_CONFIG(qml_network) |
26 | class QNetworkReply; |
27 | #endif |
28 | class QQuickBorderImagePrivate : public QQuickImageBasePrivate |
29 | { |
30 | Q_DECLARE_PUBLIC(QQuickBorderImage) |
31 | |
32 | public: |
33 | QQuickBorderImagePrivate() |
34 | { |
35 | } |
36 | |
37 | ~QQuickBorderImagePrivate() |
38 | { |
39 | } |
40 | |
41 | QQuickScaleGrid *getScaleGrid() |
42 | { |
43 | Q_Q(QQuickBorderImage); |
44 | if (!border) { |
45 | border = new QQuickScaleGrid(q); |
46 | qmlobject_connect(border, QQuickScaleGrid, SIGNAL(borderChanged()), |
47 | q, QQuickBorderImage, SLOT(doUpdate())); |
48 | } |
49 | return border; |
50 | } |
51 | |
52 | static void calculateRects(const QQuickScaleGrid *border, |
53 | const QSize &sourceSize, |
54 | const QSizeF &targetSize, |
55 | int horizontalTileMode, |
56 | int verticalTileMode, |
57 | qreal devicePixelRatio, |
58 | QRectF *targetRect, |
59 | QRectF *innerTargetRect, |
60 | QRectF *innerSourceRect, |
61 | QRectF *subSourceRect); |
62 | |
63 | QUrl sciurl; |
64 | QQuickScaleGrid *border = nullptr; |
65 | QQuickBorderImage::TileMode horizontalTileMode = QQuickBorderImage::Stretch; |
66 | QQuickBorderImage::TileMode verticalTileMode = QQuickBorderImage::Stretch; |
67 | bool pixmapChanged = false; |
68 | |
69 | #if QT_CONFIG(qml_network) |
70 | QNetworkReply *sciReply = nullptr; |
71 | #endif |
72 | }; |
73 | |
74 | QT_END_NAMESPACE |
75 | |
76 | #endif // QQUICKBORDERIMAGE_P_P_H |
77 |