In the next sections, you will learn how to add styling and multi-language support to our applications, but, before that, we must be familiar with the Qt Resource System. Simply put, it is the means in Qt to add resource files such as fonts, icons, images, translation files, style sheet files, and so on into our applications (and libraries).
Qt supports management using the *.qrc
files (Resource Collection Files), which are simply XML files that include information about resource files that need to be included in our applications. Let's go through a simple example and include an icon in our Hello_Qt_openCV
application to better understand how the Qt Resource System works:
- Make sure you have the
Hello_Qt_OpenCV
project opened in Qt Creator. SelectFile
and thenNew File or Project
. In the new file window, make sure you selectQt
from the second list on the left and thenQt Resource File
. Consider the following screenshot:
- Click on the
Choose...
button, and in the next screen...