gojkovicde
9th December 2012, 16:53
Hi,
I want to create an application that will open a terminal. The terminal should be the main window of the application.
I'd use custom classes, and show member values, and function results in the terminal.
The problem is that when I run the application (code below), it keeps opening terminals (one each second) until I close it.
It wouldn't open just one instance of a terminal. I know that app.exec() creates a loop, but I've seen posts all over the Internet
where people do open external programs using QProcess in the same manner.
textdrive.pro
TARGET = textDrive
TEMPLATE = app
SOURCES = main.cpp
QT -= gui
main.cpp
#include <QCoreApplication>
#include <QProcess>
#include <QStringList>
#include <QDebug>
int main (int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QProcess *proc = new QProcess(&app);
proc->start("konsole", QStringList() << "--hide-menubar" << "-e" << "/home/dejan/projects/linux/txtdrive/textDrive");
qDebug() << "Console application running!";
return app.exec();
}
I'm running it on Arch Linux.
Thank you for your help,
Dejan
I want to create an application that will open a terminal. The terminal should be the main window of the application.
I'd use custom classes, and show member values, and function results in the terminal.
The problem is that when I run the application (code below), it keeps opening terminals (one each second) until I close it.
It wouldn't open just one instance of a terminal. I know that app.exec() creates a loop, but I've seen posts all over the Internet
where people do open external programs using QProcess in the same manner.
textdrive.pro
TARGET = textDrive
TEMPLATE = app
SOURCES = main.cpp
QT -= gui
main.cpp
#include <QCoreApplication>
#include <QProcess>
#include <QStringList>
#include <QDebug>
int main (int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QProcess *proc = new QProcess(&app);
proc->start("konsole", QStringList() << "--hide-menubar" << "-e" << "/home/dejan/projects/linux/txtdrive/textDrive");
qDebug() << "Console application running!";
return app.exec();
}
I'm running it on Arch Linux.
Thank you for your help,
Dejan