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
TARGET = textDrive
TEMPLATE = app
SOURCES = main.cpp
QT -= gui
To copy to clipboard, switch view to plain text mode
main.cpp
#include <QCoreApplication>
#include <QProcess>
#include <QStringList>
#include <QDebug>
int main (int argc, char *argv[])
{
proc
->start
("konsole",
QStringList() <<
"--hide-menubar" <<
"-e" <<
"/home/dejan/projects/linux/txtdrive/textDrive");
qDebug() << "Console application running!";
return app.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
I'm running it on Arch Linux.
Thank you for your help,
Dejan
Bookmarks