Нужно, чтоб при клике на кнопку, запускалось приложение.
MainWindow::MainWindow()
{ more = new QProcess(this);
QPushButton *but = new QPushButton;
setCentralWidget(but);
connect(but, SIGNAL(clicked()),this,SLOT (vvod()));
}
void MainWindow::vvod()
{
more.start("C:/Qt_myProgramm/build-textVvod-Desktop-Debug/debug/textVvod"); //путь до .exec
more.waitForFinished(50000);
}
Выдает ошибки:
C:\Qt_myProgramm\popitkaProcess\mainwindow.cpp:-1: In member function 'void MainWindow::vvod()':
C:\Qt_myProgramm\popitkaProcess\mainwindow.cpp:16: ошибка: request for member 'start' in '((MainWindow*)this)->MainWindow::more', which is of non-class type 'QProcess*'
C:\Qt_myProgramm\popitkaProcess\mainwindow.cpp:17: ошибка: request for member 'waitForFinished' in '((MainWindow*)this)->MainWindow::more', which is of non-class type 'QProcess*'