Images from .qrc file aren't showing after relocating an executable in Windows
Solved
Installation and Deployment
-
Hi, I have an issue with showing images from a resource file.
When I relocate the file, add some .dll files, the images dissapear, and the theme is different.
Example images:
In Qt creator:
Outside of Qt creator:
Maybe it's deployment issues, but I don't know.
My .pro file:QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ additionalinfogetter.cpp \ courses.cpp \ keymappingscolor.cpp \ main.cpp \ mainwindow.cpp HEADERS += \ additionalinfogetter.h \ courses.h \ keymappingscolor.h \ mainwindow.h FORMS += \ courses.ui \ keymappingscolor.ui \ mainwindow.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ pictures.qrc
My .qrc file:
<RCC> <qresource prefix="/hands"> <file>handRight.jpg</file> <file>handLeft.jpg</file> </qresource> </RCC>
Note: This only happens in Windows.
EDIT: Here are the contents of my folder:
ATFinQt
└──ATFinQt.exe
└──libgcc_s_seh-1.dll
└──libstdc++-6.dll
└──libwinpthread-1.dll
└──Qt5Core.dll
└──Qt5Gui.dll
└──Qt5Widgets.dll
└──platforms
ㅤㅤ└──qdirect2d.dll
ㅤㅤ└──qminimal.dll
ㅤㅤ└──qoffscreen.dll
ㅤㅤ└──qwindows.dll -
You forgot the imageformats plugin subdirectory.
-
This post is deleted!
-
@Christian-Ehrlicher thanks, that worked.
Also, copying the styles folder gave me the theme back.
Thank you :D