June 18, 2012

Vikuseth Vikuseth
Ant Farmer
76 posts

return of uint QDir::count () const

 

Suppose i have one folder and inside that another two files are there ..
But when i am using uint QDir::count () const, it gives me 4 instead of 2 . the extra 2 is for “.” and “..” .i dont understand what is this “.” and “..”

4 replies

June 18, 2012

koahnig koahnig
Mad Scientist
2099 posts

Did you see the QDir explanation? [qt-project.org]
On the command prompt “.” represents the current (working) directory and “..” the parent directory.

June 18, 2012

veeraps veeraps
Lab Rat
87 posts

Guess ‘.’ & ‘..’ way go back to MSDOS days – hope this link might be useful MSDOS [teckies.com]

June 18, 2012

Vikuseth Vikuseth
Ant Farmer
76 posts

Suppose the directory structure is as follows a->b,c and A->a then in this case if i apply the above function , then “.” represents a since it holds b and c , whereas “..” represents A which holds a . Am i right ????

June 18, 2012

koahnig koahnig
Mad Scientist
2099 posts
BibekKumar wrote:
Suppose the directory structure is as follows a->b,c and A->a then in this case if i apply the above function , then “.” represents a since it holds b and c , whereas “..” represents A which holds a . Am i right ????

Yes, those are simply some representations. There are some more explanations on how using and handling of those special cases in Qt docs e.g. relativeFilePath [qt-project.org]

 
  ‹‹ Unhandled - Thread      QSS files - anyone got an example pls, I have QSS from Qt Creator but it is not being applied through setStyleSheet ››

You must log in to post a reply. Not a member yet? Register here!