Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Why does Qt.quit() not close the application?

    QML and Qt Quick
    1
    1
    586
    Loading More Posts
    • 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.
    • X
      xalam last edited by

      Why does the application doesn't close when I click in it?

      @import QtQuick 2.3
      import QtQuick.Window 2.2

      Rectangle {
      visible: true
      width: 360
      height: 360

      ListView {
         anchors.fill: parent
         id: mainList
         model: 10
         delegate:
             Rectangle {
             width: mainList.width
             height: 30
             color: (index %2 == 0) ? "white" : "lightblue"
         }
      }
      
      MouseArea {
          anchors.fill: parent
          onClicked: {
              Qt.quit();
          }
      }
      
      Text {
          text: qsTr("Hello World")
          anchors.centerIn: parent
      }
      

      }
      @

      When I click, it dispalys the message in the output

      bq. Signal QQmlEngine::quit() emitted, but no receivers connected to handle it.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post