I'm running Qt 5.12 on ubuntu 20.04.3. Qt software components are installed with apt. My C++ application uses Qt DataVisualization . I've installed these apt packages for DataVisualization:
libqt5datavisualization5-dev
qml-module-qtdatavisualization
The app compiles OK, but the runtime cannot find the qml module. My qml file contains this import statement as specified by Qt documentation:
import QtDataVisualization 1.15
But at runtime I get the error:
QQmlApplicationEngine failed to load component
qrc:/main.qml:6 module "QtDataVisualization" version 1.15 is not installed
I get a similar runtime error if qml has "import QtDataVisualization 1.14".
Can someone help please? Thanks!
This page indicates that DataVisualization 1.2 should be imported for Qt 5.12 applications - this resolves my issue.
Related
I am using Qt 6.4.1, and in QtCreator I am trying to import the Qt6 Multimedia module, but I get the following error:
The error says "Found package configuration file: C:/Qt/qt/6.4.1/mingw_64/lib/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find required Qt component "Multimedia". Expected config file at "C:/Qt/qt/6.4.1/mingw_64/lib/cmake/Qt6Multimedia/Qt6MultimediaConfig.cmake" does NOT exist"
It appears my Qt version does not have the folder in my cmake directory:
Why is this? Have I missed something/got something wrong or is there no support for the Multimedia module in Qt6.4.1? What can I do to import this module? Thanks in advance.
You need to check QtMultimedia in QtMaintenanceTool when you are installing Qt. See the screenshot:
If it is not available for your compiler, then you have no other option than build Qt with QtMultimedia on your own.
I'm running the official Qt 5.5 SDK on Ubuntu 15.10 and trying to play 3D sounds in QML:
import QtAudioEngine 1.0
The project file:
qt += multimedia
The import statement results in qrc:///Main.qml:1:1: module "QtAudioEngine" is not installed. I'm a bit confused as I can see that the needed libs are in the SDK. What might be wrong here?
It's a bug in the official Qt SDK : https://bugreports.qt.io/browse/QTBUG-51567
Yesterday I installed Qt 5.4 on my windows 7 PC. But I can not build and run any Qt project including those given in Examples section on the Welcome page of Qt Creator 3.3 except for a few. Also, I can’t run any qml file either using this command from cmd: “qmlscene myqmlfile.qml”
Please note that I have added this path to my environment variables:
C:\Qt\Qt5.4.0\5.4\mingw491_32\bin
and Qt installation directory is
C:\Qt
The error message I get in the output window in Qt creator, and in console when running a qml file from cmd, is as follows:
QOpenGLShaderProgram::uniformLocation( qt_Matrix ): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
""
Previously, I used PyQt5, and ran qml files using the command
qmlscene myqmlfile.qml
without any problem. Then installed Qt Creator 3.3 to run Qt projects, but failed (got some error saying problem in qmake). Finally I uninstalled PyQt5 and Qt Creator 3.3, downloaded Qt 5.4 and installed it, but still could not run Qt projects.
I found in some website, that I need open GL 2.0 to run Qt projects in Qt 5.4. How do I make sure that I have openGL 2.0? (I checked with GPU-Z and it shows my shader model 2.0 and I don’t know if it has anything to do with OpenGL :( )
Please help me correct whatever is wrong with my Qt installation. This is freaking annoying.
Make sure you have Intel Graphics Driver installed from Intel. Microsoft's default drivers do not include OpenGL support.
After successful compilation of project, I have get an executable file.
When I type ./program in result I see:
QML Error: qrc:///qml/main.qml:25:1:module "QtGraphicalEffects" is not installed
qrc:///qml/main.qml:24:1:module "QtQuick" is not installed
I'm using QtQuick 2.0, Qt5 and Ubuntu, QtQuick and QtGraphicalEffects are in ~/Qt5.0.2/5.0.2/gcc/qml/ I have install fresh Qt SDK from site project.
I have tried run this application also on Windows 7 but with the same result.
Could anyone help?
This is because Windows or whatever OS you use doesn't know the location of Qt install directory and it can't find the QML plugins sub-dir when you run app outside QtCreator.
You have to take the following directories from your SDK install and copy them beside your executable (and DLL) :
<SDK install path>/<Qt version>/<compiler name>/qml/QtQuick.2
<SDK install path>/<Qt version>/<compiler name>/qml/QtGraphicalEffects
And it should work fine.
Just make sure to have the package installed
I see you mentioned about Ubuntu, if using 14.04 , you can install it by typing this command line :
sudo apt-get install libqt5qml-graphicaleffects
And if it's not found it you can still look for package name on debian based distros :
apt-file search 'qml/QtGraphicalEffects/qmldir'
libqt5qml-graphicaleffects: /usr/lib/x86_64-linux-gnu/qt5/qml/QtGraphicalEffects/qmldir
I had the same problem with Qt5.8.0 and QtCreator 4.2.1 the import QtGraphicalEffects 1.0 was underlined because the module not found!
I added in the .pro file my path to the QtGraphicalEffects 1.0
QML_IMPORT_PATH += /opt/Qt5.8.0/5.8/gcc_64/qml/QtGraphicalEffects
After that it started working!
You can also add this to the "Build Environment" at the project page if the previous setting does not solve your problem. And restart QtCreator.
I'm trying to re-build Qt 4.8.0 in Windows statically. I'm following the documentation here: http://doc.qt.nokia.com/4.8-snapshot/deployment-windows.html. After typing config -static in a mingw terminal at C:\QtSDK\Desktop\Qt\4.8.0\mingw, I get the following error:
Running syncqt...
I couldn't find a pro file for QtCore module
syncqt failed, return code 2
I've been looking all over and can't figure out where to go from here! IMO the Qt documentation is not very good in this regard.
Thanks!
Marlon