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. IPad orientation changes in qml
Forum Updated to NodeBB v4.3 + New Features

IPad orientation changes in qml

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 995 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.
  • C Offline
    C Offline
    cochleas.devel
    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
    • D Offline
      D Offline
      dasRicardo
      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.

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

      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