[Qt-interest] anyone know why QDir::mkpath() isn't static?
Konstantin Tokarev
annulen at yandex.ru
Tue Apr 12 18:30:06 CEST 2011
12.04.2011, 20:21, "Atlant Schmidt" <aschmidt at dekaresearch.com>:
> Paul:
>
> To expand on Thiago's rather cryptic response, in
> your case, the constructor and the method really
> *ARE* somewhat redundant but that's because you're
> not using the full beauty and grandeur [;-)] of
> the class.
>
> What you've really got when you construct a QDir
> is a sort of "cd" ("current working directory");
> you've got an object that now points to some
> directory that exists (or at least could exist)
> somewhere within your file system. You can then
> do all sorts of common manipulations to this
> working directory such as cd'ing downwards or
> upwards, extracting bits and pieces of the path,
> and so on.
>
> You can also create new paths (or individual
> directories) relative to this current working
> directory (and these can be absolute paths if
> the current working directory is an absolute
> path).
>
> It only feels redundant because you're doing
> essentially the simplest possible pair of
> operations where, yes, it may be "overkill"
> compared to mkdir(2).
But mkdir(2) is not portable.
--
Regards,
Konstantin
More information about the Qt-interest-old
mailing list