Changeset View
Changeset View
Standalone View
Standalone View
qmlUiKirigami/EditorView.qml
- This file was moved from src/imageprovider.h.
Show All 11 Lines | |||||
12 | * GNU Library General Public License for more details | 12 | * GNU Library General Public License for more details | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef IMAGE_PROVIDER_H | 20 | import QtQuick 2.7 | ||
21 | #define IMAGE_PROVIDER_H | 21 | import QtQuick.Controls 2.1 as Controls | ||
22 | import org.kde.kirigami 2.0 as Kirigami | ||||
23 | import org.kde.kquickcontrolsaddons 2.0 as KQA | ||||
24 | import org.kde.koko 0.1 as Koko | ||||
22 | 25 | | |||
23 | #include <qquickimageprovider.h> | 26 | Kirigami.Page { | ||
27 | id: rootEditorView | ||||
28 | title: i18n("Edit") | ||||
29 | leftPadding: 0 | ||||
30 | rightPadding: 0 | ||||
24 | 31 | | |||
25 | class ImageProvider: public QQuickImageProvider | 32 | property string imagePath | ||
26 | { | | |||
27 | public: | | |||
28 | explicit ImageProvider(); | | |||
29 | 33 | | |||
30 | virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); | 34 | Koko.ImageDocument { | ||
31 | }; | 35 | id: imageDoc | ||
36 | path: imagePath | ||||
37 | } | ||||
32 | 38 | | |||
33 | #endif | 39 | contentItem: Flickable { | ||
40 | width: rootEditorView.width | ||||
41 | height: rootEditorView.height | ||||
42 | KQA.QImageItem { | ||||
43 | id: editImage | ||||
44 | width: rootEditorView.width | ||||
45 | height: rootEditorView.height | ||||
46 | image: imageDoc.visualImage | ||||
47 | } | ||||
48 | } | ||||
49 | | ||||
50 | } |