diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2021-11-11 16:36:38 +0100 |
---|---|---|
committer | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2021-11-12 12:24:29 +0100 |
commit | a155b3bc3ee161fbb7ff1760781577700b0aafce (patch) | |
tree | 81561c7197ff7c80c3c5185c93f65277d894bfe0 /examples/quick/models/objectlistmodel/main.cpp | |
parent | bdbc91cb90e9858cddc23da90ddd659262faa068 (diff) |
Model examples: use new cmake api
The models directory contains 3 subdirectories with an example project
in each.
This patch updates the CMakeLists.txt files to use qt_add_qml_module()
instead of the old qt_add_resources().
In order to achieve intercompatibility with both cmake and qmake, I had
to do some slight modifications to both the .qrc files and the url path
used to set the source to the QQuickView.
Task-number: QTBUG-98130
Pick-to: 6.2
Change-Id: I13d1c01a0eda181823f394bc2a4259ce98abd4f8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quick/models/objectlistmodel/main.cpp')
-rw-r--r-- | examples/quick/models/objectlistmodel/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/quick/models/objectlistmodel/main.cpp b/examples/quick/models/objectlistmodel/main.cpp index 8fbe7c183c..cb8dac0638 100644 --- a/examples/quick/models/objectlistmodel/main.cpp +++ b/examples/quick/models/objectlistmodel/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. @@ -80,7 +80,7 @@ int main(int argc, char ** argv) view.setInitialProperties({{ "model", QVariant::fromValue(dataList) }}); //![0] - view.setSource(QUrl("qrc:view.qml")); + view.setSource(QUrl("qrc:/objectlistmodel/view.qml")); view.show(); return app.exec(); |