Results 1 to 10 of 10

Thread: How to run a console program "silently"?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    Nop!

    I start them through a QProcess object, and not QProcess::startDetached(), itself owned by a running non-GUI QThread.
    Current Qt projects : QCodeEdit, RotiDeCode

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    I've created a small test:
    Qt Code:
    1. #include <QApplication>
    2. #include <QProcess>
    3. #include <QMessageBox>
    4. #include <QString>
    5.  
    6. int main( int argc, char **argv )
    7. {
    8. QApplication app( argc, argv );
    9.  
    10. QProcess proc;
    11. proc.start("g++ --version");
    12. proc.waitForFinished();
    13.  
    14. QString output( proc.readAllStandardOutput() );
    15.  
    16. QMessageBox::information( 0, "test", output );
    17.  
    18. return 0;
    19. }
    To copy to clipboard, switch view to plain text mode 
    and it doesn't open console window. Maybe this is because you start QProcess in another thread?

  3. #3
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    This does not work...

    Mmmh, yes it does work but the console windows still appears... It must be specific to Win 9x/ME ...
    Current Qt projects : QCodeEdit, RotiDeCode

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    Quote Originally Posted by fullmetalcoder
    It must be specific to Win 9x/ME ...
    It could be, I've tested above program on windows XP.

  5. #5
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run a console program "silently"?

    win9x/ME ??? I thought they died quite a while ago....

  6. #6
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    do you? You were wrong then... There at least on winME still running on that good old Earth!

    But is that the point anyway?
    Current Qt projects : QCodeEdit, RotiDeCode

  7. #7
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to run a console program "silently"?

    "Good old earth"? Isn't WinME famous of it's memory leaks and stuff. I thought it's maybe the worst Windows ever..
    J-P Nurmi

  8. #8
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run a console program "silently"?

    It certainly is a great piece of Window$-coding with all the bugs and leaks it implies... AFAI Used it it crashes 1 time over 3 at run-time!!! Impressive, huh? Tha's why I'm using Fedora most of the time, but as it is the only Window$ I've got I use it to test my code so...
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Release my simple program to other users ?
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 9th July 2006, 23:42
  2. Console Program Problem
    By ball in forum Qt Programming
    Replies: 9
    Last Post: 28th May 2006, 09:05
  3. Replies: 1
    Last Post: 17th May 2006, 00:23
  4. why does qt program meet segmentation fault?
    By wquanw in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 15th May 2006, 16:52
  5. Enter key causing program to exit
    By welby in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2006, 16:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.