Results 1 to 2 of 2

Thread: something abourt the QDirModel

  1. #1
    Join Date
    May 2010
    Location
    China
    Posts
    66
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Post something abourt the QDirModel

    i used below code to create a widget inheriting form QTreeView,and used the QDIrModel to show the dir
    but i did't want to have some folders to have the function to back the parent folder,
    Qt Code:
    1. projectModel=new QDirModel;
    2. projectModel->setFilter(QDir::Files|QDir::Dirs);
    3. projectModel->setResolveSymlinks(true);
    4. this->setModel(projectModel);
    5. this->setRootIndex(projectModel->index(projectAddressString,0));
    To copy to clipboard, switch view to plain text mode 


    and it looks like this

    dd..png

  2. #2
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: something abourt the QDirModel

    Try using QDir::NoDotAndDotDot.

Similar Threads

  1. QDirModel and FTP
    By last2kn0 in forum Qt Programming
    Replies: 5
    Last Post: 19th April 2008, 00:02
  2. QDirModel curiosity
    By Caius Aérobus in forum Qt Programming
    Replies: 0
    Last Post: 4th April 2008, 18:08
  3. QDirModel
    By rvb13 in forum Qt Programming
    Replies: 2
    Last Post: 2nd November 2007, 16:03
  4. QDirModel
    By L.Marvell in forum Newbie
    Replies: 2
    Last Post: 5th June 2007, 14:47
  5. QDirModel::setNameFilters
    By Smudge in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2006, 14:47

Tags for this Thread

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.