Resize layout created in Qt for Android.
-
Hello everyone, I am programming in Android and I'm using C++ and Qt for create an app for android. The reason about this topic is that now I'm making an app for control Raspberry Pi from Android using UDP protocol.
I created a simple layout which send a signal to RPI using two push buttons, but when I create the buttons and run the program in my phone, I can see small push buttons and when I run the program in the Qt they have a normal size.
You can see the images in the below URLs.
Android:
https://drive.google.com/open?id=0B5ep0cURmuu9MkgxVHBjWVRxZ2sQt Program:
https://drive.google.com/open?id=0B5ep0cURmuu9VkpJTjhHWVp5NmcI hope someone can help me to configure the layout or something. I am running the program in a LG-G3.
Thanks for all!!
-
Hi,
You should put your buttons in a layout. That will take care of placing and sizing them more nicely.
-
Thanks for your answer. Is there any way to set a limit for the resize in the layout? That is because I don't want to a button in the full screen.
Thank you!
-
Do you mean you want to hide them when in full screen or just that they keep a reasonable size ?
-
Yes, reasonable size.
-
You can add spacer items to keep your buttons from expanding.
It depends partly on where and how you want to place them.
-
You can set the sizePolicy of each element in a layout. Typically a button has a fixed vertical size and an expanding horizontal size (dont get confused with "minimum" and "expanding" size policy).
Maybe it is useful to take the Qt creator and create a simple application and play around with layouts...