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

QQuickWindow does not change color in the first frame

    XMLWordPrintable

Details

    • Windows

    Description

      I posted that in the forum first, but created a ticket then here as it looks like a bug.

      QQuickWindow color is changed, but is rendered only since the next frame in any case (QML Window through setting color property or through manually creating QQuickWindow and calling setColor() on the object). The first frame is rendered in white color which is originally set. (0:02 in the demo).
      I printed the initial and after-set colors on the console output to make sure that it had been changed right after the setting. You can see the log messages in the video in the last frame.

      I am attaching the code here. You can also see it in the first frame of the video.

       
      int app::on_run()

      {     // Setup Qt     set_qt_environment();     QQuickWindow window;     LOG("Initial color: " << window.color().name().toStdString());     window.setColor(QColor("#123456"));     LOG("Color after change: " << window.color().name().toStdString());     window.show();     return exec(); }

       
      Also notice that the code above is the maximally simplified example. Originally, I set the color on the main window in App.qml, but the result is absolutely the same - QQuickWindow's color is changed, but the first frame contains the old color:

      App.qml (another way to achieve that):

       
      import QtQuick 6.2
      import QtGUI

      Window

      {     width: mainScreen.width     height: mainScreen.height     visible: true     title: "QtGUI"     color: "#123456" }

       

      Specs:
      OS: Windows 11
      Qt v6.5.1, installed through Qt Open Source online installer
      Qt Creator: 10.0.2, installed through Qt Open Source online installer
       

      Attachments

        1. First frame.png
          2 kB
          Paulo Fernando
        2. Next frame.png
          2 kB
          Paulo Fernando
        3. Old color in the first frame.mp4
          288 kB
          Paulo Fernando
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            skalex Paulo Fernando
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes