Search code examples
pythonpython-2.7pyqtpyqt4

app is showing widget at the wrong size when executed on another computer


I have a bit of mistery here regarding the rendering of a PyQt4 app on two different computers. I have check a number of internet sites and even this one Overlapping controls in Windows XP and I haven't found the solution.

The problem is as follow. The app written in python27 and pyqt4 and is run on two identical laptops running Windows 10 with additional screen connected of the same resolutions, one was used to develop the app and the second is used simply to run a copy of the app. All the necessary python packages are installed in order to run the app:

  • The app contains a tabwidget set in main window grid-layout and share it with a qtextedit at the bottom.
  • On the second laptop the first and second tab of the tabwidget are displaying wrongly the widgets it contains such as this way:

enter image description here

  • On the development laptop it is displayed this way:

enter image description here

Changing the window size does not solve the problem. So where could the problem be? Idea are welcome !!!!

Note 1: the 1st and 2nd tab of the tabwidget are not setup with a layout but individual object such as group box are setup with a layout.

Note 2: There is a third tab that is dynamically filled by the app with custom widgets on a vertical layout. This tab do not exhibit any shrinking/overlap/oversized issues. Could this be the solution, and why?

Regards.


Solution

  • finally I found out what was the problem. One of the laptop had its screen set to 150% scaling and apparently Qt4 doesn't handle it well. So to make it right the screnn scaling should be 100%.

    One thing to notice though is that the scaling used by Qt4 is the one used at startup and is ignoring the session settings. In other words and in my case, my interface was wrongly displayed and changing the scaling to 100% and restarting the application didn't help. However changing the scaling to 100%, restarting Windows10 and starting the application was not causing any problem. Even changing the scaling after the restart didn't cause any problems since only the value at startup time is considered.

    I guess this item can now be closed.