QProcess - unexpected behaviour with execute()
-
Seriously guys, did nobody had such problem before??
It's quite weird.... -
Hi,
It's not really hardcoded (in a sense), it's the default used by your system (technically for all *nix 80x24). If you change it, you should see the new value instead.
-
Hi and thanks for the response.
Indeed I didn't thought that probably these numbers are the defaults for the linux boxes. 80x24 seems pretty low nowdays, not sure why would linux devs keep going at it. Still, as I mentioned in my post, execute() cannot be used as it returns the exit status only and start() returns wrong result, at least within my project and test case.
I couldn't find a workaround, so I ended up using "popen" instead, but I would really like to use QProcess or whatever else may be relevant and considered to be the Qt way.If you can see a flaw in what I tried, or if you can suggest another way of actually clearing the screen in a console application, I would be most grateful. My project is pretty much on hold for now with one of the reasons being the problem with clearing the screen (which also flickers during these updates, so I can't do them too often :( )
-
Maybe low, but compatible with current and older devices and also if you don't have a graphic server. And don't forget python :)
Anyway, can you explain what your application should exactly do ?
-
I am trying to build an application which updates the screen every second (or twice every second) with information which it reads from a resource - file, socket, anything. Pretty much sort of a monitoring of live stats (like mytop, (h)top, etc). What I couldn't do is clear the screen in a way it wouldn't flicker and also get the size of the terminal. What I used is the linux "tput" command and was trying to execute it with QProcess::execute or QProcess::start.
Is there anything in Qt which I couldn't find that would provide me with information about the terminal size and also is there anything in Qt which would allow me to clear the terminal without executing external application? If not, how can I do this with QProcess, since it doesn't work correctly, as I described in my first post.
-
I am trying to build an application which updates the screen every second (or twice every second) with information which it reads from a resource - file, socket, anything. Pretty much sort of a monitoring of live stats (like mytop, (h)top, etc). What I couldn't do is clear the screen in a way it wouldn't flicker and also get the size of the terminal. What I used is the linux "tput" command and was trying to execute it with QProcess::execute or QProcess::start.
Is there anything in Qt which I couldn't find that would provide me with information about the terminal size and also is there anything in Qt which would allow me to clear the terminal without executing external application? If not, how can I do this with QProcess, since it doesn't work correctly, as I described in my first post.
-
Something 's not clear, is it a console application (QCoreApplication) Or do you want to show your content in a console from your GUI ?
-
Something 's not clear, is it a console application (QCoreApplication) Or do you want to show your content in a console from your GUI ?
-
Ugh, sorry for the late response, been busy with work and didn't do much about that project.
Yes, it's a QCoreApplication, it's application which is supposed to output stuff into the terminal once started. What I am trying to do is call external application to clean the terminal window of previous text and replace it with new one. Was just surprised by QProcess behaviour and was looking for a more Qt way then using popen(). When I use the external application (called "tput"), I kind of get the behaviour I want, but it gives it sort of a flickering, which makes me think what I use is not quite optimal.....
-
Ugh, sorry for the late response, been busy with work and didn't do much about that project.
Yes, it's a QCoreApplication, it's application which is supposed to output stuff into the terminal once started. What I am trying to do is call external application to clean the terminal window of previous text and replace it with new one. Was just surprised by QProcess behaviour and was looking for a more Qt way then using popen(). When I use the external application (called "tput"), I kind of get the behaviour I want, but it gives it sort of a flickering, which makes me think what I use is not quite optimal.....