Rescale the mainwindow and its contents to fit in different screens
-
wrote on 9 Feb 2015, 16:08 last edited by
Hi guys,
I am new to Qt. I have developed an application using Qt widget Application. In Mainwindow class I have several tablewdigets and textEdit and etc. In my computer it looks good (since I have used the designer to create the GUI). However, I want to port my application to Android. Since the screen size is different, I just want to know, how I should scale the whole mainwindow and its contents to occupy X% and Y% of any screen? I know I can use QWdiget::resize() function to resize my mainwindow but as expected the contents of my mainwindow remain fixed after scaling, how can I change their sizes as well?
Thanks a bunch.
-
wrote on 9 Feb 2015, 21:41 last edited by
No reply for this? :( . I have been searching for the answer. It seems that its recommended to use Qt Quick Application or QML instead of Qt c++ codes. I am new to Qt and have created my projects using Qt Widget Application. Isn't that possible to somehow manage the issue without having to transfer all the codes to a new format?
Thanks,
-
Hi,
How are you setting up your widgets ? Through QVBoxLayout & QHBoxLayout ?
-
wrote on 10 Feb 2015, 14:16 last edited by
Hi SGaist,
Yes. I actually put lots of Vertical & Horizontal Spacer as well. But the whole windows are screwed! Any help is much appreciated!
-
Lots of spacers ? What for ?
-
wrote on 11 Feb 2015, 15:05 last edited by
OK, I have attached a snapshot of my project ui here. Maybe this can help more. Its a very simple design. Just couple of QTablewidgets and a Qlabel to show an Image...
In my desktop computer I can see all the windows just fine. I would like to have the same abilities in android mobiles and tablets with different screen resolutions.Thanks SGaist,
Amir"Your text to link here...":https://www.dropbox.com/s/1fkhv3ztvtjekjb/project_snapshot.png?dl=0
-
wrote on 11 Feb 2015, 15:13 last edited by
I have removed all the layouts and spacers here.
-
Looks like a work for QGridLayout
5/8