MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / main

Function main

test/cli/QML-Samples-TableView/main.cpp:5–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "samplemodel.h"
4
5int main(int argc, char *argv[])
6{
7 QGuiApplication app(argc, argv);
8
9 QQmlApplicationEngine engine;
10 qmlRegisterType<SampleModel>("Test", 1, 0, "SampleModel");
11
12 const QUrl url(QStringLiteral("qrc:/main.qml"));
13 QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
14 &app, [url](QObject *obj, const QUrl &objUrl) {
15 if (!obj && url == objUrl)
16 QCoreApplication::exit(-1);
17 }, Qt::QueuedConnection);
18 engine.load(url);
19
20 return app.exec();
21}

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected