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
2
votes
1 answer

Use QQuickView or QQmlApplicationEngine to switch between pages from ApplicationWindow

I'd like to use an ApplicationWindow as a main file and be able to switch to other QML files from C++ with QQuickView::setSource(const QUrl & url). Basically it would do this: start-up => loads main.qml (ApplicationWindow) => click on help button =>…
Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
1
vote
1 answer

QQmlApplicationEngine failed to load component when I'm trying to use external library (canlib) import

I'm constructing an application via Python as backend and QT QML as frontend. I use Win10, PyCharm 2022.3.1 (Community Edition), Pyside6 and QT Design Studio (not QT Creator). All libraries installed by pip using terminal or through PyCharm library…
1
vote
1 answer

"TypeError: Property 'someFunction' of object [object Object] is not a function" and "TypeError: Type error" when exposing C++ class to QML

I keep getting this error for some reason. Everything seems to work when I use this to pass a C++ class instance to QML. main.cpp: QQmlApplicationEngine engine; gui::Wallet wallet; engine.rootContext()->setContextProperty("Wallet", &wallet); But…
1
vote
1 answer

Error in getting the root object from QQmlApplicationEngine in Component.onCompleted

I try to get the root object after window having completed, but I get a error: QmlObj = self.engine.rootObjects()[0] Error: list index out of range The strange thing is that it works when I try to call foo.init_window() after the MouseArea having…
lxchx
  • 25
  • 5
1
vote
0 answers

trying to communicate arduino to pc via qserialport

to connect arduino to PC after creating a qtquick based application, I created arduino.cpp and arduino.h files. There is something wrong in the code but I can't get it and resolve it. Please, if someone can help, here are the .cpp and .h files. I…
1
vote
1 answer

How to find the source of a recursive rearrange in QML

I updated my QML application from Qt 5.12 to Qt 5.15. My application loads its qml sources using the following code: auto* engine = new QQmlApplicationEngine(this); ... engine->load(QUrl("qrc:/main.qml")); When engine->load is called, I now get the…
FourtyTwo
  • 1,616
  • 2
  • 15
  • 43
1
vote
1 answer

Is there any way to embed a QWidget inside a QQmlApplicationEngine or QQuickView?

I found a way to embed a QWidget in a QML, by using QQuickWidget render (anchoring, the QWidget with the QQuickWidget position), but I am trying to do the same using QQuickView/QmlApplicationEngine, which uses a different rendering system, and the…
laurapons
  • 971
  • 13
  • 32
1
vote
1 answer

QQmlApplicationEngine::loadData() works on DEBUG, but fails on RELEASE

(Qt 5.12.2( mingw 7.3 32-bit ) Windows 8 64-bit) The next code works on DEBUG, but fails on RELEASE mode: #include #include #include #include #include #include…
1
vote
1 answer

how to import a QML Component resource in a QML file

I have the following directory structure: ui/ |- resources.qrc |- qml/ |- main_window_presenter.qml |- MyPresenter.qml resources.qrc contents: qml/MyPresenter.qml
Alp
  • 553
  • 11
  • 30
1
vote
1 answer

Dynamically created Custom QML object not visible

I have a custom QML item called "Cell.qml" which I'd like to insert dynamically in my root window and make it visible. I also tried changing the z property, but I couldn't fix it, the object is still invisible (even tough the output of…
1
vote
3 answers

QML Image not displaying in Application

I am having trouble displaying a simple image into my application. Here's the main.py: import sys from PyQt5.QtQml import QQmlApplicationEngine from PyQt5.QtGui import QGuiApplication from PyQt5.QtCore import QObject, QUrl if __name__ ==…
HaR
  • 987
  • 7
  • 23
1
vote
0 answers

QML WebEngineView.runJavaScript failed to run HTML Java Script method

Work environment : Windows 7 64 bit, QT 5.8 64 bit, Compiler : VS2015 64 bit. Using WebEngineView I am loading HTML page, HTML have Script function function OnClick() { document.getElementById('txtName').value = "10"; } But Using…
Sandip
  • 51
  • 11
1
vote
1 answer

PyQt: How to get the root object from QQmlApplicationEngine

I try to display a dynamic object using PyQt and QML, But I get this error: win = engine.rootObjects()[0] IndexError: list index out of range Here is my code PyQt: import sys import os from PyQt5.QtWidgets import QApplication from PyQt5.QtQml…
karahman
  • 11
  • 1
  • 4
1
vote
1 answer

QtQml installation in Raspberry pi

I am stuck with one error while building PyQt5 for rasberry pi. I was successfully able to run the application which uses QQmlApplicationEngine on Windows Desktop. Now I wanted to run the same application in Raspberry pi 3. I build the PyQt5…
ryuk
  • 47
  • 2
  • 7
1
vote
3 answers

How does one change the model property of a TableView in qml from c++

I am relatively new to QT, so any help would be greatly appreciated! I am working on a Qt Quick Application, making use of the QQmlApplicationEngine for the UI. I made a subclass of QAbstractTableModel and implemented the necessary functions and…
thats_nice
  • 21
  • 4