aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/adding/main.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <[email protected]>2023-03-17 15:42:47 +0100
committerOlivier De Cannière <[email protected]>2023-03-30 18:02:16 +0200
commit405bd4299819e39397cea0090a9442fd4b6ce911 (patch)
treec1254e18a8ab47cc6bde048eb52ad0d89c2492c8 /examples/qml/referenceexamples/adding/main.cpp
parent03ff348b4942ae29dd5bc2bd563998d7ba82ecd7 (diff)
Doc: Revamp "Extending QML" examples into a tutorial
The examples in the "Extending QML" series were often redundant with the information of the "Writing QML Extensions with C++" tutorial, had outdated code and sometimes had no documentation. The examples that covered topics not mentioned in the first tutorial were revamped into a second "advanced" tutorial extending the first one. The others were removed. The remaining examples were largely based on the same example code of a birthday party. This code was slightly adapted and separated into 7 states, each building upon the previous, with the code change illustrating the associated feature. A tutorial page, in the style of the first one, was added documenting the different QML features and the required code changes in the example project. Links in the documentation from and to the affected pages were update as best as possible. Pick-to: 6.5 Fixes: QTBUG-111033 Change-Id: I9d97e8b32b128c1624d67525996fa14d493909d3 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'examples/qml/referenceexamples/adding/main.cpp')
-rw-r--r--examples/qml/referenceexamples/adding/main.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/examples/qml/referenceexamples/adding/main.cpp b/examples/qml/referenceexamples/adding/main.cpp
deleted file mode 100644
index 319217da56..0000000000
--- a/examples/qml/referenceexamples/adding/main.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include <QCoreApplication>
-#include <QQmlEngine>
-#include <QQmlComponent>
-#include <QDebug>
-#include "person.h"
-
-int main(int argc, char ** argv)
-{
- QCoreApplication app(argc, argv);
-
- QQmlEngine engine;
- QQmlComponent component(&engine, QUrl("qrc:example.qml"));
- auto *person = qobject_cast<Person *>(component.create());
- if (!person) {
- qWarning() << component.errors();
- return EXIT_FAILURE;
- }
-
- qInfo() << "The person's name is" << person->name()
- << "\nThey wear a" << person->shoeSize() << "sized shoe";
-
- return EXIT_SUCCESS;
-}