Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Make a button disappear generates warning
Qt 6.12 LTS is out! See what's new in the release blog

Make a button disappear generates warning

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 633 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    alecs26
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved