Results 1 to 5 of 5

Thread: a QProcess thing

  1. #1
    Join Date
    Jul 2010
    Posts
    63
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default a QProcess thing

    I'm trying to run tasm (turbo assembler compiler) using a QProcess, but I'm having problems..
    here's the relavent code:

    output_win - a QTextEdit
    srcTarget_line - a QLineEdit

    Qt Code:
    1. bool OMGASM::mainWin::compileSrc()
    2. {
    3. QString program = "TC/BIN/tasm.exe";
    4. QStringList arguments;
    5. arguments <<srcTarget_line->text();
    6.  
    7. QProcess *p = new QProcess();
    8. p->start(program, arguments);
    9.  
    10. p->waitForStarted();
    11. p->waitForReadyRead();
    12. p->waitForFinished();
    13.  
    14. output_win->append( p->errorString() );
    15. output_win->append( p->readAllStandardError() );
    16. output_win->append( p->readAll() );
    17.  
    18. p->terminate();
    19. delete p;
    20. return true;
    21. }
    To copy to clipboard, switch view to plain text mode 
    all i get is "unknown error" on my 'output_win'.. (and it did not compile)

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: a QProcess thing

    Without looking deep in to the code the path
    "TC/BIN/tasm.exe";
    can't be right.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jul 2010
    Posts
    63
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: a QProcess thing

    the TC folder is in the same folder as my EXE, so i think it is..


    i cant make my QString convert to something i can use as the argument of QProcess::write() .. how to?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: a QProcess thing

    so i think it is..
    No its not.
    it should be
    "./TC/BIN/tasm.exe";
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jul 2010
    Posts
    63
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: a QProcess thing

    Quote Originally Posted by high_flyer View Post
    No its not.
    ;
    yes it IS
    j/k


    figured it out anyhow,
    i started cmd first, and wrote the command to it
    problem was i sent a c_str instead of ascii to cmd.. thanks anyways

Similar Threads

  1. Move that thing!
    By Archa4 in forum Newbie
    Replies: 8
    Last Post: 23rd February 2011, 14:22
  2. KDChart. What do you thing about?
    By Nadia in forum Qt-based Software
    Replies: 1
    Last Post: 15th February 2011, 01:55
  3. doing a thing after the form is displayed
    By franco.amato in forum Newbie
    Replies: 3
    Last Post: 26th January 2011, 05:05
  4. Very strange thing
    By Sheng in forum Qt Programming
    Replies: 4
    Last Post: 21st October 2008, 22:44
  5. There is QTimeEdit another thing in Qt4
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 26th May 2006, 16:06

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.