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. Screen artifacts, not getting cleared until window is resized

Screen artifacts, not getting cleared until window is resized

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 378 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.
  • D Offline
    D Offline
    Demolishun
    wrote on 1 Jan 2022, 21:36 last edited by
    #1

    Qt versions I am seeing this in: 5.15.7 and 5.15.5 (have not tested 5.15.2)

    Here is some minimal code that causes this (copied code causing this from another project into minimal project for this test):

    import QtQuick 2.15
    import QtQuick.Controls 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("test screen tearing, lack of update")
    
        Action {
            id: showconfiguretankimageaction
    
            onTriggered: {
                configuretankimage_loader.sourceComponent = configuretankimage_comp
                configuretankimage_loader.item.show()
            }
        }
    
        Button {
            text: "open window"
    
            action: showconfiguretankimageaction
        }
    
        Loader {
            id: configuretankimage_loader
        }
    
        Component {
            id: configuretankimage_comp
    
            // chart to show and adjust threshold of received raw data
            Window {
                id: configuretankimage
    
                readonly property real horizontalZoom: tankimage_scaled.horizontalZoom
                readonly property real verticalZoom: tankimage_scaled.verticalZoom
    
                title: qsTr("Configure Tank Image")
    
                width: 500
                height: 500
    
                Column {
                    width: parent.width
    
                    Slider {
                        id: hzoomslider
    
                        orientation: Qt.Horizontal
                        width: parent.width * 0.8
                        anchors.horizontalCenter: parent.horizontalCenter
                    }
                    Slider {
                        id: vzoomslider
    
                        orientation: Qt.Horizontal
                        width: parent.width * 0.8
                        anchors.horizontalCenter: parent.horizontalCenter
                    }
                }
    
                Component.onCompleted: {
                    let tempx = mainwindow.x - width - 10
                    x = tempx >= 0 ? tempx : 0
                    y = mainwindow.y + mainwindow.height/2 - height/2
                }
            }
        }
    }
    

    I updated both my video drivers to latest for my intel and nvidia gpus (laptop).
    My main window in my other app sometimes flickers and doesn't update. I have never seen this issue at work when working on a laptop in windows or linux. I don't know if this is related to my machine or qt.

    Stuff gets weird when I scroll the sliders. It is only fixed when I resize the window.

    Here are examples of what gets weird:
    qt5.15videoissue01.PNG

    I played with this a bit and can get the subwindow into a state where it ceases updating and redrawing even after resizing.

    No other software that I use on this machine does anything like this. Very confused.

    1 Reply Last reply
    1
    • D Offline
      D Offline
      Demolishun
      wrote on 1 Jan 2022, 21:52 last edited by
      #2

      Stranger and stranger. This causes issue still:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtQuick.Window 2.15
      
      Window {
          id: mainwindow
      
          width: 640
          height: 480
          visible: true
          title: qsTr("test screen tearing, lack of update")
      
          Action {
              id: showconfiguretankimageaction
      
              onTriggered: {
                  configuretankimage_loader.sourceComponent = configuretankimage_comp
                  configuretankimage_loader.item.show()
              }
          }
      
          Button {
              text: "open window"
      
              action: showconfiguretankimageaction
          }
      
          Loader {
              id: configuretankimage_loader
          }
      
          Component {
              id: configuretankimage_comp
      
              // chart to show and adjust threshold of received raw data
              Window {
                  id: configuretankimage
      
                  title: qsTr("Configure Tank Image")
      
                  width: 500
                  height: 500
      
                  Column {
                      width: parent.width
      
                      ScrollBar {
                          orientation: Qt.Horizontal
                          width: parent.width * 0.8
                          height: 20
                          anchors.horizontalCenter: parent.horizontalCenter
                      }
                      Slider {
                          id: hzoomslider
      
                          orientation: Qt.Horizontal
      
                          width: parent.width * 0.6
      
                          from: -1.0
                          to: 1.0
                      }
                      /*
                      Row {
                          width: parent.width * 0.8
                          anchors.horizontalCenter: parent.horizontalCenter
                          Text {
                              text: hzoomslider.value.toFixed(2)
                          }
      
                      }
                      */
                      Slider {
                          id: vzoomslider
      
                          orientation: Qt.Horizontal
                          width: parent.width * 0.8
                          anchors.horizontalCenter: parent.horizontalCenter
      
                          //from: -1.0
                          //to: 1.0
                      }
                  }
      
                  Component.onCompleted: {
                      let tempx = mainwindow.x - width - 10
                      x = tempx >= 0 ? tempx : 0
                      y = mainwindow.y + mainwindow.height/2 - height/2
                  }
              }
          }
      }
      

      But this magically fixes issue:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtQuick.Window 2.15
      
      Window {
          id: mainwindow
      
          width: 640
          height: 480
          visible: true
          title: qsTr("test screen tearing, lack of update")
      
          Action {
              id: showconfiguretankimageaction
      
              onTriggered: {
                  configuretankimage_loader.sourceComponent = configuretankimage_comp
                  configuretankimage_loader.item.show()
              }
          }
      
          Button {
              text: "open window"
      
              action: showconfiguretankimageaction
          }
      
          Loader {
              id: configuretankimage_loader
          }
      
          Component {
              id: configuretankimage_comp
      
              // chart to show and adjust threshold of received raw data
              Window {
                  id: configuretankimage
      
                  title: qsTr("Configure Tank Image")
      
                  width: 500
                  height: 500
      
                  Column {
                      width: parent.width
      
                      ScrollBar {
                          orientation: Qt.Horizontal
                          width: parent.width * 0.8
                          height: 20
                          anchors.horizontalCenter: parent.horizontalCenter
                      }
      
                      Row {
                          width: parent.width * 0.8
                          anchors.horizontalCenter: parent.horizontalCenter
                          Text {
                              text: hzoomslider.value.toFixed(2)
                          }
                          Slider {
                              id: hzoomslider
      
                              orientation: Qt.Horizontal
      
                              width: parent.width * 0.6
      
                              from: -1.0
                              to: 1.0
                          }
                      }
      
                      Slider {
                          id: vzoomslider
      
                          orientation: Qt.Horizontal
                          width: parent.width * 0.8
                          anchors.horizontalCenter: parent.horizontalCenter
      
                          //from: -1.0
                          //to: 1.0
                      }
                  }
      
                  Component.onCompleted: {
                      let tempx = mainwindow.x - width - 10
                      x = tempx >= 0 ? tempx : 0
                      y = mainwindow.y + mainwindow.height/2 - height/2
                  }
              }
          }
      }
      
      
      J.HilkJ 1 Reply Last reply 3 Jan 2022, 07:07
      0
      • D Demolishun
        1 Jan 2022, 21:52

        Stranger and stranger. This causes issue still:

        import QtQuick 2.15
        import QtQuick.Controls 2.15
        import QtQuick.Window 2.15
        
        Window {
            id: mainwindow
        
            width: 640
            height: 480
            visible: true
            title: qsTr("test screen tearing, lack of update")
        
            Action {
                id: showconfiguretankimageaction
        
                onTriggered: {
                    configuretankimage_loader.sourceComponent = configuretankimage_comp
                    configuretankimage_loader.item.show()
                }
            }
        
            Button {
                text: "open window"
        
                action: showconfiguretankimageaction
            }
        
            Loader {
                id: configuretankimage_loader
            }
        
            Component {
                id: configuretankimage_comp
        
                // chart to show and adjust threshold of received raw data
                Window {
                    id: configuretankimage
        
                    title: qsTr("Configure Tank Image")
        
                    width: 500
                    height: 500
        
                    Column {
                        width: parent.width
        
                        ScrollBar {
                            orientation: Qt.Horizontal
                            width: parent.width * 0.8
                            height: 20
                            anchors.horizontalCenter: parent.horizontalCenter
                        }
                        Slider {
                            id: hzoomslider
        
                            orientation: Qt.Horizontal
        
                            width: parent.width * 0.6
        
                            from: -1.0
                            to: 1.0
                        }
                        /*
                        Row {
                            width: parent.width * 0.8
                            anchors.horizontalCenter: parent.horizontalCenter
                            Text {
                                text: hzoomslider.value.toFixed(2)
                            }
        
                        }
                        */
                        Slider {
                            id: vzoomslider
        
                            orientation: Qt.Horizontal
                            width: parent.width * 0.8
                            anchors.horizontalCenter: parent.horizontalCenter
        
                            //from: -1.0
                            //to: 1.0
                        }
                    }
        
                    Component.onCompleted: {
                        let tempx = mainwindow.x - width - 10
                        x = tempx >= 0 ? tempx : 0
                        y = mainwindow.y + mainwindow.height/2 - height/2
                    }
                }
            }
        }
        

        But this magically fixes issue:

        import QtQuick 2.15
        import QtQuick.Controls 2.15
        import QtQuick.Window 2.15
        
        Window {
            id: mainwindow
        
            width: 640
            height: 480
            visible: true
            title: qsTr("test screen tearing, lack of update")
        
            Action {
                id: showconfiguretankimageaction
        
                onTriggered: {
                    configuretankimage_loader.sourceComponent = configuretankimage_comp
                    configuretankimage_loader.item.show()
                }
            }
        
            Button {
                text: "open window"
        
                action: showconfiguretankimageaction
            }
        
            Loader {
                id: configuretankimage_loader
            }
        
            Component {
                id: configuretankimage_comp
        
                // chart to show and adjust threshold of received raw data
                Window {
                    id: configuretankimage
        
                    title: qsTr("Configure Tank Image")
        
                    width: 500
                    height: 500
        
                    Column {
                        width: parent.width
        
                        ScrollBar {
                            orientation: Qt.Horizontal
                            width: parent.width * 0.8
                            height: 20
                            anchors.horizontalCenter: parent.horizontalCenter
                        }
        
                        Row {
                            width: parent.width * 0.8
                            anchors.horizontalCenter: parent.horizontalCenter
                            Text {
                                text: hzoomslider.value.toFixed(2)
                            }
                            Slider {
                                id: hzoomslider
        
                                orientation: Qt.Horizontal
        
                                width: parent.width * 0.6
        
                                from: -1.0
                                to: 1.0
                            }
                        }
        
                        Slider {
                            id: vzoomslider
        
                            orientation: Qt.Horizontal
                            width: parent.width * 0.8
                            anchors.horizontalCenter: parent.horizontalCenter
        
                            //from: -1.0
                            //to: 1.0
                        }
                    }
        
                    Component.onCompleted: {
                        let tempx = mainwindow.x - width - 10
                        x = tempx >= 0 ? tempx : 0
                        y = mainwindow.y + mainwindow.height/2 - height/2
                    }
                }
            }
        }
        
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on 3 Jan 2022, 07:07 last edited by
        #3

        @Demolishun so I tested the "still causing issue" version you posted, and no issue for me on 5.15.7

        but its on macOS, if that makes a difference

        3ad88e41-28aa-4c86-961c-efe512518432-image.png


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        1

        1/3

        1 Jan 2022, 21:36

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved