Results 1 to 3 of 3

Thread: Windows Batchfile Output to Form

  1. #1
    Join Date
    Aug 2017
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Question Windows Batchfile Output to Form

    Hi. New QT user here, apologies is this is a stupid question.

    Is it possible to run a batch file (with QProcess) and have the output of said batchfile be sent to a widget inside of my MainWindow inside of Qt Creator? I'm reading the documentation on all the different widget types, but maybe I should see if this is even possible...

    Thanks in advance.

    teak
    A little bit of nonsense now and then is cherished by the wisest men...
    - Willy Wonka

  2. #2
    Join Date
    Jul 2008
    Posts
    405
    Thanks
    9
    Thanked 52 Times in 50 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Windows Batchfile Output to Form

    Hi, if you don't really need the batch file, then QProcess::readAllStandardOutput() might help, but you probably will not get the output of the batch file (that has normally been printed to a cmd window).
    Maybe you could redirect the output to a file and read that.

    Ginsengelf

  3. #3
    Join Date
    Aug 2017
    Posts
    3
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Windows Batchfile Output to Form

    Quote Originally Posted by Ginsengelf View Post
    Hi, if you don't really need the batch file, then QProcess::readAllStandardOutput() might help, but you probably will not get the output of the batch file (that has normally been printed to a cmd window).
    Maybe you could redirect the output to a file and read that.

    Ginsengelf
    That would be fine as well... But, when I run the QProcess I see in task manager that the cmd window is opened, but the actual CMD "DOS" box doesn't show up on the screen...that's why I thought I would move it to the MainWindow. Thanks for your insight.

    teak
    A little bit of nonsense now and then is cherished by the wisest men...
    - Willy Wonka

Similar Threads

  1. Replies: 2
    Last Post: 29th March 2017, 18:09
  2. Replies: 7
    Last Post: 1st February 2013, 00:36
  3. Urgent : Form updates not displayed on the output
    By seanasl in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2012, 14:51
  4. console output on windows and ubuntu
    By hannesvdc in forum Qt Programming
    Replies: 2
    Last Post: 11th December 2010, 22:43
  5. Windows debuging output?
    By llemes4011 in forum Qt Programming
    Replies: 3
    Last Post: 3rd August 2010, 00:01

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.