Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Detect orientation changed. How?

    Mobile and Embedded
    2
    4
    134
    Loading More Posts
    • 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.
    • B
      bogong last edited by

      Hello all!
      What is the best way to detect orientation change on device in QT? I've been doing to through native iOS/Java implementation and by detecting width/height change. Is there in Qt standard way to detect it in-box?

      1 Reply Last reply Reply Quote 0
      • ODБOï
        ODБOï last edited by

        QScreen class has isLandscape /isPortrait functions

        B 1 Reply Last reply Reply Quote 0
        • B
          bogong @ODБOï last edited by

          @LeLev I know it. The question is "to detect orientation change on device in QT". I need to detect event of changing orientation but not the current state of orientation. I mean kind of signal.

          1 Reply Last reply Reply Quote 0
          • B
            bogong last edited by bogong

            Solution found https://doc.qt.io/qt-5/qscreen.html#orientationChanged. Issue closed. Example published here

            1 Reply Last reply Reply Quote 1
            • First post
              Last post