Questions tagged [qqmlapplicationengine]

QQmlApplicationEngine is a class from the Qt Toolkit which provides a convenient way to load an application from a single QML file.

Documentation can be found here (Qt5).

67 questions
32
votes
2 answers

What is the difference between QQmlApplicationEngine and QQuickView?

I'm using QQmlApplicationEngine as follows: QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); app.exec(); But now I want to enable multisampling for my app, and…
Stefan Monov
  • 11,332
  • 10
  • 63
  • 120
13
votes
7 answers

QQmlApplicationEngine failed to load component : "Type" is not a type

I'm having trouble loading one qml through another. Basically, I have created a qml type MyTabView in MyTabView.qml: import QtQuick 2.3 import QtQuick.Controls 1.2 TabView { width: 360 height: 360 Component.onCompleted: { …
bourne
  • 1,083
  • 4
  • 14
  • 27
7
votes
4 answers

QML Loader ... How to unload or delete a qml page loaded on to Loader element

I have loaded MyItem.qml as a source component onto Loader element. Now i want to remove or unload that page from Loader element. I tried to set source : "" & sourceComponent : "" , also sourceComponent : "undefined". But it did not work
Bupa
  • 217
  • 1
  • 3
  • 7
7
votes
1 answer

How to connect PyQt5 pyqtSlot to QML ListView signal "activated"?

I would like to connect the activated signal from a QML ListView to a pyqtSlot decorated method from my Python3/PyQt5 (5.6) code. My current approach is to load the QML scene in my code through QQmlApplicationEngine and then use findChild() to get a…
Fladi
  • 177
  • 1
  • 11
7
votes
2 answers

QML UnitTest missing C++ context property

I found this older post which faces the same problem: How to mock a QML component Unfortunately, there's no solution. To recap the problem: I have a QML TestCase which imports a module. But this module relies on a root context property which…
user4672929
6
votes
3 answers

Properly reloading a QQmlApplicationEngine

I have a QML-based app that loads a main.qml file from the file system like this: myEngine->load("main.qml"); This works fine, but I'd like to "reload" the engine in case the main.qml was replaced with a newer version. What I tried so far was…
BastiBen
  • 19,679
  • 11
  • 56
  • 86
4
votes
1 answer

Error: QQmlApplicationEngine failed to load component

I try to register a type, but I'm getting this error: QQmlApplicationEngine failed to load component qrc:/main.qml:5 module "Komut" is not installed This is the code I'm using: QQmlApplicationEngine…
oksidez
  • 71
  • 1
  • 1
  • 7
3
votes
1 answer

Why does not QQuickWindow->close() remove the object from rootObjects?

I am trying to switch between different QML files from C++. I use a QQMLApplicationEngine and I can load a new file using engine.load(filename) Before I do this I close the current Window (QQuickWindow) using QObject* pRootObject =…
3
votes
1 answer

I got errors: "QQmlApplicationEngine failed to load component" and "qrc:/main.qml:-1 File not found"

I created a Qt Widgets application, then added a qml named "main.qml" to it. My files are dialog.cpp, dialog.h, dialog.ui, main.cpp, untitiled9.pro, main.qml in qml.qrc main.cpp: #include "dialog.h" #include #include…
Peter Zhang
  • 61
  • 1
  • 8
2
votes
1 answer

QtQuick colour palette for disabled widgets

I am working on a Qt (QML) application that requires darker color palette. Based on some examples I created a qtquickcontrols2.conf file with the following…
matejk
  • 798
  • 1
  • 14
  • 27
2
votes
1 answer

QML components collision test method

Well, there may be many QML programs in which if two components collide with each other the programmer defines an action based on that. In such programs as the one below, we want to concentrate on that collision and try to know how to define a…
Franky
  • 1,181
  • 2
  • 11
  • 33
2
votes
1 answer

QQmlApplicationEngine does not accept correct QML when project is built with CMake in CLion

I've got very simple correct Qt QML project written and built with Qt 5.9.1 and qmake that runs well. But I want to use CLion to edit c++ code, so I created CMake project configuration as described in many tutorials in Internet. Building is going…
koldoon
  • 161
  • 2
  • 9
2
votes
0 answers

QML Image is Loaded From Source After a LONG Delay

I am developing an Qt Quick Application where I am serving "main.qml" file over network: QQuickView vv; vv.engine()->setNetworkAccessManagerFactory(new MyFactory()); vv.setSource(QUrl("http://192.168.1.101/main.qml")); vv.showFullScreen(); main.qml…
Muhammet Ali Asan
  • 1,486
  • 22
  • 39
2
votes
0 answers

QML Extension Plugin

How do we use the dll file created by QML Extension Plugins? The link regarding dll file creation, doesn't give enough information about how do we exactly use the dll file in other projects (Qt Quick applications). A simple example on this with step…
2
votes
1 answer

Qt: How does QGuiApplication and QQmlApplicationEngine interact?

I am trying to understand the underlying magic behind Qt. It seems that I am missing an important concept in how QML and C++ interact. In the following "Hello World" demo, the most basic, an app is declared, an engine is declared, then an app is…
Makketronix
  • 1,389
  • 1
  • 11
  • 31
1
2 3 4 5