C++ Qt 13 - Resource Files

VoidRealms · 144K views · 2011 · 4:18

Open on YouTube

C, C++, Rust, Go & systems languagesTesting, debugging & developer toolstutorial

Why Stack Overflow recommends it

Stack Overflow users link it when explaining how to create a Qt resource file in Qt Creator and reference embedded files with the :/ path.

Recommended by 1 people across 1 different months, 2014 to 2017.

What it is

A short tutorial from VoidRealms' C++ Qt series showing how to add a Qt Resource file (.qrc) to a project in Qt Creator and use it to embed files in the application. It is a screencast-style walkthrough from 2011.

What people said

Recommends Diego Juliao · 2017-01 · Stack Overflow · on “Creating a resource file to use it in Qt Designer”

Using Qt Creator. (Using the Qt Designer that is inside of Qt creator) Right clicking on your project Add new Step on the left option QT Qt Resource file Follow the wizard to add one I took those instructions from the video QT Resource Files [this video]

Cites Jablonski · 2014-09 · Stack Overflow · on “Trouble with setting QT style to external QSS file”

":/myStyle.qss" it is path which uses for Qt resource system. As you said, this file in the same directory, so try to set nornal path, "myStyle.qss" , but be carefully because Qt will search this file in the build directory, so you should place file in build directory. But when your qss file will be done, then save it in the resources. There are many examples how to do this in the web (for example this [this video] . In this case you will need your current path ":/myStyle.qss" Why do you need resource? Resources are build into exe file so you never lost this files, user can't delete it or rewrite. If user delete your qss file, all your style will fail, so you should protect it.

Cites ricardolima · 2017-03 · Stack Overflow · on “Use QProcess with a executable in resource”

I´am developing an app with QT creator in linux and i''am with some difficults. I had already done this in windows and Mac without any problem(using similar techniques). I include an executable which needs arguments in resources projects [this video] and seems like everything is ok. I tried to check the size of the file with path :/Aux/namefile and it gives the correct size. QProcess *process = new QProcess(this); QStringList arguments; arguments<< "--help"; process->execute(":/Aux/namefile"); //already tried with start and no results too //also tried sh.start(":/Aux/namefile",arguments) The arguments is a QStringList process->write(arguments); process->closeWriteChannel(); process->waitForFinish