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
src_qmltest_qquicktest.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5// src_qmltest_qquicktest.cpp
6#include <QtQuickTest>
7#include <QQmlEngine>
8#include <QQmlContext>
9#include <QGuiApplication>
10
11class Setup : public QObject
12{
14
15public:
16 Setup() {}
17
18public slots:
20 {
21 // Initialization that only requires the QGuiApplication object to be available
22 }
23
25 {
26 // Initialization requiring the QQmlEngine to be constructed
27 engine->rootContext()->setContextProperty("myContextProperty", QVariant(true));
28 }
29
31 {
32 // Implement custom resource cleanup
33 }
34};
35
37
38#include "src_qmltest_qquicktest.moc"
\inmodule QtCore
Definition qobject.h:103
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
\inmodule QtCore
Definition qvariant.h:65
void qmlEngineAvailable(QQmlEngine *engine)
void applicationAvailable()
#define Q_OBJECT
#define slots
#define QUICK_TEST_MAIN_WITH_SETUP(name, QuickTestSetupClass)
Definition quicktest.h:58
QJSEngine engine
[0]