Encountered the following problem with rendering in QML. I have implemented the 'minimize window' button:
Image {
    source: "minimize.png"
    开发者_C百科scale: mouse.pressed ? 0.8 : 1.0
    smooth: mouse.pressed
    MouseArea {
        id: mouse
        anchors.fill: parent
        anchors.margins: -5
        onClicked: {
            console.log("MinimizeButton clicked");
            viewer.showMinimized();
        }
    }
}
where 'viewer' is the object inherited from QDeclarativeView which represents the main application window. The button shrinks when user clicks the mouse onto it and window has been minimized. But button stays shrinked when window is restored. Tried to add the timer which prints 'mouse.pressed' every 1 sec:
Timer {
    repeat: true
    interval: 1000
    running: true
    onTriggered: {
        console.log("mouse.pressed =",mouse.pressed);
    }
}
It always prints mouse not pressed. But button is scaled to 0.8, not 1.0. "viewer.showMinimized()" appears to be guilty: button is rendered OK if it is commented out.
Any suggestions to solve the problem?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论