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. Layout Auto Change Top/Bottom to Left/Right

Layout Auto Change Top/Bottom to Left/Right

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 2.1k 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.
  • X Offline
    X Offline
    xsacha
    wrote on last edited by
    #1

    Couldn't find this discussed anywhere but I basically have a layout like this:

    @| ----
    | | |
    | |____|@

    So, a thin long box beside a square (fixed size!) box. Now, as the size of the window changes, I want the thin long box to automatically turn in to a wide, short box:

    @-----------


    | |
    |_____|@

    The reason being that my second box must have a fixed size. The automatic layout I currently have doesn't change as I am specifying either QHBoxLayout or QVBoxLayout.

    Is this possible using layouts or otherwise?
    Thanks.

    • Sacha
    1 Reply Last reply
    0
    • C Offline
      C Offline
      changsheng230
      wrote on last edited by
      #2

      Please refer to the Qt example: $QTDIR\Examples\4.7\layouts\dynamiclayouts

      Chang Sheng
      常升

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xsacha
        wrote on last edited by
        #3

        Hm. In this example they swap the elements of the grid when a button is pressed.
        Not exactly what I'm looking for.

        The part I am most concerned about is finding when width > height changes or doing this automatically. The example does this with a button instead.

        Edit: I have the frame paint event monitoring width/height and then emitting a signal to the main window to swap my layout. This is working but seems a bit hacky.

        • Sacha
        1 Reply Last reply
        0

        • Login

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