Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35086

Wrong orientation handling on android ViewOutput

    XMLWordPrintable

Details

    • Android
    • 13d7f835fad59fbda69bfa160e21f19d095ac8d5

    Description

      Following QML code works correctly on android excepting rotation handling. Honestly i don't understand how it rotates preview image, sometime it shows it rotated on 90%, sometime on 180%, i didn't find any logic there:

      import QtQuick 2.0
      import QtQuick.Window 2.0
      import QtMultimedia 5.0

      Rectangle {
      id : cameraUI

      width: 800
      height: 480

      color: "black"

      Camera {
      id: camera
      captureMode: Camera.CaptureVideo
      focus.focusMode: Camera.FocusAuto
      focus.focusPointMode: Camera.FocusPointCenter
      onCameraStateChanged: {
      if(camera.cameraState == Camera.ActiveState)

      { camera.searchAndLock(); }
      }
      onLockStatusChanged: {
      if(camera.lockStatus == Camera.Locked)
      { camera.searchAndLock(); }

      }
      }

      VideoOutput {
      id: viewfinder

      anchors.fill: parent
      fillMode: VideoOutput.PreserveAspectCrop
      focus: visible

      source: camera
      Repeater {
      model: camera.focus.focusZones

      Rectangle {
      border

      { width: 1 color: status == Camera.FocusAreaFocused ? "green" : "white" }

      color: "transparent"

      property variant mappedRect: viewfinder.mapNormalizedRectToItem(area);

      x: mappedRect.x
      y: mappedRect.y
      width: mappedRect.width
      height: mappedRect.height
      }
      }
      }
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            eskon2 Sergey Kondryukov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes