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. Drawer not rotating with the rest of the scene
Forum Updated to NodeBB v4.3 + New Features

Drawer not rotating with the rest of the scene

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 4 Posters 1.3k Views 3 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.
  • D Offline
    D Offline
    dbrown
    wrote on last edited by
    #1

    Hello,

    I writing a QML app with Qt 5.10 on a Raspberry Pi with a 7" touchscreen. The screen is rotated in the "portrait" orientation (270 degrees).

    I have the screen display and touchscreen rotation happening correctly. I wrapped the items in a Page component and set the "rotation" property and this is working great.

    But, when I open the Drawer component by tapping the menu button, it opens as you would expect in "landscape" orientation. It does not seem like the rotation is applying to the Drawer even though it is within the Page component. I was able to reproduce this on the desktop by slightly modifying the "gallery" example project to display in portrait orientation.

    I must be missing something. Does anyone have any suggestions to try? Thanks for the help.

    raven-worxR 1 Reply Last reply
    1
    • D dbrown

      Hello,

      I writing a QML app with Qt 5.10 on a Raspberry Pi with a 7" touchscreen. The screen is rotated in the "portrait" orientation (270 degrees).

      I have the screen display and touchscreen rotation happening correctly. I wrapped the items in a Page component and set the "rotation" property and this is working great.

      But, when I open the Drawer component by tapping the menu button, it opens as you would expect in "landscape" orientation. It does not seem like the rotation is applying to the Drawer even though it is within the Page component. I was able to reproduce this on the desktop by slightly modifying the "gallery" example project to display in portrait orientation.

      I must be missing something. Does anyone have any suggestions to try? Thanks for the help.

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

      @dbrown
      i guess the drawer is bound to the window.
      But what happens when you bind the drawer edge value to your scene rotation accordingly?

      --- 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
      • D Offline
        D Offline
        dbrown
        wrote on last edited by
        #3

        @raven-worx
        Thanks for the quick response.

        I assigned the "edge" property to all 4 enum values and observed the behavior:
        Qt.TopEdge
        Qt.LeftEdge
        Qt.RightEdge
        Qt.BottomEdge

        It has the effect of moving what edge the drawer displays from, but it is still in the "landscape" orientation.

        I also noticed that the Dialog component is behaving the same way -- it shows only in the "landscape" orientation.

        I think you are right that it is bound to the window. But I can't seem to figure out how to apply the rotation to the window. The root ApplicationWindow component does not have the "rotation" property. I also changed the root object to be an Item and set the rotation, but it did not change the behavior either. I'm still researching this...

        Thanks again for your help.

        raven-worxR 1 Reply Last reply
        0
        • D dbrown

          @raven-worx
          Thanks for the quick response.

          I assigned the "edge" property to all 4 enum values and observed the behavior:
          Qt.TopEdge
          Qt.LeftEdge
          Qt.RightEdge
          Qt.BottomEdge

          It has the effect of moving what edge the drawer displays from, but it is still in the "landscape" orientation.

          I also noticed that the Dialog component is behaving the same way -- it shows only in the "landscape" orientation.

          I think you are right that it is bound to the window. But I can't seem to figure out how to apply the rotation to the window. The root ApplicationWindow component does not have the "rotation" property. I also changed the root object to be an Item and set the rotation, but it did not change the behavior either. I'm still researching this...

          Thanks again for your help.

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

          @dbrown
          what about Window's orientation property (set it to Qt::PortraitOrientation)?

          Alternatively it would be easier to rotate the screen on system level and do not worry about rotations in QML.

          --- 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
          • thamT Offline
            thamT Offline
            tham
            wrote on last edited by
            #5

            Found an easy way to avoid the Drawer shift to weird position when changed from portrait to landscape.

            position: root.parent.width < root.parent.height ? 1 : 1

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Krish
              wrote on last edited by
              #6

              I'm facing the same issue, I have a user-specific browser and the address will appear on swipe from the top edge.
              But when I rotate the screen, the web engine rotates perfectly but the address bar sticks at the same position in 0 deg or landscape.
              How to rotate the drawer along with the other components. I'm using Qt 5.15 in which I have to play with QML, instead of windowing rotate of the whole system
              @dbrown: did you resolve this issue and how, please suggest.
              @raven-worx: app drawer positioning is also not working.
              Thanks in advance.

              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