I would like to launch mysql from GUI using QProcess
. I've tried the following:
QStringList arguments;
arguments << QString("-u%1").arg("myaccount")<< QString("-p%2").arg("password");
QProcess *mysql = new QProcess;
mysql->setReadChannelMode(QProcess::ForwardedChannels);
mysql->execute("mysql", arguments);
if(mysql->waitForReadyRead(-1))
qDebug(mysql->readAllStandardOutput());
But, there is big problem as it's mentioned in Qt Documentation, it's gonna freeze.
How can I solve this? Many advised to use QThread
but I don't have any idea how to do that?
Thanks beforehand!