Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Resize layout created in Qt for Android.
QtWS25 Last Chance

Resize layout created in Qt for Android.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
androidqt 5.7application
7 Posts 3 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alvaro.sal
    wrote on 21 Aug 2016, 22:51 last edited by
    #1

    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=0B5ep0cURmuu9MkgxVHBjWVRxZ2s

    Qt Program:
    https://drive.google.com/open?id=0B5ep0cURmuu9VkpJTjhHWVp5Nmc

    I hope someone can help me to configure the layout or something. I am running the program in a LG-G3.

    Thanks for all!!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Aug 2016, 23:10 last edited by
      #2

      Hi,

      You should put your buttons in a layout. That will take care of placing and sizing them more nicely.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alvaro.sal
        wrote on 22 Aug 2016, 14:36 last edited by
        #3

        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!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Aug 2016, 21:01 last edited by
          #4

          Do you mean you want to hide them when in full screen or just that they keep a reasonable size ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Alvaro.sal
            wrote on 22 Aug 2016, 21:38 last edited by
            #5

            Yes, reasonable size.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 22 Aug 2016, 21:42 last edited by
              #6

              You can add spacer items to keep your buttons from expanding.

              It depends partly on where and how you want to place them.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                Qojote
                wrote on 22 Aug 2016, 21:46 last edited by
                #7

                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...

                1 Reply Last reply
                0

                2/7

                21 Aug 2016, 23:10

                topic:navigator.unread, 5
                • Login

                • Login or register to search.
                2 out of 7
                • First post
                  2/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved