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. Disable rotating animation when orientation change
Forum Updated to NodeBB v4.3 + New Features

Disable rotating animation when orientation change

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 2 Posters 5.4k Views 1 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.
  • H Offline
    H Offline
    hoanghua
    wrote on last edited by
    #1

    Hi,

    May I ask if there is anyway disable rotating animation when screen orientation changed? In my application, I'm using PageStack to push a landscape page from a current portrait page. The animation make it look not really nice.

    Regards,

    Hoang HUA

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      In a slot that handles the orientation change, use animation.stop() or animation.complete().

      (Z(:^

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hoanghua
        wrote on last edited by
        #3

        on PageStackWindow, i tried to use

        @
        onOrientationChangeAboutToStart: {
        animation.complete();
        }
        @

        however, it says "ReferenceError: Can't find variable: animation". should I need to change something to make it works. Thanks

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I used "animation" as the id of QML Animation object. You should use the id from your app. So, if you are using "myAnimation" as id, you should write:
          @
          onOrientationChangeAboutToStart: {
          myAnimation.complete();
          }
          @

          (Z(:^

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hoanghua
            wrote on last edited by
            #5

            Hi,

            Maybe I'm wrong, but when you change the orientation with
            @orientationLock = PageOrientation.LockLandscape;@

            the screen will be automatically rotated, so this animation is not created or handled by us; so is it possible for us to get this animation object so that we can stop it?

            Thanks

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Oh, sorry. I thought you are talking about an animation you have created yourself.

              In this case, I don't know what the solution is, probably, something OS-dependent has to be tweaked. I'm creating an app, it supports orientation changes, but no animation is played by default (that's on Android. And to be honest, I've just realised I've turned animations off in OS settings... ;) ).

              (Z(:^

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hoanghua
                wrote on last edited by
                #7

                [quote author="sierdzio" date="1328776250"]Oh, sorry. I thought you are talking about an animation you have created yourself.

                In this case, I don't know what the solution is, probably, something OS-dependent has to be tweaked. I'm creating an app, it supports orientation changes, but no animation is played by default (that's on Android. And to be honest, I've just realised I've turned animations off in OS settings... ;) ).[/quote]

                @sierdzio: LOL

                I've also not yet able to do this; however, a workaround can be done here which is to hide (visible) the PageStackWindow when orientation's animation take place. Not a perfect way but it works :-)

                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