Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to destroy the QQuickview and call a process in pi
Forum Updated to NodeBB v4.3 + New Features

how to destroy the QQuickview and call a process in pi

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 3 Posters 3.7k 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.
  • K Offline
    K Offline
    karti gesar
    wrote on last edited by
    #1

    hi all...one doubt how to destroy the Qquickview and call a process

    1 Reply Last reply
    0
    • K Offline
      K Offline
      karti gesar
      wrote on last edited by
      #2

      void fn()
      {
      view->destroy();
      QProcess *myProcess = new QProcess();
      myProcess->start(".exe");
      }

      above is the code...view is not destroying

      1 Reply Last reply
      0
      • RatzzR Offline
        RatzzR Offline
        Ratzz
        wrote on last edited by
        #3

        @karti-gesar
        As per this http://doc.qt.io/qt-5/qquickview.html#QQuickView-1
        You should delete a engine before you delete view ?

        --Alles ist gut.

        1 Reply Last reply
        3
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          hmm
          // create
          QQuickView * myvar= new QQuickView();
          //destroy
          delete myvar;

          //
          myProcess->start(".exe"); ???

          myProcess->start("/full/path/to/thefile.exe");

          Please see
          http://stackoverflow.com/questions/2622864/start-a-process-using-qprocess
          Also, note how to pass parameters and that " " spaces must be handled on windows.

          K 1 Reply Last reply
          4
          • mrjjM mrjj

            hmm
            // create
            QQuickView * myvar= new QQuickView();
            //destroy
            delete myvar;

            //
            myProcess->start(".exe"); ???

            myProcess->start("/full/path/to/thefile.exe");

            Please see
            http://stackoverflow.com/questions/2622864/start-a-process-using-qprocess
            Also, note how to pass parameters and that " " spaces must be handled on windows.

            K Offline
            K Offline
            karti gesar
            wrote on last edited by
            #5

            @mrjj working but issue that background qquickview still running

            1 Reply Last reply
            0
            • K Offline
              K Offline
              karti gesar
              wrote on last edited by
              #6

              when i put like this

              void fn()
              {
              view.destroy();
              }
              this works fine background operation also deleteing..
              but how to call process ..

              1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7
                • "but how to call process .."

                QProcess *process = new QProcess(this);
                QString program = "explorer.exe"; // the program. for some programs. FULL PATH must be used
                QString folder = "C:\"; // parameters
                process->start(program, QStringList() << folder);

                // Note
                at some point u need to do
                delete process ;

                1 Reply Last reply
                3
                • K Offline
                  K Offline
                  karti gesar
                  wrote on last edited by
                  #8

                  if i used that view is not destroying

                  mrjjM 1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    karti gesar
                    wrote on last edited by
                    #9

                    use QQuickview to call a qml.....have a image in a qml ....if u press any key in qml i.e.,in image ..that view should be destroyed...you want to display a dialog in qt with a button..for that qprocess is used to call...dialog .exe

                    suppose when a dialog is opened..if you clicked the button again you want to call the qml i.e.,that image in qml..like that viceversa

                    1 Reply Last reply
                    0
                    • K karti gesar

                      if i used that view is not destroying

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @karti-gesar

                      • if i used that view is not destroying

                      Well you can use

                      http://doc.qt.io/qt-5/qprocess.html#startDetached

                      to have it not block.

                      1 Reply Last reply
                      1
                      • K Offline
                        K Offline
                        karti gesar
                        wrote on last edited by
                        #11

                        i will try it

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          karti gesar
                          wrote on last edited by
                          #12

                          using destructor i deleted the process

                          mrjjM 1 Reply Last reply
                          0
                          • K karti gesar

                            using destructor i deleted the process

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            @karti-gesar

                            Ok. should be fine then.

                            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