Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. automatic closing output window on qt 5.3.2

automatic closing output window on qt 5.3.2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 1.6k Views
  • 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.
  • S Offline
    S Offline
    sachin786
    wrote on last edited by
    #1

    hello can anyone tell me how to close window automatic in qt i used "onClicked: Qt.quit()" but i dont want to close on click

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Could you please explain better what you want to do? What do you mean by "automatic"?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sachin786
        wrote on last edited by
        #3

        my main.qml file==>
        Rectangle
        {
        width: 300
        height:300
        color: "green"
        MouseArea
        {
        anchors.fill: parent
        onClicked: Qt.quit()
        }
        Text
        {
        text: qsTr("hello....")
        anchors.centerIn:parent
        color:"yellow"
        }
        }
        in above code "onClicked: Qt.quit()" this line close the qml output window when i clicked the button of mouse..is any function to close that window automatic after seeing the output?? i am newer in qt
        main.cpp==>
        #include "qtquick1applicationviewer.h"
        #include <QApplication>

        int main(int argc, char *argv[])
        {
        QApplication app(argc, argv);

        QtQuick1ApplicationViewer viewer;
        
        viewer.addImportPath(QLatin1String("modules"));
        viewer.setOrientation(QtQuick1ApplicationViewer::ScreenOrientationAuto);
        viewer.setMainQmlFile(QLatin1String("qrc:/main.qml"));
        viewer.setWindowFlags(Qt::FramelessWindowHint);
        QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
        viewer.showExpanded();
        return app.exec();
        

        }

        1 Reply Last reply
        0
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I still don't understand what you mean by "automatic". After some time?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sachin786
            wrote on last edited by
            #5

            means after some interval?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sachin786
              wrote on last edited by
              #6

              import QtQuick 1.1

              Rectangle
              {
              width: 500
              height:300
              color: "red"
              MouseArea
              {
              anchors.fill: parent
              ** interval: 500; running: true; repeat: true
              onTriggered: Qt.quit()
              **
              }
              Text
              {
              width: 100
              height:100
              text: qsTr ("hello....")
              anchors.centerIn:parent
              color:"black"
              }
              }

              i am using this but cant get output...

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sachin786
                wrote on last edited by
                #7

                solved my issue by
                Rectangle
                {
                id : root
                width: 500
                height:300
                color: "red"
                MouseArea
                {
                anchors.fill: parent.Center
                Item
                {
                Timer
                {
                interval: 5000; running: true; repeat: true
                onTriggered: Qt.quit()
                }
                Text { id: time }
                }

                  }
                
                Text
                {
                    width:30
                    height:20
                    text: qsTr ("hello....")
                    anchors.centerIn: parent
                    color:"black"
                }
                

                }

                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 Extensions
                • Unsolved