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

QML and virtual resource paths

Our project uses a Qt resource file to make our QML files embedded into the binary and ensure that they are always available to the application, even if the source directory is not present at the computer. During startup, we refer to the main QML file using the qrc:/main.qml URL. This means that the runtime only sees the file hierarchy in the resource file, and the actual source directory of the project is not taken into account.

The other QML file has the qrc:/Button.qml URL, so Qt considers them to be in the same virtual directory and everything still works. However, if you create a QML file but forget to add it to the project's resources, Qt will be unable to load that file. Even if the file is present in ...

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