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. Part of QML Rectangle is not drawn correctly under Linux environment
Qt 6.11 is out! See what's new in the release blog

Part of QML Rectangle is not drawn correctly under Linux environment

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 428 Views
  • 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.
  • Y Offline
    Y Offline
    ynakane
    wrote on last edited by
    #1

    Hello.

    I'm developing GUI for a linux machine in VirtualBox.

    I happened to notice the following phenomenon.
    Sometimes one (or more) of the four sides of the Rectangle is missing about a pixel.
    It may disappear when it is first displayed, or it may disappear when I switch App themes or press a button.

    Curiously, that didn't happen in the Windows environment.

    Here is an example of that phenomenon.

    I have defined an orange Rectangle and a blue Border.
    In the Windows environment, the blue border is drawn correctly.
    However, in the Linux environment, the upper border is not drawn.

    [Windows]
    ab749107-718a-491b-aa92-e51dec400250-image.png

    [Linux]
    8a56a11e-5f00-47b9-b4f2-a60a0c11c54a-image.png

    Here is the simplified code

    Page {
        id: root
        title: qsTr('Main Menu')
    
        Rectangle{
            width:30
            height:30
            color: "orange"
            border.width: 1
            border.color: "blue"
        }
     …
    

    I don't understand why this difference happens.
    Does anyone know the solution?
    Thank you.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Please post a complete QML file that demonstrates the problem. This looks like the border of the header is overlaying the border of the rectangle. This example does not demonstrate the problem (Linux, Qt 6.3.1) for me:

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          visible: true
          width: 400
          height: 400
      
          header: Label {
              text: view.currentItem.title
              horizontalAlignment: Text.AlignHCenter
          }
      
          SwipeView {
              id: view
              anchors.fill: parent
      
              Page {
                  title: qsTr("Main Menu")
      
                  Rectangle{
                      width:30
                      height:30
                      color: "orange"
                      border.width: 1
                      border.color: "blue"
                  }
              }
              Page {
                  title: qsTr("Page 2")
              }
              Page {
                  title: qsTr("Page 3")
              }
          }
      }
      
      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