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. QProcess::startDetached() doesn't work on self-written programs
QtWS25 Last Chance

QProcess::startDetached() doesn't work on self-written programs

Scheduled Pinned Locked Moved Solved General and Desktop
qprocessstartdetached
17 Posts 3 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.
  • Q Qt_Bob
    24 Nov 2023, 12:59

    Hi,
    I'm new to Qt and have a problem with my latest project.
    I am using Windows 10, Qt 6.6.0 and MinGW_64.

    I have already written some programs and deployed them using the MinGW console and the command "windeployqt ." so that the dependencies are included and the programs can also be used on other (Windows) PCs.
    These run without any problems and fulfill their purpose.
    In my current project, I want to give the user the option of opening programs by pressing a QPush button. This works with all programs except the ones I wrote myself (7 others work, 2 self-written ones do not).

    Have I missed something?

    Here is a minimal example, even if the problem is difficult to reproduce without the additional programs:

    mainwindow.h

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include <QPushButton>
    #include <QGridLayout>
    #include <QProcess>
    
    QT_BEGIN_NAMESPACE
    namespace Ui { class MainWindow; }
    QT_END_NAMESPACE
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
    
    private slots:
        void open_program();
    };
    #endif // MAINWINDOW_H
    
    

    main.cpp

    #include "mainwindow.h"
    
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
        return a.exec();
    }
    

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        QPushButton *but_open = new QPushButton("Open");
        QGridLayout *layout = new QGridLayout();
        layout->addWidget(but_open, 0, 0);
        ui->centralwidget->setLayout(layout);
    
        connect(but_open,SIGNAL(clicked()),this,SLOT(open_program()));
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::open_program()
    {
        QProcess process;
        QString pfad = "I:\\FabTech\\Anlagen-Dokumentation\\85 TEOS 200 mm\\Teos-Trapping\\TEOS-Überwachung\\TEOS-Abscheidungs-Programm\\TEOS_Abscheidung.exe";
        process.startDetached(pfad);
    }
    

    I have also tried shorter paths (C:\test), which did not bring any change. I also use data from a subfolder of the program to be executed, which can be read and processed without any problems.

    If there is no simple solution to the problem, I will probably leave out the integration of these programs and just work with the data, but maybe I have just overlooked something and there is a simple solution?!

    Thanks in advance,
    Qt_Bob

    P.S.: I forgot to mention:
    After pressing the QPush button, a window opens for a barely perceptible period of time and then closes again immediately.

    C Offline
    C Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on 24 Nov 2023, 13:06 last edited by
    #2

    Don't use startDetached() but start() and connect to the appropirate error slots to maybe see what's going wrong.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    2
    • Q Qt_Bob
      24 Nov 2023, 12:59

      Hi,
      I'm new to Qt and have a problem with my latest project.
      I am using Windows 10, Qt 6.6.0 and MinGW_64.

      I have already written some programs and deployed them using the MinGW console and the command "windeployqt ." so that the dependencies are included and the programs can also be used on other (Windows) PCs.
      These run without any problems and fulfill their purpose.
      In my current project, I want to give the user the option of opening programs by pressing a QPush button. This works with all programs except the ones I wrote myself (7 others work, 2 self-written ones do not).

      Have I missed something?

      Here is a minimal example, even if the problem is difficult to reproduce without the additional programs:

      mainwindow.h

      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      #include <QPushButton>
      #include <QGridLayout>
      #include <QProcess>
      
      QT_BEGIN_NAMESPACE
      namespace Ui { class MainWindow; }
      QT_END_NAMESPACE
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          MainWindow(QWidget *parent = nullptr);
          ~MainWindow();
      
      private:
          Ui::MainWindow *ui;
      
      private slots:
          void open_program();
      };
      #endif // MAINWINDOW_H
      
      

      main.cpp

      #include "mainwindow.h"
      
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          return a.exec();
      }
      

      mainwindow.cpp

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          QPushButton *but_open = new QPushButton("Open");
          QGridLayout *layout = new QGridLayout();
          layout->addWidget(but_open, 0, 0);
          ui->centralwidget->setLayout(layout);
      
          connect(but_open,SIGNAL(clicked()),this,SLOT(open_program()));
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      void MainWindow::open_program()
      {
          QProcess process;
          QString pfad = "I:\\FabTech\\Anlagen-Dokumentation\\85 TEOS 200 mm\\Teos-Trapping\\TEOS-Überwachung\\TEOS-Abscheidungs-Programm\\TEOS_Abscheidung.exe";
          process.startDetached(pfad);
      }
      

      I have also tried shorter paths (C:\test), which did not bring any change. I also use data from a subfolder of the program to be executed, which can be read and processed without any problems.

      If there is no simple solution to the problem, I will probably leave out the integration of these programs and just work with the data, but maybe I have just overlooked something and there is a simple solution?!

      Thanks in advance,
      Qt_Bob

      P.S.: I forgot to mention:
      After pressing the QPush button, a window opens for a barely perceptible period of time and then closes again immediately.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 24 Nov 2023, 13:18 last edited by JonB
      #3

      @Qt_Bob
      As @Christian-Ehrlicher says, begin with start() so that you can debug what is going on. Slot onto errorOccurred as well as finished, and read anything which arrives on standard output or error (QProcess::readAll...()). Windows/DOS often gives some informational output as to what might be wrong. When all is working you can go back to startDetached() for your users, but with that you cannot access errors so easily.

      If the only 2 which do not work are written by you and use Qt, the most likely guess is that they are not deployed properly enough, and have an issue when run from your other program.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qt_Bob
        wrote on 24 Nov 2023, 13:25 last edited by
        #4

        Thanks for the comments, I'm about to test it and will get back to you.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          Qt_Bob
          wrote on 24 Nov 2023, 13:58 last edited by
          #5

          @Christian-Ehrlicher @JonB

          Can't I just use

              qDebug() << process.readAllStandardError();
              qDebug() << process.readAllStandardOutput();
              qDebug() << process.error();
          

          inside my open_program() Slot instead of connecting to the slots (I don't know how exactly)?!

          If I do that I get the qDebug-Output:

          QIODevice::read (QProcess): device not open
          ""
          QIODevice::read (QProcess): device not open
          ""
          QProcess::UnknownError

          So as far as I know Unknown Error == no error and the program doesn't even start right?
          I also think my problem has something to do with the deployment of the other programs.
          I think I will build them again (I built them some months ago with an older Qt version) and deploy them again.

          C 1 Reply Last reply 24 Nov 2023, 14:01
          0
          • Q Qt_Bob
            24 Nov 2023, 13:58

            @Christian-Ehrlicher @JonB

            Can't I just use

                qDebug() << process.readAllStandardError();
                qDebug() << process.readAllStandardOutput();
                qDebug() << process.error();
            

            inside my open_program() Slot instead of connecting to the slots (I don't know how exactly)?!

            If I do that I get the qDebug-Output:

            QIODevice::read (QProcess): device not open
            ""
            QIODevice::read (QProcess): device not open
            ""
            QProcess::UnknownError

            So as far as I know Unknown Error == no error and the program doesn't even start right?
            I also think my problem has something to do with the deployment of the other programs.
            I think I will build them again (I built them some months ago with an older Qt version) and deploy them again.

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 24 Nov 2023, 14:01 last edited by
            #6

            You have to use start() and not the static version startDetached().
            On how to connect signals and slots (which you should learn when you really want to use Qt): https://doc.qt.io/qt-6/signalsandslots.html

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            3
            • Q Offline
              Q Offline
              Qt_Bob
              wrote on 24 Nov 2023, 14:28 last edited by Qt_Bob
              #7

              @Christian-Ehrlicher
              Okay, that was pretty stupid of me.
              I want to get the stateChanged() signal or other signals before reading out.
              I've been using connect, signals and slots for a while now, but I'm still relatively new and it's taking me a while to understand the best way to set it up. I can't think of a good construct at the moment.

              I have now looked at it again in the dirtiest possible way (QTimer, which outputs the following every 5 ms):

              qDebug() << process.readAllStandardError();
                          qDebug() << process.readAllStandardOutput();
                          qDebug() << process.error();
                          qDebug() << process.state();
                          qDebug() << MainWindow::counter;
              

              The counter is just for counting the cycles.
              With that I still get no output, besides
              QProcess::Running
              and after ~1.5 s
              QProcess::NotRunning

              No errors or output.

              I will get more into the documentation and write it the way you mentioned.
              It may take a while, but I'll get back to you here.
              Thanks.

              P.S. I changed from startDetached() to start() for this, but the connection I mentioned wasn't working. I'm trying to get the code you mentioned done toda until 5 o' clock. If not, it may take until 4.12. until my next update. Sorry for that =/

              JonBJ 1 Reply Last reply 24 Nov 2023, 14:48
              0
              • Q Qt_Bob
                24 Nov 2023, 14:28

                @Christian-Ehrlicher
                Okay, that was pretty stupid of me.
                I want to get the stateChanged() signal or other signals before reading out.
                I've been using connect, signals and slots for a while now, but I'm still relatively new and it's taking me a while to understand the best way to set it up. I can't think of a good construct at the moment.

                I have now looked at it again in the dirtiest possible way (QTimer, which outputs the following every 5 ms):

                qDebug() << process.readAllStandardError();
                            qDebug() << process.readAllStandardOutput();
                            qDebug() << process.error();
                            qDebug() << process.state();
                            qDebug() << MainWindow::counter;
                

                The counter is just for counting the cycles.
                With that I still get no output, besides
                QProcess::Running
                and after ~1.5 s
                QProcess::NotRunning

                No errors or output.

                I will get more into the documentation and write it the way you mentioned.
                It may take a while, but I'll get back to you here.
                Thanks.

                P.S. I changed from startDetached() to start() for this, but the connection I mentioned wasn't working. I'm trying to get the code you mentioned done toda until 5 o' clock. If not, it may take until 4.12. until my next update. Sorry for that =/

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on 24 Nov 2023, 14:48 last edited by
                #8

                @Qt_Bob
                If output shows running and then not running a bit later maybe it has run to conclusion successfully with no output? How do we know what program you run and what it's supposed to do or how you know it is not working right?

                Let's be 100% clear: you must be using start() here, do not even try to use startDetached(). If you cannot get that to work something is wrong.

                Your code above should either be in readyRead.../finished/errorOccurred/stateChanged slots, or for the purpose of your test you can just go:

                process.start(...);
                qDebug() << process.waitForFinished();
                

                followed by your code. Find out why your 2 programs "do not work".

                1 Reply Last reply
                1
                • Q Offline
                  Q Offline
                  Qt_Bob
                  wrote on 24 Nov 2023, 15:11 last edited by Qt_Bob
                  #9

                  @JonB @Christian-Ehrlicher

                  Ok, I hope this is ok.
                  At least it's compiling:

                  mainwindow.h

                  #ifndef MAINWINDOW_H
                  #define MAINWINDOW_H
                  
                  #include <QMainWindow>
                  #include <QPushButton>
                  #include <QGridLayout>
                  #include <QProcess>
                  #include <QTextBrowser>
                  #include <QByteArray>
                  #include <QDebug>
                  #include <QTimer>
                  
                  QT_BEGIN_NAMESPACE
                  namespace Ui { class MainWindow; }
                  QT_END_NAMESPACE
                  
                  class MainWindow : public QMainWindow
                  {
                      Q_OBJECT
                  
                  public:
                      MainWindow(QWidget *parent = nullptr);
                      ~MainWindow();
                  
                  private:
                      Ui::MainWindow *ui;
                      QProcess *process;
                  
                  private slots:
                      void open_program();
                      void ausgabe();
                  };
                  #endif // MAINWINDOW_H
                  

                  mainwindow.cpp

                  #include "mainwindow.h"
                  #include "ui_mainwindow.h"
                  
                  MainWindow::MainWindow(QWidget *parent)
                      : QMainWindow(parent)
                      , ui(new Ui::MainWindow)
                  {
                      ui->setupUi(this);
                      QPushButton *but_open = new QPushButton("Open");
                      QGridLayout *layout = new QGridLayout();
                      layout->addWidget(but_open, 0, 0);
                      ui->centralwidget->setLayout(layout);
                      connect(but_open,SIGNAL(clicked()),this,SLOT(open_program()));
                  }
                  
                  MainWindow::~MainWindow()
                  {
                      delete ui;
                  }
                  
                  void MainWindow::open_program()
                  {
                      MainWindow::process = new QProcess();
                      QString pfad = "I:\\FabTech\\Anlagen-Dokumentation\\85 TEOS 200 mm\\Teos-Trapping\\TEOS-Überwachung\\TEOS-Abscheidungs-Programm\\TEOS_Abscheidung.exe";
                      process->start(pfad);
                      connect(MainWindow::process,&QProcess::stateChanged,this,MainWindow::ausgabe);
                      connect(MainWindow::process,&QProcess::errorOccurred,this,MainWindow::ausgabe);
                  }
                  
                  void MainWindow::ausgabe()
                  {
                      qDebug() << MainWindow::process->readAllStandardError();
                      qDebug() << MainWindow::process->readAllStandardOutput();
                      qDebug() << MainWindow::process->error();
                      qDebug() << MainWindow::process->state();
                  }
                  
                  

                  No changes to main.cpp

                  Only output I got:
                  ""
                  ""
                  QProcess::UnknownError
                  QProcess::NotRunning

                  mhhh... So in the next step I build and deploy the other programs again.
                  They are a bit complex.
                  I have a double-chained list in which data is read from a database and output in a text window.
                  The user can then enter all the data for a physical process in some QSpinBoxes, QLineEdits and so on and these are added to the database. Or the database can be searched for specific entries and so on. In addition, the open database can be archived under a specific name and archived databases can be opened, etc.
                  In any case, the program should remain open and wait for user input.

                  I can open multiple instances of the programs I want to open with my new program from Windows and never had errors or crashes (even while the new program is running). Just open it from the new program doesn't work.

                  C 1 Reply Last reply 24 Nov 2023, 15:19
                  0
                  • Q Qt_Bob
                    24 Nov 2023, 15:11

                    @JonB @Christian-Ehrlicher

                    Ok, I hope this is ok.
                    At least it's compiling:

                    mainwindow.h

                    #ifndef MAINWINDOW_H
                    #define MAINWINDOW_H
                    
                    #include <QMainWindow>
                    #include <QPushButton>
                    #include <QGridLayout>
                    #include <QProcess>
                    #include <QTextBrowser>
                    #include <QByteArray>
                    #include <QDebug>
                    #include <QTimer>
                    
                    QT_BEGIN_NAMESPACE
                    namespace Ui { class MainWindow; }
                    QT_END_NAMESPACE
                    
                    class MainWindow : public QMainWindow
                    {
                        Q_OBJECT
                    
                    public:
                        MainWindow(QWidget *parent = nullptr);
                        ~MainWindow();
                    
                    private:
                        Ui::MainWindow *ui;
                        QProcess *process;
                    
                    private slots:
                        void open_program();
                        void ausgabe();
                    };
                    #endif // MAINWINDOW_H
                    

                    mainwindow.cpp

                    #include "mainwindow.h"
                    #include "ui_mainwindow.h"
                    
                    MainWindow::MainWindow(QWidget *parent)
                        : QMainWindow(parent)
                        , ui(new Ui::MainWindow)
                    {
                        ui->setupUi(this);
                        QPushButton *but_open = new QPushButton("Open");
                        QGridLayout *layout = new QGridLayout();
                        layout->addWidget(but_open, 0, 0);
                        ui->centralwidget->setLayout(layout);
                        connect(but_open,SIGNAL(clicked()),this,SLOT(open_program()));
                    }
                    
                    MainWindow::~MainWindow()
                    {
                        delete ui;
                    }
                    
                    void MainWindow::open_program()
                    {
                        MainWindow::process = new QProcess();
                        QString pfad = "I:\\FabTech\\Anlagen-Dokumentation\\85 TEOS 200 mm\\Teos-Trapping\\TEOS-Überwachung\\TEOS-Abscheidungs-Programm\\TEOS_Abscheidung.exe";
                        process->start(pfad);
                        connect(MainWindow::process,&QProcess::stateChanged,this,MainWindow::ausgabe);
                        connect(MainWindow::process,&QProcess::errorOccurred,this,MainWindow::ausgabe);
                    }
                    
                    void MainWindow::ausgabe()
                    {
                        qDebug() << MainWindow::process->readAllStandardError();
                        qDebug() << MainWindow::process->readAllStandardOutput();
                        qDebug() << MainWindow::process->error();
                        qDebug() << MainWindow::process->state();
                    }
                    
                    

                    No changes to main.cpp

                    Only output I got:
                    ""
                    ""
                    QProcess::UnknownError
                    QProcess::NotRunning

                    mhhh... So in the next step I build and deploy the other programs again.
                    They are a bit complex.
                    I have a double-chained list in which data is read from a database and output in a text window.
                    The user can then enter all the data for a physical process in some QSpinBoxes, QLineEdits and so on and these are added to the database. Or the database can be searched for specific entries and so on. In addition, the open database can be archived under a specific name and archived databases can be opened, etc.
                    In any case, the program should remain open and wait for user input.

                    I can open multiple instances of the programs I want to open with my new program from Windows and never had errors or crashes (even while the new program is running). Just open it from the new program doesn't work.

                    C Offline
                    C Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on 24 Nov 2023, 15:19 last edited by
                    #10

                    Then please try to start the not working program from a plain command line. Maybe some dlls are missing so it can not be started.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    Q 1 Reply Last reply 24 Nov 2023, 15:27
                    0
                    • C Christian Ehrlicher
                      24 Nov 2023, 15:19

                      Then please try to start the not working program from a plain command line. Maybe some dlls are missing so it can not be started.

                      Q Offline
                      Q Offline
                      Qt_Bob
                      wrote on 24 Nov 2023, 15:27 last edited by
                      #11

                      @Christian-Ehrlicher
                      It opens normally when I execute it from cmd. So that doesn't seem to be the problem?!

                      C 1 Reply Last reply 24 Nov 2023, 15:38
                      0
                      • Q Qt_Bob
                        24 Nov 2023, 15:27

                        @Christian-Ehrlicher
                        It opens normally when I execute it from cmd. So that doesn't seem to be the problem?!

                        C Offline
                        C Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on 24 Nov 2023, 15:38 last edited by
                        #12

                        @Qt_Bob Make sure the PATH env var is the same. You can get it from QProcess::systemEnvironment() and on the command line with 'set PATH'

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        Q 1 Reply Last reply 24 Nov 2023, 15:47
                        0
                        • C Christian Ehrlicher
                          24 Nov 2023, 15:38

                          @Qt_Bob Make sure the PATH env var is the same. You can get it from QProcess::systemEnvironment() and on the command line with 'set PATH'

                          Q Offline
                          Q Offline
                          Qt_Bob
                          wrote on 24 Nov 2023, 15:47 last edited by Qt_Bob
                          #13

                          @Christian-Ehrlicher
                          That could be it, I was editing the PATH env var to set up QwtPlot last week.
                          If I get the list from QProcess::systemEnvironment() it shows all the content in PATH. What should I look out for? The QT folder and MinGW and so on are set up correctly in any case. I spent a few hours on this to get QwtPlot run and make sure everything there is correct (I wanted to use python first for my new project,...). Should the PATH env var also contain something about the two programs?

                          Edit:
                          Ok I figured it out. I let it print both QProcess::systemEnvironment() and they are the same.

                          JonBJ 1 Reply Last reply 24 Nov 2023, 16:58
                          0
                          • Q Qt_Bob
                            24 Nov 2023, 15:47

                            @Christian-Ehrlicher
                            That could be it, I was editing the PATH env var to set up QwtPlot last week.
                            If I get the list from QProcess::systemEnvironment() it shows all the content in PATH. What should I look out for? The QT folder and MinGW and so on are set up correctly in any case. I spent a few hours on this to get QwtPlot run and make sure everything there is correct (I wanted to use python first for my new project,...). Should the PATH env var also contain something about the two programs?

                            Edit:
                            Ok I figured it out. I let it print both QProcess::systemEnvironment() and they are the same.

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on 24 Nov 2023, 16:58 last edited by
                            #14

                            @Qt_Bob
                            Make sure your sub-programs do not care what the current directory is when run.

                            Put a qDebug() << "Hi there"; as first statement in sub-program, do you read that back successfully?

                            Make sub-program non-Qt, just plain Hello World, does that work?

                            Q 1 Reply Last reply 24 Nov 2023, 17:26
                            1
                            • JonBJ JonB
                              24 Nov 2023, 16:58

                              @Qt_Bob
                              Make sure your sub-programs do not care what the current directory is when run.

                              Put a qDebug() << "Hi there"; as first statement in sub-program, do you read that back successfully?

                              Make sub-program non-Qt, just plain Hello World, does that work?

                              Q Offline
                              Q Offline
                              Qt_Bob
                              wrote on 24 Nov 2023, 17:26 last edited by
                              #15

                              @JonB
                              I have made a note of this next step in my diary and will carry it out as soon as possible and report back here. However, I will probably not be able to reply until 4 December. I'm sorry, I opened this topic at an inopportune time. One of the successfully tested programmes was pure C# without Qt and it worked. The other programmes were also developed in-house (Visual Basic, Pascal, ...). Apparently only the Qt programmes cause problems, but I will test this again with a "Hello World" programme with and without Qt.
                              Many thanks for the help.

                              C 1 Reply Last reply 25 Nov 2023, 11:05
                              0
                              • Q Qt_Bob
                                24 Nov 2023, 17:26

                                @JonB
                                I have made a note of this next step in my diary and will carry it out as soon as possible and report back here. However, I will probably not be able to reply until 4 December. I'm sorry, I opened this topic at an inopportune time. One of the successfully tested programmes was pure C# without Qt and it worked. The other programmes were also developed in-house (Visual Basic, Pascal, ...). Apparently only the Qt programmes cause problems, but I will test this again with a "Hello World" programme with and without Qt.
                                Many thanks for the help.

                                C Offline
                                C Offline
                                Christian Ehrlicher
                                Lifetime Qt Champion
                                wrote on 25 Nov 2023, 11:05 last edited by
                                #16

                                @Qt_Bob said in QProcess::startDetached() doesn't work on self-written programs:

                                Apparently only the Qt programmes cause problems

                                This sounds like a deployment issue.

                                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                Visit the Qt Academy at https://academy.qt.io/catalog

                                Q 1 Reply Last reply 4 Dec 2023, 09:53
                                1
                                • C Christian Ehrlicher
                                  25 Nov 2023, 11:05

                                  @Qt_Bob said in QProcess::startDetached() doesn't work on self-written programs:

                                  Apparently only the Qt programmes cause problems

                                  This sounds like a deployment issue.

                                  Q Offline
                                  Q Offline
                                  Qt_Bob
                                  wrote on 4 Dec 2023, 09:53 last edited by
                                  #17

                                  @Christian-Ehrlicher, @JonB
                                  I deployed the two programs again and had the same problem as before. Then I went through all the deployed .dll's and there were some missing. I copied them inside the folder manually and now it works.
                                  So the problem was windeployqt or some missing windeployqt-commands while deploying.
                                  Thank you again, I'll close this topic now.

                                  1 Reply Last reply
                                  0
                                  • Q Qt_Bob has marked this topic as solved on 4 Dec 2023, 09:53

                                  • Login

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