[Solved] QML: rendering problems after minimizing frameless window



  • I'm trying to implement the QML-based UI inside of frameless (Qt::FramelessWindowHint) window.
    But QML engine stops responding to mouse clicks after window is minimized via showMinimized() method.

    the code follows:
    @
    Image {
    source: "minimize.png"
    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(); // If comment out this line, works fine
        }
    }
    

    }
    @

    After clicking on MouseArea window is minimized as needed. But all Qt Quick controls inside window become frozen after window has been restored.
    Windows without Qt::FramelessWindowHint flag are not affected.
    showMinimized() is not the only method to reproduce, "Show Desktop" command of OS gives the same effect. OS is Windows XP.

    Is there any workaround for this problem?



  • I'm still hoping to hear any comments for this issue. This is a major problem and it truly exists on Windows OS.



  • obsessed, we also experienced this problem in one of our projects.
    This "bug is reported":http://bugreports.qt.nokia.com/browse/QTBUG-17548 but is not solved yet. Following the link to the bug report, you'll find this workaround:

    @
    void MainWindow::showEvent(QShowEvent *event)
    {
    QApplication::postEvent(this, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
    QWidget::showEvent(event);
    }
    @



  • This solves the problem, thanks a lot.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.