diff options
| author | Mitch Curtis <mitch.curtis@qt.io> | 2023-12-18 13:21:39 +0800 |
|---|---|---|
| committer | Mitch Curtis <mitch.curtis@qt.io> | 2024-01-08 10:19:19 +0800 |
| commit | c11436857fe2ee6951c97d2d58a9227120c7884c (patch) | |
| tree | e162fbd1afa5980b2994929606015dda71478c55 /examples/quickcontrols/chattutorial/chapter2/main.cpp | |
| parent | 06e42e733ed6658abbb30ba7be2e571b4533d009 (diff) | |
Improve chattutorial example
- Use modern QML type registration.
- Fix qmllint warnings.
- Tidy up code.
- Update copyright year.
Fixes: QTBUG-119986
Change-Id: Ibb47c929a14cd0e786acb7c7496e6cce34f624df
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quickcontrols/chattutorial/chapter2/main.cpp')
| -rw-r--r-- | examples/quickcontrols/chattutorial/chapter2/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/quickcontrols/chattutorial/chapter2/main.cpp b/examples/quickcontrols/chattutorial/chapter2/main.cpp index 07f034a827..73d4bf3b63 100644 --- a/examples/quickcontrols/chattutorial/chapter2/main.cpp +++ b/examples/quickcontrols/chattutorial/chapter2/main.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2017 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include <QGuiApplication> @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/qt/qml/chapter2/main.qml"))); + engine.loadFromModule("chattutorial", "Main"); return app.exec(); } |
