I have developed my Application with most of the Widgets
in Qt Creator's Designer
module.
I have hard coded the sizes of my widgets
depending on how they appeared on my laptop. Yesterday when I ran the application on my Desktop (lower screen resolution than laptop) some of the Main Window
widgets
were not visible & on startup there was horizontal scrollbar
& I had to scroll to see those widgets
; which is not the case on my laptop.
I have 2 problems:
Is it possible to resize all of my widgets (even those which are added run time by code) by using some
resize factor
? Maybe at startup I will get the screen resolution of Hardware in which application is running & then create a ratio of that with resolution of my laptop. Is it possible to multiply this factor to all widgets without adding code for each widget?How do I get the resolution of the Screen in which my Application is running?
PS: I would like to know the defacto method of solving this problem... Thank You.