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

Rectangle does not cover the entire ApplicationWindow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Duplicate
    • Affects Version/s: 5.9.2
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Environment:
      Qt5.9.2, QtQuick 2.9, QtQuick Controls 2.2, Samsung Note 5 with Android 7.0 and tested with screen resolutions HD(1280*720) FHD(1920*1080) and WQHD(2560*1440), Windows 10 for development.
    • Platform/s:
      Android

      Description

      [Even if it seems duplicate, Can someone please mention a possible solution to this bug? Just closing the bug doesn't solve a user problem.]

      In Qt5.9.2, I created a black rectangle inside a red ApplicationWindow for Samsung Note-5 with screen resolutions 1280*720, 1920*1080, 2560*1440 and Android-7.0 in two ways:

      1. A rectangle having the same width and height of the ApplicationWindow
      2. anchors.fill : parent

      But in both ways the response is same - rectangle doesn't fill the entire ApplicationWindow. You can see about a pixel line on top side and about a pixel line on right side of the ApplicationWindow which is not filled. Even if I make a much larger Rectangle than the ApplicationWindow itself, I get the same output.

      I noticed that If I try to nest rectangles and fill the parent rectangle with a child one then I get the completely filled parent rectangle without any issues.

      Here I have attached a picture and a working project for testing.

      QML Code:

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          id: appWindow
          visible: true
      
          /* Developing mobile apps you don’t need to set width
             and height, because the ApplicationWindow always grabs
             the total available space.
          */
      
          color: "#ff0000" // Red color
      
          /* For some reasons I want this Rectangle here
           * and it MUST fill the entire window but I notice
           * a pixel or two line on top and right of the
           * screen.
           */
          Rectangle {
              width:  appWindow.width;
              height: appWindow.height
      
              //anchors.fill: parent // same output
      
              color: "#000000" // Black color
          }
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                qt.team.quick.subscriptions Qt Quick and Widgets Team
                Reporter:
                eager1 Shujaat Khan
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes