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

Make a button disappear generates warning



  • Hello,

    When I press a button, I want this button to disappear. That seems simple but it generates a weird error. When I minimize and reopen my application window, the console says "QQuickButton QVariant(Invalid) QRect(0,0 0x0)".

    Here is the QML code:

    import QtQuick 2.7
    import QtQuick.Controls 2.0
    import QtQuick.Layouts 1.0
    
    ApplicationWindow
    {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        Button
        {
            id: buttonEnglish
            visible:true
            width: 200
            height: 200
    
            onClicked:
            {
                buttonEnglish.visible=false
            }
        }
    }
    

    I am using Qt with MinGW 5.7 on Windows 8.

    I really don't understand what can cause this...

    Thank you very much,

    Alex


Log in to reply