Results 1 to 2 of 2

Thread: QDir sort by QDir::Type problem

  1. #1
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default QDir sort by QDir::Type problem

    mkdir bbd ssd
    touch cca ccb

    when use QDir like this

    Qt Code:
    1. QDir mydir("/path");
    2.  
    3. QStringList desktopList = mydir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden |QDir::System, QDir::Type );
    4.  
    5. qDebug() << "desktopList" << desktopList;
    To copy to clipboard, switch view to plain text mode 
    the right result is :
    bbd ssd cca ccb

    but
    result is :
    bbd cca ccb ssd


    bbd,ssd is dir

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QDir sort by QDir::Type problem

    You forgot the QDir:irsFirst sort flag.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    tsuibin (19th February 2016)

Similar Threads

  1. Replies: 2
    Last Post: 9th July 2012, 19:07
  2. qt 4.8.1 and qdir entryInfoList problem
    By moti.lahiani in forum Qt Programming
    Replies: 3
    Last Post: 18th April 2012, 11:56
  3. Problem with QDir::cdUp()
    By nuntawat in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2010, 01:15
  4. QDir - Entrylist, sort
    By bismitapadhy in forum Qt Programming
    Replies: 5
    Last Post: 28th January 2010, 06:27
  5. QDir Path problem
    By ToddAtWSU in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2008, 12:15

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.