Results 1 to 4 of 4

Thread: filesysteme avec Qt

  1. #1
    Join Date
    May 2009
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default filesysteme avec Qt

    hello ,
    i have to change from wxwidget to qt ,the problem is that i cant find a remplacement of wxfilesysteme in qt.

    that's my code:

    Qt Code:
    1. {
    2. QString wildCard = "";
    3. QString fileName = "";
    4.  
    5. lstFolderFiles->clear();
    6.  
    7. fileSystem->ChangePathTo( txtFolderSource->GetValue(), true );
    8.  
    9. for( int i = 1, j = 0; i < formatsCount; i ++ )
    10. {
    11. wildCard += wxT( "*." ) + formats[ i ][ 1 ];
    12.  
    13. fileName = fileSystem->FindFirst( wildCard, wxFILE );
    14.  
    15. if( fileName != wxEmptyString )
    16. {
    17. do
    18. {
    19. lstFolderFiles->AppendAndEnsureVisible( fileName );
    20.  
    21. if( radAllFolderSourceFiles->GetValue() )
    22. {
    23. lstFolderFiles->Check( j ++ );
    24. }
    25. }
    26. while( ( fileName = fileSystem->FindNext() ) != wxEmptyString );
    27. }
    28.  
    29. wildCard = "";
    30. }
    31. }
    To copy to clipboard, switch view to plain text mode 


    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filesysteme avec Qt

    You mean QDir?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: filesysteme avec Qt

    no i mean diriterator i just finish replacing it
    that's the new code

    Qt Code:
    1. QStringList listFilter;
    2. QString filter;
    3.  
    4. QListWidgetItem *fileName;
    5.  
    6. lstFolderFiles->clear();
    7.  
    8.  
    9. for( int i = 1; i < formatsCount; i ++ )
    10. {
    11. filter=QString( "*." ) + formats[ i ][ 1 ];
    12.  
    13. listFilter << filter;
    14. }
    15. QDirIterator dirIterator(txtFolderSource->text(), listFilter ,QDir::Files | QDir::NoSymLinks, QDirIterator::Subdirectories);// Path Initialisation
    16.  
    17. while(dirIterator.hasNext())
    18. {
    19. fileName= new QListWidgetItem (dirIterator.next());
    20. filter=dirIterator.next();
    21. fileName->setCheckState(Qt::Checked);
    22. if( radAllFolderSourceFiles->isChecked() )
    23. {
    24. fileName->setCheckState(Qt::Checked);
    25. }
    26. lstFolderFiles->addItem( fileName );
    27. }
    To copy to clipboard, switch view to plain text mode 


    thank you
    Last edited by wysota; 20th June 2009 at 09:19.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filesysteme avec Qt

    How about using QTreeView and QFileSystemModel instead?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.