Results 1 to 5 of 5

Thread: New to QT Programming

  1. #1
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    1

    Default New to QT Programming

    Right im new to QT programming so I thought for my first app I would try to write a wireless driver manager which will use ndiswrapper on the command line using system(); but the following piece of code which I am using to show all the drivers already installed just comes up as a square in the textBrowser

    Qt Code:
    1. QString output;
    2. output = system("ndiswrapper -l");
    3. textBrowser->setText(output);
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New to QT Programming

    And what is "system"?
    Why don't use QProcess?

    Regards

  3. #3
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    1

    Default Re: New to QT Programming

    system() simply just allows you to execute shell scripts but I can then parse the output. How would I use QProcess??

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: New to QT Programming

    Read the docs for QProcessYou should call:
    Qt Code:
    1. process.start("ndiswrapper -l");
    2. process.waitForFinished();
    3. QByteArray outArray = processl.readAllStandardOutput();
    4. QString str = outArray.constData();
    To copy to clipboard, switch view to plain text mode 

    Something like that.
    This is just a draft so you might wanna improve that a bit( extra checks for return values, etc).

    Regards

  5. The following user says thank you to marcel for this useful post:

    Charlie (22nd August 2007)

  6. #5
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    1

    Default Re: New to QT Programming

    Thanks Thats great help.

Similar Threads

  1. Network programming and the main thread
    By invictus in forum Qt Programming
    Replies: 5
    Last Post: 16th March 2007, 01:25
  2. QT COM Programming
    By sarav in forum Newbie
    Replies: 5
    Last Post: 24th February 2007, 14:41
  3. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 12:04
  4. Replies: 2
    Last Post: 17th October 2006, 20:25
  5. MODEL/VIEW programming
    By mira in forum Newbie
    Replies: 3
    Last Post: 21st April 2006, 12:19

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.