How to deploy when using Resource System? (Windows 10)
-
windeployqt Output:
D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release>windeployqt --release JACK-Tool.exe
D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release\JACK-Tool.exe 64 bit, release executable
Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
All dependencies : Qt5Core Qt5Gui Qt5Widgets
To be deployed : Qt5Core Qt5Gui Qt5Widgets
Unable to find the platform plugin.the .pro file contains:
RESOURCES += \
jack-ressourcen.qrc -
windeployqt Output:
D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release>windeployqt --release JACK-Tool.exe
D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release\JACK-Tool.exe 64 bit, release executable
Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
All dependencies : Qt5Core Qt5Gui Qt5Widgets
To be deployed : Qt5Core Qt5Gui Qt5Widgets
Unable to find the platform plugin.the .pro file contains:
RESOURCES += \
jack-ressourcen.qrc@Ijon_Tichi Usually resources are built into the executable, so it should work. See "Compiled-In Resources" in https://doc.qt.io/qt-5/resources.html
Can you show how you're using your resources?
Also, do you see any warnings when you start your app from cmd.exe? -
hello jsulm
i use a *.qrc (jack-ressourcen.qrc) over the Qt Creator
<RCC>
<qresource prefix="/images">
<file>ressourcen/jack-logo.jpg</file>
<file>ressourcen/Startbild.jpg</file>
<file>ressourcen/JACK-mittel.jpg</file>
<file>ressourcen/JACK-groß.jpg</file>
</qresource>
</RCC>in the source code i use the ressources
...
QImage imageLogo(":/images/ressourcen/jack-logo.jpg","JPG");
...
ui->label_imageLogo->setPixmap(QPixmap::fromImage(imageLogo));
...When i rum with Qt Creator (debug or relase) it works the imageLogo is displayed.
Whan i run from cmd.exe there ist no error, the program works, but the imageLogo is not shown.
A image, that i generate by QPainter thru the Program is shown, there no problem running from CMD :
...
QImage imageSchablone(2480, 3508, QImage::Format_RGB32);
...
// calculating the image
imageSchablone = aktSchablone.berechnen(aktuellerTonarm);
....
// show the image
// PixMapSchablone is a lable on the ui
ui->PixMapSchablone->setPixmap( QPixmap::fromImage(imageSchablone).scaledToHeight(900));
... -
I have testet with aditional images in the QRessource System.
The progam.exe get bigger, so i think the images are link into the program.... but the the images are not shown when i rum from cmd.exe
-
also show a image direct from file only work when run from Qt Creator (Debug or Release), wenn run from cmd.exe the image is not shown.
...
QImage imageStartSeite("D:\QT-Creator-Projekte\JACK-Tool\Startbild.jpg","JPG");
... -
also show a image direct from file only work when run from Qt Creator (Debug or Release), wenn run from cmd.exe the image is not shown.
...
QImage imageStartSeite("D:\QT-Creator-Projekte\JACK-Tool\Startbild.jpg","JPG");
...@Ijon_Tichi I think your problem is that you do not deploy your app properly before starting outside of QtCreator, so it can't find needed plug-in.
See https://doc.qt.io/qt-5/windows-deployment.html -
thanks jsulm,
yes, i readed this many time but i unterstand it not full, i am a beginner in Qt.
The windeployqt doesn't tell what plug-ins is needed.
Even when i copy all plug-ins folders into the working directory my jpg-files are not loaded.
Maybe there is a format problem to my jpg-filesI think, i have the needed plug-in to handle jpg, all I/O opterations (store, ..) with jpg that are calculated by the program works.
Wenn i use *.png images in the QRessource System it works fine, even from cmd.exe
So i have changed to the *.png format.to me it is all fine, further i use png format
thanks jsulm to your help
Ijon
-
thanks jsulm,
yes, i readed this many time but i unterstand it not full, i am a beginner in Qt.
The windeployqt doesn't tell what plug-ins is needed.
Even when i copy all plug-ins folders into the working directory my jpg-files are not loaded.
Maybe there is a format problem to my jpg-filesI think, i have the needed plug-in to handle jpg, all I/O opterations (store, ..) with jpg that are calculated by the program works.
Wenn i use *.png images in the QRessource System it works fine, even from cmd.exe
So i have changed to the *.png format.to me it is all fine, further i use png format
thanks jsulm to your help
Ijon
@Ijon_Tichi So, did you actually use windeployqt tool? It should copy the plug-in. Also, the plugins need to bi in a subdirectory as shown in the above link in an example:
The executable plugandpaint.exe The Basic Tools plugin plugins\pnp_basictools.dll The ExtraFilters plugin plugins\pnp_extrafilters.dll The Qt Windows platform plugin platforms\qwindows.dll The Qt Windows Vista style plugin styles\qwindowsvistastyle.dll The Qt Core module Qt5Core.dll The Qt GUI module Qt5Gui.dll The Qt Widgets module Qt5Widgets.dll
-
as i wrote in Post 1
i put
libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll
and the plugin folders
imageformats platforms printsupport styles
into the working directory.
but even when i copy all plug-in folders into the working directory there is the trouble with the jpg.
where can i find information, what plug-ins more than "imageformats" are needed to handle jpg?
as i wrote in post 2 i use the windeployqt tool, i have set the env (qtenv2.bat) bevor:
windeployqt Output:
D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release>windeployqt --release JACK-Tool.exe D:\QT-Creator-Projekte\build-JACK-Tool-Desktop_Qt_5_14_0_MinGW_64_bit-Release\JACK-Tool.exe 64 bit, release executable Direct dependencies: Qt5Core Qt5Gui Qt5Widgets All dependencies : Qt5Core Qt5Gui Qt5Widgets To be deployed : Qt5Core Qt5Gui Qt5Widgets Unable to find the platform plugin.
searching to the error message "Unable to find the platform plugin", i doesn't found a solution
I thing the ressource system work fine. By using png format it works fine.
-
@Ijon_Tichi said in How to deploy when using Resource System? (Windows 10):
Unable to find the platform plugin.
To solve the problem with the windeployqt i downloaded the windeployqt64releaseonly.exe from here: http://tripleboot.org/Uploads/windeployqt64releaseonly.zip
Discussion here:
https://forum.qt.io/topic/109779/windeployqt-exe-comes-with-qt-5-14-not-copy-the-dlls-to-the-app-directory/8