Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Application Portrait and Landscape mode (Horizontal/Vertical rotation)
Forum Updated to NodeBB v4.3 + New Features

Application Portrait and Landscape mode (Horizontal/Vertical rotation)

Scheduled Pinned Locked Moved Solved QML and Qt Quick
8 Posts 3 Posters 2.1k Views 2 Watching
  • 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.
  • SebastianMS Offline
    SebastianMS Offline
    SebastianM
    wrote on last edited by
    #1

    Hi,
    I would like to add option to rotate my application between Portait and Landscape mode. (Linux handheld device).
    I tried nesting Item inside main ApplicationWindow, with custom rotate flag swap width/height and set item rotation 0/90.
    Problem is - that lots of internal components rely on anchors and are placed in app corner. After above rotation, component from bottomLeft is now in bottomRight and is on side.
    I would like to avoid tedious process of exposing flag to all components and usage of condition expressions to decide how to place them.

    raven-worxR 1 Reply Last reply
    0
    • SebastianMS SebastianM

      Hi,
      I would like to add option to rotate my application between Portait and Landscape mode. (Linux handheld device).
      I tried nesting Item inside main ApplicationWindow, with custom rotate flag swap width/height and set item rotation 0/90.
      Problem is - that lots of internal components rely on anchors and are placed in app corner. After above rotation, component from bottomLeft is now in bottomRight and is on side.
      I would like to avoid tedious process of exposing flag to all components and usage of condition expressions to decide how to place them.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @SebastianM
      The "default" provided QML components listen to Window.contentOrientation property - like Popups on the Overlay

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • SebastianMS Offline
        SebastianMS Offline
        SebastianM
        wrote on last edited by SebastianM
        #3

        Help me understand.
        Screen.orientation is OS information about current display orientation (if HW uses accelerometer or user manual change orientation).
        Window.contentOrientation applicaton changes to notify OS display server/windows manager how it describe it's own orientation.

        In both situation, if my App placed Rectangle in bottomLeft and device has been rotated. Rectangle will be rotated (lying on side) on and in new corner.
        Is is possible for app to treat anchors.top the same despite orientation change? I mean - in Vertical Top is this what Right was in Horizontal?

        I don't like idea to use rotation/orientation flag in all places where position is set. Or create two separate layouts changed with orientation.

        1 Reply Last reply
        0
        • MarkkyboyM Offline
          MarkkyboyM Offline
          Markkyboy
          wrote on last edited by
          #4

          Out of pure curiosity, what is your Linux device?, I'm using Sony Xperia 10ii with SailfishOS, screen orientation is more or less handled by the device. Perhaps they way orientation is done in Sailfish, could be applied to your device...?.

          1 Reply Last reply
          0
          • SebastianMS Offline
            SebastianMS Offline
            SebastianM
            wrote on last edited by
            #5

            It's commercial project on EGLFS without built-in orientation. Yocto will handle system setup.
            For now I'm starting to getting used to idea of two separate layouts.

            raven-worxR 1 Reply Last reply
            0
            • SebastianMS SebastianM

              It's commercial project on EGLFS without built-in orientation. Yocto will handle system setup.
              For now I'm starting to getting used to idea of two separate layouts.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @SebastianM
              i think i dont understand your problem.

              I tried nesting Item inside main ApplicationWindow, with custom rotate flag swap width/height and set item rotation 0/90.

              when you do this, all anchors are also translated. means bottom-left of horizontal will also be bottom-left in vertical when the device is rotated.

              Problem is - that lots of internal components rely on anchors and are placed in app corner. After above rotation, component from bottomLeft is now in bottomRight and is on side.

              can you please show how you are placing those elements

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • SebastianMS Offline
                SebastianMS Offline
                SebastianM
                wrote on last edited by
                #7

                I didn't add anchors.centerIn: parent in content Item (which is rotated and is changing size). In result, after rotation Item was placed in completely crazy place.

                1 Reply Last reply
                0
                • MarkkyboyM Offline
                  MarkkyboyM Offline
                  Markkyboy
                  wrote on last edited by
                  #8
                  This post is deleted!
                  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