Thread: Qt c++

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    7

    Exclamation Qt c++

    Does anyone know how to use qt creator to create a c++ app that can call a command line app

    eg could have a simple gui and you type in aurl then it is passed to wget like

    wget "what ever domain they typed in the gui"

    --update--

    i have made a gui button and when its clicked it runs popen

    seems to work via popen("wget example.com", "w");

    i don't suppose this is the proper way to achieve this, does anyone know the proper way?
    Last edited by hawlpm3; 03-26-2011 at 10:37 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Depends on what you mean by "proper way".

    If popen() is good enough for what you want, then it's probably OK. The disadvantage of popen() is you don't get process exit status values (or stuff written to stderr), so you may be missing out on important information.

    If you wanted more control, then using pipe(), fork(), exec() etc would be needed.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    10
    How would i use pipe(), fork(), exec() etc to do a "wget google.com"?

    Also i will want to return the stuff that would normally be printed into terminal into a text area in a gui

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Qt Mysql connector on windows 7 64 bit
    By luisvaldes88 in forum C++ Programming
    Replies: 3
    Last Post: 12-30-2010, 11:45 AM
  2. QT Help
    By anirban in forum Linux Programming
    Replies: 2
    Last Post: 04-13-2010, 06:07 AM
  3. Any QT users out there - on a Mac?
    By Dino in forum C++ Programming
    Replies: 9
    Last Post: 09-29-2009, 07:00 PM
  4. QT or others for the beginning linux programmer
    By FillYourBrain in forum Linux Programming
    Replies: 3
    Last Post: 09-12-2003, 01:17 PM
  5. First QT App
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-26-2002, 09:30 AM