Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickborderimage_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKBORDERIMAGE_P_H
6#define QQUICKBORDERIMAGE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20
22
23class QQuickScaleGrid;
24class QQuickGridScaledImage;
26class Q_QUICK_EXPORT QQuickBorderImage : public QQuickImageBase
27{
28 Q_OBJECT
29
30 Q_PROPERTY(QQuickScaleGrid *border READ border CONSTANT)
31 Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged)
32 Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged)
33 // read-only for BorderImage
34 Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY sourceSizeChanged)
35 QML_NAMED_ELEMENT(BorderImage)
36 QML_ADDED_IN_VERSION(2, 0)
37
38public:
39 QQuickBorderImage(QQuickItem *parent=nullptr);
40 ~QQuickBorderImage();
41
42 QQuickScaleGrid *border();
43
44 enum TileMode { Stretch = Qt::StretchTile, Repeat = Qt::RepeatTile, Round = Qt::RoundTile };
45 Q_ENUM(TileMode)
46
47 TileMode horizontalTileMode() const;
48 void setHorizontalTileMode(TileMode);
49
50 TileMode verticalTileMode() const;
51 void setVerticalTileMode(TileMode);
52
53 void setSource(const QUrl &url) override;
54
55Q_SIGNALS:
56 void horizontalTileModeChanged();
57 void verticalTileModeChanged();
58 void sourceSizeChanged();
59
60protected:
61 void load() override;
62 void pixmapChange() override;
63 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
64
65private:
66 void setGridScaledImage(const QQuickGridScaledImage& sci);
67
68private Q_SLOTS:
69 void doUpdate();
70 void requestFinished() override;
71#if QT_CONFIG(qml_network)
72 void sciRequestFinished();
73#endif
74
75private:
76 Q_DISABLE_COPY(QQuickBorderImage)
77 Q_DECLARE_PRIVATE(QQuickBorderImage)
78};
79
80QT_END_NAMESPACE
81
82#endif // QQUICKBORDERIMAGE_P_H