Код: Выделить всё
// Restart app
void gui::restartapp()
{
int index_combo;
index_combo= ui->devices_infile->currentIndex();
QProcess::startDetached(QApplication::applicationFilePath());
QCoreApplication::exit()
char *dest;
dest = addr_infile[index_combo];
sock = linkup_directmain(dest, sock);
if (sock != 0 && sock >0)
{
ui->console_1->setText("Connected to:");
ui->console_2->setText(name_infile[index_combo]);
}
else if (sock == -1)
{
ui->console_1->setText("Error connecting");
ui->console_2->setText("Check device status");
}
}
Подробнее здесь: https://stackoverflow.com/questions/153 ... e-previous