Results 1 to 2 of 2

Thread: Number of folder

  1. #1
    Join Date
    Dec 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Number of folder

    Hi all,

    I am wondering if there is any way to count number of folders in a particular folder. I am not interested in counting sub folders.


    Tnx,
    Benjamin

  2. #2
    Join Date
    May 2007
    Location
    Germany
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Number of folder

    Hello,

    perhaps this is the way to go.

    Qt Code:
    1. QDir folder = QDir(___PATH___);
    2. folder.setFilter( QDir::Dirs | QDir::NoSymLinks);
    3.  
    4. QStringList dirListing= folder.entryList(QDir::NoDotAndDotDot | QDir::AllDirs);
    To copy to clipboard, switch view to plain text mode 

    after all you can use the function dirListing.count() to get the amount of the files in the specified dir.

    use it witout any warranty I am a beginner ;O))

Similar Threads

  1. qdirmodel question: show file number of a folder?
    By zl2k in forum Qt Programming
    Replies: 3
    Last Post: 7th November 2008, 07:07
  2. Path to the previous folder
    By Zergi in forum Newbie
    Replies: 2
    Last Post: 15th July 2008, 18:24
  3. Line Number - QTextEdit...???
    By deepusrp in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 16:34
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. get error number from qsqldatabase
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2007, 10:20

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.