Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. IPad orientation changes in qml
Qt 6.12 LTS is out! See what's new in the release blog

IPad orientation changes in qml

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi all,

    I am developing an iPad application with QML. I would like to detect the change of orientation of the iPad,
    so that I can do different things on Portrait and Landscape. Which is the best way?

    Until now I have a Rectangle item inside which I have used a sensor like this:

    @Sensors.OrientationSensor {
    id: sensor

    active: true
    
    onReadingChanged: {
        if ( reading.orientation == Sensors.OrientationReading.TopUp ) {
            orientation = "Portrait";      
        }
        else if ( reading.orientation == Sensors.OrientationReading.LeftUp ) {
            orientation = "Landscape";
        }
    }
    

    }@

    however the sensor reading changes before the screen-content orientation is complete.
    Is there a way to detect when orientation change is complete?

    Any help about the use of Screen.orientation?

    Any help?

    Thanx,
    Cochleas

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hmm, try out to handle change signals on width or height of your ApplicationWindow. I would think the orientation is finished if the width or height is changed.

      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
      • Unsolved