Results 1 to 4 of 4

Thread: how to remove folders in qt

  1. #1
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to remove folders in qt

    am having folder name Remote inside that folder am having another one folder. i need to delete Remote folder entirely.. i used QDir::rmdir method ,,its deleting only if the folder is empty..its not deleting if the folder contains subfolders,,can any one give me suggestion for this
    Thanks in advance

  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: how to remove folders in qt

    Make subdirectories empty before deleting them. Apply the algorithm recursively.
    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
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to remove folders in qt

    First delete the contents of the folder.

  4. #4
    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: how to remove folders in qt

    If this is folder is a temporary location, you could use QTemporaryDir instead and let it handle the cleanup.

    Cheers,
    _

Similar Threads

  1. how to compare two folders in qt
    By iswaryasenthilkumar in forum Newbie
    Replies: 3
    Last Post: 4th March 2015, 09:56
  2. how to create folders and sub folders in qt
    By Soumya Somasekhar Ram in forum Newbie
    Replies: 3
    Last Post: 30th August 2013, 06:49
  3. How to select folders from QFileDialog???
    By IndikaU in forum Newbie
    Replies: 4
    Last Post: 30th September 2011, 09:19
  4. Qt Creator Project folders
    By Quasimojo in forum Qt Tools
    Replies: 2
    Last Post: 13th January 2011, 00:24
  5. How to remove empty folders?
    By merry in forum Qt Programming
    Replies: 19
    Last Post: 16th December 2008, 09:14

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.