Image on showing on another PC's
-
Hi,
I have a problem with showing picture in form in app. On my pc (pc where I am developing app) everything works fine, but when i tried on another pc no picture show. Here is what i tried:
- with the code:
QPixmap pixmap = QPixmap ("logo.JPG"); //i also tried QPixmap (":/logo.JPG"); //and QDir::currentPath() + "logo.JPG" ui->Logo->setPixmap(pixmap); ui->Logo->setScaledContents(true);
- In the form editor,
I tried (in the Qlabel options) set pixmap choose resourse, but it no working, so i tried choose file but the same result.
On testing machine is in the same folder (as *.exe file) the picture.
In the project.pro is resource file and in resource file is linked image. I tried also run qmake but still same result. Any idea?
-
Hi,
I have a problem with showing picture in form in app. On my pc (pc where I am developing app) everything works fine, but when i tried on another pc no picture show. Here is what i tried:
- with the code:
QPixmap pixmap = QPixmap ("logo.JPG"); //i also tried QPixmap (":/logo.JPG"); //and QDir::currentPath() + "logo.JPG" ui->Logo->setPixmap(pixmap); ui->Logo->setScaledContents(true);
- In the form editor,
I tried (in the Qlabel options) set pixmap choose resourse, but it no working, so i tried choose file but the same result.
On testing machine is in the same folder (as *.exe file) the picture.
In the project.pro is resource file and in resource file is linked image. I tried also run qmake but still same result. Any idea?
@xbasista
If you useQPixmap pixmap = QPixmap ("logo.JPG");
it will only work if you properly deploy on another computer, so that external file is in the right place to be found.If you use
QPixmap (":/logo.JPG");
that will not require an external file on target machine, the file should be properly compiled into executable's resources. You need to give more details as to why you say this is not working.If your "testing machine" is not a development machine just like your original machine where it works, you need to deploy a Qt application to make it work correctly, e.g.
windeployqt
. -
Hi,
This means that you did not deploy the image format plugins correctly or not completely.