Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Screen artifacts, not getting cleared until window is resized



  • 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.



  • 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
                }
            }
        }
    }
    
    

  • Moderators

    @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


Log in to reply