Is it possible to load QtCharts library with only QML without Qt/C++?
-
Hi, I am a newbie in Qt/QML and need some help. As the title says, is it possible to load QtCharts library with only QML without Qt/C++ stuff? I need to develop a UI application with a chart using QML. This application runs on an embedded system on the client side. I have compiled the QtChart project as a static or shared library, but I can't get this library to work. When I try to import a static library (libqtchartsqml2.a), I get the error message "module "QtCharts" is not installed import QtCharts 2.1 ^". The libqtchartsqml2.a file is located in the path specified in the importPaths configuration, as described here. When I try to import a shared library, the application crashes with a trace, but I can't figure out what the problem is. Does anyone have a suggestion on how I can load a static or shared library into QML? I can post the trace here, but it is about 90 lines long.
-
Hi, I am a newbie in Qt/QML and need some help. As the title says, is it possible to load QtCharts library with only QML without Qt/C++ stuff? I need to develop a UI application with a chart using QML. This application runs on an embedded system on the client side. I have compiled the QtChart project as a static or shared library, but I can't get this library to work. When I try to import a static library (libqtchartsqml2.a), I get the error message "module "QtCharts" is not installed import QtCharts 2.1 ^". The libqtchartsqml2.a file is located in the path specified in the importPaths configuration, as described here. When I try to import a shared library, the application crashes with a trace, but I can't figure out what the problem is. Does anyone have a suggestion on how I can load a static or shared library into QML? I can post the trace here, but it is about 90 lines long.
@utestrauss
Unfortunately I never tried to add QtCharts as static shared library.I do the following in embedded yocto projects, maybe this helps you:
- add QT += charts to .pro file
- replace QGuiApplication with QApplication in main.cpp
-> required by QtCharts - add qtcharts to yocto local.conf, rebuild embedded image and install it to the device
IMAGE_INSTALL_append = " [... other used libraries ...] \ qtvirtualkeyboard \ qtcharts \ "
Note: qtcharts creates 3 packages for the embedded OS with a total of about 0.5MB:
libqt5charts
libqt5charts-plugins
libqt5charts-qmlplugins -
@lemons Thanks for the guide. I have a slightly different use case. Unfortunately I can't access the C++ side, I only work with QML files. At least I found a QML implementation of a chart library and try my luck with that.
Anyway, it would be great if someone writes how to make QTCharts work with QML only.
-
@lemons Thanks for the guide. I have a slightly different use case. Unfortunately I can't access the C++ side, I only work with QML files. At least I found a QML implementation of a chart library and try my luck with that.
Anyway, it would be great if someone writes how to make QTCharts work with QML only.
@utestrauss I used this library, It is very simple, it depends what you need.
https://github.com/qyvlik/Chart.qml. It is only qml (js) -
@piervalli Thanks, I use this library too. However, I wanted to use something more solid.
@fcarney I can't tell exactly how the client's embedded system works, but yes, I am able to write UI using QML only. After deploying to the embedded system, it will be loaded and executed by QGuiApplication. At least in the trace I mentioned in the topic, I see Qt classes listed.
-
I am very confused by this thread. How do you use QML without C++? Ultimately you will find something that cannot be done and have to use C++ to solve the problem. Are there build systems that don't even have you compile the main.cpp?