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. [SOLVED] How to delay a QProcess for 1 minute ?
QtWS25 Last Chance

[SOLVED] How to delay a QProcess for 1 minute ?

Scheduled Pinned Locked Moved General and Desktop
delayqprocess
3 Posts 2 Posters 1.9k 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.
  • H Offline
    H Offline
    Hanoosh
    wrote on 15 Jul 2015, 10:44 last edited by Hanoosh
    #1

    Hi,

    How to delay a QProcess for 1 minute ?

    void Read(QString file){
        QProcess process;
        process.startDetached(file);
    
    }
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroen3
      wrote on 15 Jul 2015, 11:13 last edited by
      #2

      Try suspending the process.
      Results may vary per platform.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hanoosh
        wrote on 15 Jul 2015, 12:44 last edited by Hanoosh
        #3

        solved:

        
        void Read(QString file){
            QProcess process;
            process.startDetached(file);
        
        }
        
        int main(int argc, char *argv[])
        {
            QCoreApplication a(argc, argv);
            QTimer t;
            QObject::connect(&t, &QTimer::timeout, [&](){
            Read(s);
            t.stop();
            });
            t.start(60000);
        
            return a.exec();
        }
        
        1 Reply Last reply
        0

        1/3

        15 Jul 2015, 10:44

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved