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. QML incorrect positioning elements in very simple code (with video)

QML incorrect positioning elements in very simple code (with video)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 624 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.
  • X Offline
    X Offline
    xintrea
    wrote on last edited by xintrea
    #1

    I made the following minimal code example:

    import QtQuick 2.6
    import QtQuick.Window 2.2
    
    Window {
        visible: true
        width: 500
        height: 500
    
        Rectangle
        {
            anchors.fill: parent
            color: "blue"
        }
    
        Rectangle
        {
            x: 0
            y: 0
            width: 100
            height: 100
            color: "red"
        }
    }
    

    This is just a window with a blue background and a red rectangle in the upper left corner.

    It would seem that there may be a bug? The bug start when the window size changes. I cannot take screenshots, because at the time of the screenshot, the windows seem to be redrawn, and the screenshot is obtained with the “correct” content.

    Therefore, I post the video: https://youtu.be/0ewK6jrqWms

    It can be seen that if you double-click "Expand", then the contents of the window becomes incorrect: the blue fill does not begin at the top of the window, but with some kind of vertical indent. The red square is also shifted down to the same indent.

    If you move the window, the contents of the window remains wrong, but at some point it suddenly redraws, and again becomes correct.

    Question: what is the problem, and how to make sure that the window is always drawn correctly? This is a glitch on such a simple example, but imagine what happens in a real project with a bunch of elements with calculated sizes and scaling.

    This bug is present in Qt 5.9.2 and Qt 5.11.2 (installation from qt.io site) in Debian Linux 9 Stable (LXDE).

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      This could issue very specific to Debian box. Did not see the similar issue in Windows or Mac. You file bug as well.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      X 1 Reply Last reply
      0
      • dheerendraD dheerendra

        This could issue very specific to Debian box. Did not see the similar issue in Windows or Mac. You file bug as well.

        X Offline
        X Offline
        xintrea
        wrote on last edited by
        #3

        @dheerendra

        We see this bug in next configurations:

        • Qt 5.9.2 and Qt 5.11.2 (install from qt.io site) in Debian Linux 9 Stable, Openbox+LXDE, Intel i915.
        • KWin/KDE, Qt 5.11.1, Intel i915 GPU

        We NOT see this bug:

        • Plasma and KWin 5.14.4, Qt 5.11.2, nvidia-driver 415.18
        • Ubuntu 18.04, Qt 5.9.5
        • Windows 10, Qt5.11.2
        • Windows, Qt 5.12
        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