Results 1 to 7 of 7

Thread: how to Qprocess

  1. #1
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default how to Qprocess

    1) how to call another c program when i click the button.
    2) i generated the source code using uic from an ui file. then tried to use them and something like this
    consider x1.h and x1.cpp are the files created
    i did
    x1.pro
    CONFIG+=QT
    HEADER=X1.H
    SOURCES+=X1.CPP
    TARGET=X1

    AND THEN TRIED QMAKE.
    THEN WHILE MAKE I GOT AN ERROR LIKE VTABLE ERROR
    WHAT SHUD I DO

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

    Default Re: Help Me

    Quote Originally Posted by shrikarcse
    1) how to call another c program when i click the button.
    Use QProcess class.

    2) i generated the source code using uic from an ui file. then tried to use them and something like this
    AND THEN TRIED QMAKE.
    THEN WHILE MAKE I GOT AN ERROR LIKE VTABLE ERROR
    WHAT SHUD I DO
    1. Don't shout
    2. There can be many reasons for that. For example that you put a Q_OBJECT containing class definition and implementation in one file.

  3. The following user says thank you to wysota for this useful post:

    shrikarcse (28th March 2006)

  4. #3
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default how to Qprocess

    i want to execute a c program when i click a button on the form how shud i do it.
    i heard we need to use qprocess for it but did not execute.
    here are the steps i carried out
    1) i have a button called execute in the form
    2) i created a function by using edit slot called runprog( )
    in that function i have some thing like this
    when i clicked the execute button and said source it asked me to create ui.h ?
    then when i said yes
    it gave me a function called
    runprog()
    {
    Qprocess *proc=new Qprocess(0);
    proc->addArgument("/home/shrikar/hello"); // here hello is the executable
    proc->start( )
    }
    it did not give any results
    please help me

  5. #4
    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: QProcess help

    1) Don't double post, please..
    2) Use [ code ] tags around posted code blocks
    3) What is the expected "result"? Is it a GUI or console app?

  6. #5
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QProcess help

    both are there a gui application as well as a console application

  7. #6
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QProcess help

    What is it you do in the hello program?

    If you write something to standard out, it is indeed not printed. The output of the child process is automatically caught in the QProcess, and can be retrieved by the readLineStdOut() function. If you don't read from the process, the output is never shown.

    Try writing to a file in hello or read the output from the process. That should convince you the program is running.

  8. The following user says thank you to Beluvius for this useful post:

    shrikarcse (31st March 2006)

  9. #7
    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 Qprocess

    @shrikarcse: Please, don't start multiple threads on the same problem or else...

Similar Threads

  1. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  2. QProcess exitStatus()
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:51
  3. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  5. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30

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.