Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. The image is cropped diagonally

The image is cropped diagonally

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 81 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.
  • W Offline
    W Offline
    woodpecker
    wrote last edited by SGaist
    #1

    Hello!
    I'm developing an Android application.
    When deploying an application to an emulator, an element of type "Image" (or "VideoOutput") is cropped diagonally.
    Capture
    But on a real smartphone everything is fine.
    The Qt version is 6.10.1.
    Has anyone come across this?
    Thanks in advance!

    1 Reply Last reply
    0
    • W Offline
      W Offline
      woodpecker
      wrote last edited by
      #2

      Here is my code snippet:

      ...
                      Button {
                          id: customButton
                          contentItem: ColumnLayout {
                                  spacing: 10
      
                                  Image {
                                      width: 130; height: 100
                                      fillMode: Image.PreserveAspectFit
                                      source: "qrc:/images/profile.png"
                                      Layout.alignment: Qt.AlignHCenter
                                  }
                                  Label {
                                      id: textLabel
                                      text: "Go to your account" 
                                      Layout.alignment: Qt.AlignHCenter
                                      font: customButton.font
                                  }
                          }
                          onClicked: {
                              stackView.push(detailPage)
                          }
                      }
      ...
      

      .

      1 Reply Last reply
      0
      • W Offline
        W Offline
        woodpecker
        wrote last edited by
        #3

        Here is a simple code:

        ApplicationWindow  {
            id: mainwindow
            width: 640
            height: 480
            visible: true
            title: qsTr("Hello World")
        
            Rectangle {
                width: 130; height: 100
                color: "#4dcc51"
                border.color: "black"
                anchors.centerIn: parent
            }
        }
        

        .
        This is what the emulator displays:
        ![alt text](d76be15b-79c5-4263-a321-1c20b8d40caf-изображение.png image url)
        .

        JKSHJ W 2 Replies Last reply
        0
        • W woodpecker

          Here is a simple code:

          ApplicationWindow  {
              id: mainwindow
              width: 640
              height: 480
              visible: true
              title: qsTr("Hello World")
          
              Rectangle {
                  width: 130; height: 100
                  color: "#4dcc51"
                  border.color: "black"
                  anchors.centerIn: parent
              }
          }
          

          .
          This is what the emulator displays:
          ![alt text](d76be15b-79c5-4263-a321-1c20b8d40caf-изображение.png image url)
          .

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote last edited by
          #4

          @woodpecker Interesting. I wonder if it's related to https://qt-project.atlassian.net/browse/QTBUG-134245 (although that's meant to be fixed in Qt 6.10.0)

          Does it help if you set the environment variable, QT_DISABLE_SHADER_DISK_CACHE=1 ?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • W woodpecker

            Here is a simple code:

            ApplicationWindow  {
                id: mainwindow
                width: 640
                height: 480
                visible: true
                title: qsTr("Hello World")
            
                Rectangle {
                    width: 130; height: 100
                    color: "#4dcc51"
                    border.color: "black"
                    anchors.centerIn: parent
                }
            }
            

            .
            This is what the emulator displays:
            ![alt text](d76be15b-79c5-4263-a321-1c20b8d40caf-изображение.png image url)
            .

            W Offline
            W Offline
            woodpecker
            wrote last edited by
            #5

            @woodpecker

            @JKSH said in The image is cropped diagonally:

            Does it help if you set the environment variable, QT_DISABLE_SHADER_DISK_CACHE=1 ?

            I added the following line as the first line in the main function:
            qputenv("QT_DISABLE_SHADER_DISK_CACHE", "1");
            but it didn't help.

            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