O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Traversing directories

Traversing directories with QDir is really easy. The first thing to do is to have an instance of QDir in the first place. The easiest way to do this is to pass the directory path to the QDir constructor.

Qt handles file paths in a platform-independent way. Even though the regular directory separator on Windows is a backward slash character (\) and on other platforms it is the forward slash (/), Qt internally always uses the forward slash, and paths returned by most Qt methods never contain backward slashes. You can always use forward slashes when passing paths to Qt methods, even on Windows. If you need to convert the Qt's path representation to the native form (for example, for passing it to the standard library or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required