Results 1 to 4 of 4

Thread: QDir::setNameFilters not working, bug?

  1. #1
    Join Date
    Nov 2007
    Location
    Lithuania
    Posts
    16
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Unhappy QDir::setNameFilters not working, bug?

    i tried set NameFilters:
    1. in QDir constructor
    2. as entryList parameter
    3. with setNameFilters function


    if i set name filter to "*.*" i see dir contents, but if i change it to, for example, "*.txt" i see no files(with entryList), i am sure there is *.txt file(s). Bug?
    Is QDir name filters working for you?

    I am using Qt 4.3.4, Ubuntu 8.04

  2. #2
    Join Date
    May 2008
    Location
    London, UK
    Posts
    8
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDir::setNameFilters not working, bug?

    Quote Originally Posted by saugumas View Post
    Is QDir name filters working for you?

    I am using Qt 4.3.4, Ubuntu 8.04
    Name Filters works for me with the same Qt version and OS. Perhaps you could paste the code that you're using? Chances are you've made a mistake there...


    Cheers,

  3. #3
    Join Date
    Nov 2007
    Location
    Lithuania
    Posts
    16
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QDir::setNameFilters not working, bug?

    Qt Code:
    1. QDir Dir(DirName);
    2. QStringList Contents, Filtering;
    3. Filtering << "*.dat";
    4. Contents = Dir.entryList();
    5. //or Contents = Dir.entryList(Filtering, QDir::NoFilter, QDir::NoSort);
    To copy to clipboard, switch view to plain text mode 

    I see only "." and "..", but when I change filter to "*.*" I see all files. I am sure there are files with "*.dat" extension.

  4. #4
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDir::setNameFilters not working, bug?

    Can you post compilable code that shows how you both list all files, and how you print the output that shows what this list contains? There are no known bugs in this function AFAIK.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

Similar Threads

  1. QDevelop and CTags -> Not working
    By philwinder in forum Qt-based Software
    Replies: 13
    Last Post: 9th May 2008, 21:40
  2. Don't want QTextBrowser to look in working directory
    By magland in forum Qt Programming
    Replies: 1
    Last Post: 20th October 2007, 23:14
  3. GUI thread and Working thread comunication
    By FasTTo in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2007, 15:31
  4. Replies: 1
    Last Post: 11th June 2006, 22:25
  5. Signals/Slots stopped working
    By Jimmy2775 in forum Qt Programming
    Replies: 8
    Last Post: 31st March 2006, 21:11

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.