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. Running in parallel process qt?
Forum Updated to NodeBB v4.3 + New Features

Running in parallel process qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 415 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
    sm2770s
    wrote on last edited by sm2770s
    #1

    I created one gui with all the things i needed. So Each Button has its own functionality but lineEdit and PushButton are main in my scenario.

    When I write some information in LineEdit i will receive that text and try to the following mentioned in below snipper. But while doing like this the gui hangs until it is done with process.

    But I dont want to happen like this and instead it should be smooth!. Can someone suggest some solution for this?

    For PushButton it looks similar to code mentioned here (https://forum.qt.io/topic/123510/how-to-run-external-executable-in-qt-project)

    int Widget::on_lineEdit_returnPressed()
    {
    
    
        QString value = "it is :";
        QString value1 = ui->lineEdit->text();
        QString value2 = value + value1;
        ui->plainTextEdit->appendPlainText(value2);
    
        std::string it = ui->lineEdit->text().toStdString();
        dt = new someSDK(it1,port);
    
        if (!dt->isValid()) {
           
            ui->plainTextEdit->appendPlainText("some  error");
            return -3;
        }
        std::cout << "connected to  " << it1 << " with port " << dt->getsomePort() << std::endl;
    }
    
    jsulmJ 1 Reply Last reply
    0
    • S sm2770s

      I created one gui with all the things i needed. So Each Button has its own functionality but lineEdit and PushButton are main in my scenario.

      When I write some information in LineEdit i will receive that text and try to the following mentioned in below snipper. But while doing like this the gui hangs until it is done with process.

      But I dont want to happen like this and instead it should be smooth!. Can someone suggest some solution for this?

      For PushButton it looks similar to code mentioned here (https://forum.qt.io/topic/123510/how-to-run-external-executable-in-qt-project)

      int Widget::on_lineEdit_returnPressed()
      {
      
      
          QString value = "it is :";
          QString value1 = ui->lineEdit->text();
          QString value2 = value + value1;
          ui->plainTextEdit->appendPlainText(value2);
      
          std::string it = ui->lineEdit->text().toStdString();
          dt = new someSDK(it1,port);
      
          if (!dt->isValid()) {
             
              ui->plainTextEdit->appendPlainText("some  error");
              return -3;
          }
          std::cout << "connected to  " << it1 << " with port " << dt->getsomePort() << std::endl;
      }
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @sm2770s said in Running in parallel process qt?:

      done with process

      Which process? I do not see you starting any processes in the code you posted, so please explain better and provide relevant code!

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

      S 1 Reply Last reply
      1
      • jsulmJ jsulm

        @sm2770s said in Running in parallel process qt?:

        done with process

        Which process? I do not see you starting any processes in the code you posted, so please explain better and provide relevant code!

        S Offline
        S Offline
        sm2770s
        wrote on last edited by
        #3

        @jsulm Sorry for causing some problem in understanding question. What I mean here is if i enter some informaion in LineEdit and press Enter. It hangs up until it does what is expected to do (this is kept in code block in question). So i want to make this smooth that means basically,
        the code works in background and i can some information on linedit2 and so on..

        Did you get my question now?

        jsulmJ JoeCFDJ 2 Replies Last reply
        0
        • S sm2770s

          @jsulm Sorry for causing some problem in understanding question. What I mean here is if i enter some informaion in LineEdit and press Enter. It hangs up until it does what is expected to do (this is kept in code block in question). So i want to make this smooth that means basically,
          the code works in background and i can some information on linedit2 and so on..

          Did you get my question now?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @sm2770s said in Running in parallel process qt?:

          Did you get my question now?

          Did you get my question?
          How is anybody supposed to help you if you don't provide enough information?
          What is someSDK doing? Where does your app hang?

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

          1 Reply Last reply
          2
          • S sm2770s

            @jsulm Sorry for causing some problem in understanding question. What I mean here is if i enter some informaion in LineEdit and press Enter. It hangs up until it does what is expected to do (this is kept in code block in question). So i want to make this smooth that means basically,
            the code works in background and i can some information on linedit2 and so on..

            Did you get my question now?

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #5

            @sm2770s use a thread to do the job and your widgets are still free for use.

            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