Results 1 to 2 of 2

Thread: QListView and QDirModel

  1. #1
    Join Date
    Feb 2008
    Posts
    1

    Default QListView and QDirModel

    Hi,

    I try to use a QDirModel and a QListView to display bitmap Images in directories.

    After defining my QDirModel, I defined my QListView to display images like this :
    Qt Code:
    1. listView->setModel(model);
    2. listView->setRootIndex(model->index("C:\\"));
    To copy to clipboard, switch view to plain text mode 

    But when I tried to do the same thing to change my directory
    Qt Code:
    1. listView->setRootIndex(model->index("C:\\OtherDirectory"));
    To copy to clipboard, switch view to plain text mode 
    onto a function, it doesn't work.

    Anything wrong ?

    thanks
    Bruno
    Last edited by jpn; 4th February 2008 at 16:37. Reason: missing [code] tags

  2. #2
    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: QListView and QDirModel

    Hmm, it should "work" provided that it's a valid path. Have you noticed [wiki]Extended Dir View example[/wiki]?
    J-P Nurmi

Similar Threads

  1. QListView trouble accepting drops
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 6th September 2007, 19:49
  2. QDialog / QListView problem
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 18:31
  3. QDirModel
    By L.Marvell in forum Newbie
    Replies: 2
    Last Post: 5th June 2007, 14:47

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.