Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27

Thread: [question]redirecting stdout to display via widget?

  1. #21
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    As Wysota says:
    connect to the appropriate signal
    QProcess::readyReadStdout() is a PyQt3 signal. Check all of your functions against the doc that you linked in post #14.

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [question]redirecting stdout to display via widget?

    Quote Originally Posted by fantagol View Post
    ....Where is the mistake?
    The mistake is you are trying to use a signal that doesn't exist.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #23
    Join Date
    Apr 2011
    Posts
    9
    Qt products
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    Yeah.... i found the mistake this morning, The correct signals are:
    Qt Code:
    1. readyReadStandardOutput()
    2. readyReadStandardError()
    To copy to clipboard, switch view to plain text mode 
    but now i read the text printed by test1.py only when the process is terminated.
    I'd like to read line by line while it is running

  4. #24
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    A forum search yielded a similar thread.

    For Python read the manual page: man python

  5. #25
    Join Date
    Apr 2011
    Posts
    9
    Qt products
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    I can't modify the original test1.py script and flushing device after print.

  6. #26
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    From man python:
    -u Force stdin, stdout and stderr to be totally unbuffered.
    So just pass the "-u" switch as an argument when you call QProcess::start().

  7. #27
    Join Date
    Apr 2011
    Posts
    9
    Qt products
    Platforms
    Unix/X11

    Default Re: [question]redirecting stdout to display via widget?

    It Works!!!! Thanks so much norobro and wysota!!
    What book you advise me to read about Qt an python? Rapid gui?

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. How to display selected columns in QTableView widget.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 08:30
  3. Replies: 4
    Last Post: 10th March 2007, 18:01
  4. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07
  5. Replies: 3
    Last Post: 12th April 2006, 08:20

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.