Solved Fullscreen mode is not working properly with deployed .exe app
-
I have very simple app in which there are two buttons and one edit line. These buttons have images as background. The main window also has an image as its background with a shortcut to allow the user to change the background. The app must run in fullscreen mode. The code works just fine but when I run the code (i.e. standalone or shipped with Dlls) in another PC, the fullscreen mode destroys the GUI. This is a snapshot from the problem.
while if I run the same code in the machine that generates this app, the result is
The functionality of the app works in the other machine, I've tested with the shortcut to change the background. Changing the image background while the app runs works fine, really weird.
This is part of the code
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setWindowState(Qt::WindowFullScreen); }
For the MainWindow, this is the stylesheet
QWidget#MainWindow{ border-image: url("123.PNG") }
And this is the form design with Qt Creator.
What may cause this kind of behavior and what is the suggested solution(s)? I'm using Qt 5.9 and tried Qt 5.8, in Windows 10. I'm using Visual studio 2015 and 2013 in the other PC.
-
Hi, just guessing but it might be due to some differences in the graphics cards or their drivers. Do your 2 PCs have the same graphics card? If not, try to update the graphics drivers on the failing one...
-
@hskoglund
While the graphics cards are indeed different, I don't think this is the issue. I've run it in several PCs other than mine with the same problem. I suspect the fullscreen mode functionality but I'm not sure. -
@CroCo Do you use layouts to position the widgets?
-
@CroCo ,
I thinks, you have missed to add imageformats dll's.
-
@jsulm yes indeed. But I also set a grid layout on the background so that the contents will not be destroyed in case resizing the window. The code works perfect but the deployed app is not working. See the update for the actual form.
-
@Vinod-Kuntoji what do you mean?
-
@CroCo ,
In non Qt systems, If you want to run your project, you should provide required imageformats dlls. -
@Vinod-Kuntoji interesting. Can you provide more info regarding which dlls I need to ship the deployed app with and where can I find them? Also, is there any option(s) to tell the qmake to add these dlls in case building standalone apps? Thank you.
-
Copy the imageformats folder and put it in your executable folder.
C:\Qt\Qt5.7.0\5.7\msvc2013_64\plugins\imageformats -
@Vinod-Kuntoji I've placed all the dlls but no luck. I'm using .png format though.