Results 1 to 2 of 2

Thread: Need to Execute an system command, in QT

  1. #1
    Join Date
    Nov 2014
    Posts
    54
    Thanks
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Need to Execute an system command, in QT

    hi,
    I need to execute an system command in QT-4.7.4 and i am unable to get how to execute and what classes to be used,
    here is the command i need to use..

    sprintf(str,"/sbin/udhcpc eth0 -T 5 -n");
    system(str);

    This is a code that i use in "C",
    please help/guide me to execute the command in QT

    thanks in advance,
    rohith.g

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Need to Execute an system command, in QT

    Take a look at the QProcess class. Another thing is that Qt is a C++ library, so your C code should work when used in Qt based project.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Execute system command from QProcess
    By graciano in forum General Programming
    Replies: 6
    Last Post: 20th February 2014, 11:05
  2. How to execute Powershell command from QT?
    By Gokulnathvc in forum Newbie
    Replies: 3
    Last Post: 22nd January 2014, 00:30
  3. Execute multiple sql command in SQLITE3
    By karankumar1609 in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2013, 12:43
  4. Replies: 4
    Last Post: 14th July 2009, 04:27
  5. Ho to use signals and slots to execute a command?
    By claudio-cit in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2008, 23:01

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.