1
votes

When I launch my deployed application from the .exe file the layout is messed up. When I launch the app from Qt Creator, the layout is fine.

Here are the details about how I deployed my app. I am using Qt 5.5 and MinGW 32 bit 4.9.2. I am running Windows 10.

First in Qt Creator I built for release.

Next, I opened the Qt 5.5 for Desktop (MinGW 4.9.2 32 bit) console.

I navigated to my project folder and ran

windeployqt.exe --release ./APPNAME.exe

It copied all the necessary .dll and created some folders as expected.

Now when I run the app, it seems to work just fine. But the layouts are all wrong. Again, when launching the app from Qt Creator it looks great! Proper spacing and sizing of my widgets. When I launch the .exe every thing is smooshed, the ratios of my sliders are all wrong, and some text is hidden because of crowding.

What could cause this bad layout? Am I missing some dependency somehow?

1
It is possible to have a great looking gui in the qt designer and all messed up in the app if the widgets are not properly layouted. Did you layout everything in a grid after placing the items? Does the resizing behave well in the qt designer preview or when you launch from qt creator?Aaron
Everything is in a grid. Resizing works well. Launching from the Qt Creator the layout works great on both my mac and the Windows computer I'm building this for. Also when I do a release build on my mac, and launch it, I have no problems. Today I will try making changes to the layout and see how that affects the deployed .exeAKstat

1 Answers

0
votes

I figured out my own question. The issue was not my build or my layout but that many sizePolicy parameters don't seem to take effect when launching the app from QtCreator. Not 100% sure on the explanation but I think that when launching the .exe the OS is managing interpreting some of those size policy parameters and it does it differently (perhaps more strictly it appears) than QtCreator does. (To be clear I'm not talking about how the app looks in the Design tab. I'm actually talking about launching the app from within QtCreator)

So to fix the appearance of the app I have to play around with the size policies and parameters, build, and then launch the app from the executable.