Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qcameraviewfinder rotation

qcameraviewfinder rotation

Scheduled Pinned Locked Moved General and Desktop
camera
2 Posts 2 Posters 1.2k 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by Andy314
    #1

    Wenn I rotate the tablet the video stream in the view finder stays in its original orientation.
    How can I rotate it. I found only code to rotate a captured image, but this in not enough.
    The user should not tilt the head to see the preview in its correct form :-)
    I dot not need a rotation for any angle, the usual simple 90 degree in the correct direction is enough.

    1 Reply Last reply
    0
    • CharbyC Offline
      CharbyC Offline
      Charby
      wrote on last edited by
      #2

      You might post your code or give us a bit more details...you might have your application defined to rotate screen automatically following the actual device orientation.
      Otherwise another simple option is to use the orientation sensor to manage the viewfinder orientation :

      OrientationSensor{
              id:orient
              active:true
              property int rotAngle :90
              property bool isPortrait : true
              onReadingChanged: {
                  if (reading.orientation === OrientationReading.LeftUp)
                  {
                      rotAngle = -90;
                      isPortrait = false;
                  }
                  else if (reading.orientation === OrientationReading.RightUp)
                  {
                      rotAngle = 90;
                      isPortrait = false;
                  }
                  else if (reading.orientation === OrientationReading.TopDown)
                  {
                      isPortrait = true;
                      rotAngle = 180;
                  }
                  else {
                      isPortrait = true;
                      rotAngle = 0;
                  }
      
              }
          }
      
      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