Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDir with nameFilters
Qt 6.11 is out! See what's new in the release blog

QDir with nameFilters

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    c0debreak
    wrote on last edited by
    #1

    Hi

    How do I use QDir::nameFilters only for files, but not on folders?
    It seems to apply for any entries.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #2

      Assume, Folder1 contains, file1,file2 & folder2. And folder2 contains file3.

      How will you select file3, when you can't see folder1 ??

      EDIT : typo


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        poor_robert
        wrote on last edited by
        #3

        Try:

        QFileInfoList QDir::entryInfoList ( Filters filters = NoFilter, SortFlags sort = NoSort ) const;

        and set filters to: QDir::Files

        and then You can use filter on file list

        I'm not sure if this shows files from 'recursive' directories, but might work.

        rob

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved