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
main.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QGuiApplication>
4#include <QtQuick>
5
6#include "myclass.h"
7
9int main(int argc, char *argv[]) {
10 QGuiApplication app(argc, argv);
11
12 QQuickView view(QUrl::fromLocalFile("MyItem.qml"));
14
15 MyClass myClass;
17 &myClass, SLOT(cppSlot(QString)));
18
19 view.show();
20 return app.exec();
21}
23
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
\macro qGuiApp
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
The QQuickView class provides a window for displaying a Qt Quick user interface.
Definition qquickview.h:20
QQuickItem * rootObject() const
Returns the view's root \l {QQuickItem} {item}.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Definition qurl.cpp:3368
void show()
Shows the window.
Definition qwindow.cpp:2254
int main()
[0]
#define SLOT(a)
Definition qobjectdefs.h:52
#define SIGNAL(a)
Definition qobjectdefs.h:53
QGraphicsItem * item
QApplication app(argc, argv)
[0]
QQuickView * view
[0]