Very basic deployment questions
-
Thanks Sgaist,
When I removed QT += widgets, it started giving me all sorts of error in server.cpp and server.h with all Qt files like Qtdialog etc. don't think it's as straightforward as that or am i not understanding something very basic. Granted it's been more than 8 hours on this issue for me.
The web service thought has crossed my mind more than once. Only question is if I have to go that route why not drop Qt alltogether and use something like cgi etc though I am inclined to learn Qt for long term benefits. -
Well, if you are using widget related stuff in your server code the your can't drop the dependency. Since the code is meant to be command line only (if I understood your correctly) then don't put any widgets in there. Make a separate application that knows how to talk to your cli application.
You an also write it in Qt ;-)
But it is up to you. Use the tool that is best suited for your needs :-) -
Yes, it's possible, take a loot at the Qt Cloud Services
-
Indeed, it's a new service Digia is offering.
Yes they can, but you need to deploy the thing properly using e.g. the offscreen plugin. The real question here is: does make sense to have the GUI builtin that server software or should it rather be a pure CLI where you provide a secondary GUI software that uses that CLI ?
-
Thanks Sgaist,
My plan is to have two softwares only. One a pure cli which is run on server side and a command ui which communicates with the CLI.
I want gui to be able to just start stop the cli and retrieve some data from cli when needed.
Also, want to be able to see all the std output from cli on the gui side. -
Then QProcess is your friend
-
SGaist,
I was trying to play around with QProcess. I built a ui with widgets and added just one button. on button click I added a Qprocess code to start a precompiled c++ executable. Here it is. But when I click the button it fails and crashes. I picked the code from QProcess page on the site itself.@
void MainWindow::on_startButton_clicked()
{
QObject * parent;
QString program = "./path/exec";
QStringList arguments;
arguments << "";QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments);
}
@[edit: added missing coding tags @ SGaist]
-
I changed the code in click function to below.
Now it doesn't give any errors but still I don't see any result files generated by the execution@
QString program = "./path/exec";
QProcess *myProcess = new QProcess(this);
myProcess->start(program);
@[edit: added missing coding tags @ SGaist]
-
In you first example parent is not initialized hence the crash.
"./path/exec" is a relative path to the current path. You should rather give the fullpath to exec.