Qt5 QML error QtQuick QtGraphicalEffects is not installed - qt

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.

Related

Using GraphicalEffects in PySide6

I am using PySide6 and am trying to use the GraphicalEffects module.
As per documentation here:
https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html
I am doing:
import Qt5Compat.QtGraphicalEffects
The error I am getting:
"Qt5Compat.QtGraphicalEffects" is not installed
How do I install this module? I have PySide6.2.2.1 installed on my Linux machine.
Its a known issue when installing from pypi. It will be fixed in pyside 6.4.
You can also build from source and it will be added automatically if you installed it with Qt-online installer.
An alternative would be to copy the module from the root directory and include it in the development environment.
Here is a more detailed description: QT6.4 QML PYTHON module "Qt5Compat.GraphicalEffects" is not installed
Works with Pyside6 or PyQt6.

"QtQuick.LocalStorage" is not installed

i'm using localStorage for saving user Settings :
import QtQuick.LocalStorage 2.0
i get this error while compiling it :
module "QtQuick.LocalStorage" is not installed
Swapping kits to the 5.6.3 one resolves this error.
I Removed Content of Debug Folder and then 'run Qmake' and then Build was successful and no errors at all (i changed to 5.11 and 5.8 with no result)
sudo apt-get install qml-module-qtquick-localstorage

windeployqt module QtQuick not installed [duplicate]

This question already has answers here:
Deploy Qt5 QML application
(8 answers)
Closed 4 years ago.
Im trying to deploy a set of QT applications. On linux all applications works fine after installing all dependencies, but in windows QtQuick based applications doesn't work at all.
To deploy on windows I follow this steps:
Compile my project in release mode.
Add mingw to the system environment path
Run windeployqt.exe --release c:\myappdir\relesase\myapp.exe
When step 3 is finish I got a lot of dlls in the release folder Qt5Quick.dll among them. But myapp.exe doesn't work and didn't threw any error.
In order to get any extra information I add console to my CONFIG parameter under myapp.pro file and running myapp.exe by console I got this info:
QQmlApplicationEngine failed to load component
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:-1 module "QtQuick" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
My version of QtSDK is 5.10.0 with MinGW so this solution doesn't work at all, I got more errors.
More over if I try to run myapp.exe without those dll in the root folder it works fine.
I been the whole day trying to find any solutions but nothing seems to work.
I'm pretty sure I missing something but I don't know whats is it.
Thanks
As I suppose, I was missing something. --qmldir option is needed in order to add QtQuick modules.
windeployqt.exe --qmldir . --release c:\myappdir\relesase\myapp.exe
That line did the trick,
Thanks #frank osterfeld and #Felix

Where can I download qmlscene for Ubuntu

MMMMMM#unbuntu:~/QT/test4Qml$ qmlscene main.qml
qmlscene: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmlscene': No such file or directory
My Qt Development Environment does not have qmlscene. I googled it, and I only found *.deb. How should I do it?
As far as I know, Qt is not installed by default in /usr/lib/x86_64-linux-gnu/qt4. That directory is the default path when linux detects a dependency which requires Qt.
Where did you installed Qt? How did you installed it? Did you set the PATH environment variable to where Qt binaries are installed?
Usually, you have to follow the next steps:
1.- Install the the basic requirements for building Qt applications.
2.- Download Qt. I recommend Qt 5 using an offline installer. Otherwise, you'd need to compile from the source. Here you have a list of older versions of Qt.
3.- Set the environment variable PATH to the directory where you Qt bin directory is installed.

How to install QtDesigner?

I just installed Qt 5.4.1 on Windows 7. And there is no QtDesigner. Also there is no QtDesigner in MaintenanceTool.
How can I install it?
You can install and find QT Designer as follows (Windows environment):
Install latest QT (I'm using 5.8) from QT main site
Make sure you include "Qt 5.8 MinGW" component
QT Designer will be installed in C:\Qt\5.8\mingw53_32\bin\designer.exe
Note that the executable is named "designer.exe"
UPDATE - there is an easier way to install QT Designer without downloading GB's of data from QT:
Install the latest version of "pyqt5-tools" using pip install pyqt5-tools --pre
The "designer.exe" will be installed in ...Lib\site-packages\pyqt5_tools
If you are on macOS and use brew you may have installed qt already using brews installer.
In that case you already have QT Designer installed even though it is not mentioned anywhere.
You can find it here: /usr/local/Cellar/qt/<qtversion>/libexec/Designer.app
So to place it in your local apps folder you can create a symlink to it like this:
ln -sf /usr/local/Cellar/qt/5.11.1/libexec/Designer.app ~/Applications/.
Install QtDesigner on windows:
https://build-system.fman.io/qt-designer-download
install designer on Linux:
It can be installed using the apt package manager
sudo apt-get install python-qt4 qt4-designer
run the command designer and it will work for you
if it doesn't try /usr/bin/designer
it worked for me
i am using python 3.6 with pyqt-5.16
It is there. Create a form, click on the .ui file and it opens automatically.
Install the latest version of "pyqt5-tools" using pip install pyqt5-tools --pre
Then run the command (designer.exe) then you are good
pip install pyqt5-tools
refer: https://pypi.org/project/PyQt5Designer/
run the following commands in the given sequence
pip install PyQt5Designer
designer.exe
then press Enter. This opens Qt Designer window.
Expanding StonyBoy answer.
If you are on macOS, you have installed Qt5 with brew, and you want to access the Qt5 Designer app via command line (like on Linux), you can set a symlink to the actual executable as well, like this:
ln -sf /usr/local/Cellar/qt/5.13.1/libexec/Designer.app/Contents/MacOS/Designer /usr/local/opt/qt/bin/designer
This way, the designer command will be placed in the bin folder, together with the other Qt5 executables (as qmake). Thus, you will be able to launch it simply by typing designer in your shell.
Note: of course you must have the path of the Qt5 bin/ folder added to your PATH environmental variable, for being able to directly call designer in the shell. But brew added it for you when you installed Qt5.
I got pyqt5 installed along with the tools when I pip install pyqt5-tools. If you prefer PySide2, qt-tools will work better. You can emulate a "dry-run" by creating a fresh, disposable virtual environment to test on. Obvious, I know, but I use them infrequently enough that it takes me a while to remember sometimes :)
As of January 2023, the official Qt website does not provide Qt Designer as a standalone Application. Qt Designer can be obtained from:
Official source
Qt Creator + Qt base package
Offline installer for Qt Creator (Qt account required, has integrated Designer)
Qt base package
Online installer (Qt account required)
Custom Installation, select component
Qt-->{Qt Version of choice}-->{Architecture (usually MSVC 64-bit / Mingw64)}
aqtinstall (NO account needed)
In all official installations, the standalone designer.exe is located in the Qt bin folder (for Windows usually C:\Qt\{Version}\{Architecture}\bin).
Third party standalone applications
(potentially outdated)
https://github.com/mherrmann/fbs
(small file size)
From PyPi via pip
pyqt6-tools, pyqt5-tools, pyqt-tools, PyQt5Designer
For Qt newcomers, using Designer in Creator may be the better choice as it is very straightforward. Advanced users looking to set up a custom build infrastructure may be interested in aqtinstall instead.
I found it here:
..\Lib\site-packages\qt5_applications\Qt\bin

Resources