premroxx
29th August 2011, 01:38
Hello,
I have built a gui, using some jpegs for background images(set using pixmap property in Qt creator). It run fine in the Qt creator. But, when i tried to execute the exe(i have copied all the missing dll's it asked for), it seems to work fine but does not display the images. I looked through lots of similar posts & here is what i have tried so far.
a)
I have configured it statically
configure -static -qt-libjpeg
nmake
b)
I have tried to add images using resource editor, instead of loading them directly from a folder.
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/begin1.jpg</file>
<file>images/emerg.jpg</file>
</qresource>
</RCC>
i have placed my jpegs in the 'images' folder(which i copied into the folder where my exe & qrc is located). I have also created an 'imageformat' folder which has the 'qjpeg4.dll' file
c) i have edited my pro file
CONFIG += static
RESOURCES = interface.qrc
& my mainwindow.cpp -> Q_INIT_RESOURCE(interface);
d)
I took a detour & tried using Qt plugins, but i had a link error. So i gave up on that.
As, far as using the jpegs in my program, here is an example:
this->ui->label_begin->show(); (label_begin's pixmap property loads begin1.jpg)
Can you please point out the error i'm making? Thanks in Advance. If i hadn't given you enough information, do let me know as of what else you might need.
Prem.
I have built a gui, using some jpegs for background images(set using pixmap property in Qt creator). It run fine in the Qt creator. But, when i tried to execute the exe(i have copied all the missing dll's it asked for), it seems to work fine but does not display the images. I looked through lots of similar posts & here is what i have tried so far.
a)
I have configured it statically
configure -static -qt-libjpeg
nmake
b)
I have tried to add images using resource editor, instead of loading them directly from a folder.
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/begin1.jpg</file>
<file>images/emerg.jpg</file>
</qresource>
</RCC>
i have placed my jpegs in the 'images' folder(which i copied into the folder where my exe & qrc is located). I have also created an 'imageformat' folder which has the 'qjpeg4.dll' file
c) i have edited my pro file
CONFIG += static
RESOURCES = interface.qrc
& my mainwindow.cpp -> Q_INIT_RESOURCE(interface);
d)
I took a detour & tried using Qt plugins, but i had a link error. So i gave up on that.
As, far as using the jpegs in my program, here is an example:
this->ui->label_begin->show(); (label_begin's pixmap property loads begin1.jpg)
Can you please point out the error i'm making? Thanks in Advance. If i hadn't given you enough information, do let me know as of what else you might need.
Prem.