Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
HelloWorld.qml.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4/* Disclaimer: This file is an "as is" copy of the C++ header generated for the
5 accompanying HelloWorld.qml. Its pieces are used to:
6
7 * verify that the generated code is similar to what is contained in this file
8 * provide documentation snippets for the qmltc docs
9
10 Note: all the stuff below MAGIC_QMLTC_TEST_DELIMITER_LINE comment
11 participates in the aforementioned activities. Prefer to put arbitrary stuff
12 before that comment.
13*/
14
15// MAGIC_QMLTC_TEST_DELIMITER_LINE
16
18class HelloWorld : public QObject
19{
23
24public:
25 HelloWorld(QQmlEngine* engine, QObject* parent = nullptr, [[maybe_unused]] qxp::function_ref<void(PropertyInitializer&)> initializer = [](PropertyInitializer&){});
26
28 void created();
29
30public:
31 void setHello(const QString& hello_);
33 QBindable<QString> bindableHello();
34 Q_INVOKABLE void printHello(passByConstRefOrValue<QString> prefix, passByConstRefOrValue<QString> suffix);
35
36 // ...
37};
[qmltc-hello-world-generated]
Q_INVOKABLE void printHello(passByConstRefOrValue< QString > prefix, passByConstRefOrValue< QString > suffix)
QString hello()
void created()
HelloWorld(QQmlEngine *engine, QObject *parent=nullptr, qxp::function_ref< void(PropertyInitializer &)> initializer=[](PropertyInitializer &){})
void setHello(const QString &hello_)
QBindable< QString > bindableHello()
QML_ELEMENTQString hello
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
#define QML_ELEMENT
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SIGNALS
QJSEngine engine
[0]