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
createWithInitialProperties.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QtQml/qqml.h>
5#include <QtQml/qqmlengine.h>
6#include <QtQml/qqmlcomponent.h>
7#include <QtGui/qguiapplication.h>
8
9int main(int argc, char *argv[])
10{
11 QGuiApplication app(argc, argv);
12
13//![0]
14 QQmlEngine engine;
15
16 QQmlComponent component(&engine, "MyModule", "RequiredProperties");
17 QScopedPointer<QObject> o(component.createWithInitialProperties({
18 {"thing", 11}
19 }));
20//![0]
21
22 return app.exec();
23}
int main(int argc, char *argv[])
[ctor_close]