Results 1 to 2 of 2

Thread: QProcess output in TreeView?!?

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QProcess output in TreeView?!?

    I wish to create a front end for the GNU "locate" tool on my system. What I am not able to figure out is how to get the output from locate (using Qprocess) and display it in a QTreeView? The user should be able to click on the column header and be able to sort the entries. How do I do this?

    Example:

    $> locate openoffice.png

    Output:


    /home/nupul/trials/menus/progs/fav_progs/openoffice.png
    /opt/gnome/share/icons/hicolor/16x16/stock/generic/stock_openoffice.png
    /opt/gnome/share/icons/hicolor/32x32/stock/generic/stock_openoffice.png
    /opt/kde3/share/icons/hicolor/16x16/apps/openoffice.png
    /opt/kde3/share/icons/hicolor/32x32/apps/openoffice.png
    /opt/kde3/share/icons/hicolor/48x48/apps/openoffice.png
    /opt/kde3/share/icons/hicolor/64x64/apps/openoffice.png
    Thanks!

    Nupul

    PS: any suggestions to improve this front end are more that welcome!

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QProcess output in TreeView?!?

    Read this
    This post about use reading from stdout. After read You get result in byte array. After that create string and split it with separator "\n". Then for every new string create QtreeWidgetItem.
    I think it must worked
    a life without programming is like an empty bottle

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

    nupul (2nd May 2006)

Similar Threads

  1. Replies: 7
    Last Post: 8th May 2009, 10:26
  2. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  3. Replies: 2
    Last Post: 2nd June 2008, 08:45
  4. QProcess and capturing output
    By Aragorn in forum Qt Programming
    Replies: 7
    Last Post: 3rd May 2007, 16:57
  5. QProcess : child process listening parent output ?
    By Nyphel in forum Qt Programming
    Replies: 16
    Last Post: 20th March 2007, 13:40

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.