Results 1 to 2 of 2

Thread: Is it me or QDir?

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Is it me or QDir?

    But what is the point of QDir not having mkpath or exists as static members?
    Creating a QDir that I will not use seems a little silly. Or have I missed something?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is it me or QDir?

    Quote Originally Posted by Morea View Post
    Creating a QDir that I will not use seems a little silly.
    You will use it... to check if it exists

    Anyway the docs say:
    Check if a directory exists:
    Qt Code:
    1. QDir dir("example");
    2. if (!dir.exists())
    3. qWarning("Cannot find the example directory");
    To copy to clipboard, switch view to plain text mode 
    (We could also use the static convenience function QFile::exists().)
    Remember, from Unix point of view everything is a file.

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

    Morea (29th June 2007)

Similar Threads

  1. How to explicitely delete a QDir?
    By alan in forum Newbie
    Replies: 2
    Last Post: 13th February 2006, 17:48
  2. how can i copy a directary using QDir
    By monaem in forum Qt Programming
    Replies: 5
    Last Post: 4th February 2006, 12:12

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.