Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess - unexpected behaviour with execute()
Forum Updated to NodeBB v4.3 + New Features

QProcess - unexpected behaviour with execute()

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robbin
    wrote on last edited by
    #2

    Seriously guys, did nobody had such problem before??
    It's quite weird....

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Robbin
        wrote on last edited by
        #4

        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 :( )

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #5

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Robbin
            wrote on last edited by
            #6

            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.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Robbin
              wrote on last edited by
              #7

              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.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                Something 's not clear, is it a console application (QCoreApplication) Or do you want to show your content in a console from your GUI ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  Something 's not clear, is it a console application (QCoreApplication) Or do you want to show your content in a console from your GUI ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Robbin
                    wrote on last edited by
                    #10

                    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.....

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Robbin
                      wrote on last edited by
                      #11

                      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.....

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved