I am making a C++ application, and I created a function that will apply a stylesheet from a css file. This is the method:
void MainWindow::load_css_file() {
QFile styleFile(":/light_style_css");
styleFile.open(QFile::ReadOnly);
QString styleSheet = styleFile.readAll();
setStyleSheet(styleSheet);
};
This works fine, except for the fact that I need to run "make" every time I make a change to "light_style_css" (which is an alias for a css file in my project resource file).
But, when I change the method to something like this:
void MainWindow::load_css_file() {
QFile styleFile("../stylesheets/light_style.css");
styleFile.open(QFile::ReadOnly);
QString styleSheet = styleFile.readAll();
setStyleSheet(styleSheet);
};
I can make changes to the file, and the program updates without having to run "make" for the changes to take place.
Is there a way, that I can use the resource system, without having to run "make" for the changes to take place?
This is my resource file:
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="light_style_css">stylesheets/light_style.css</file>
</qresource>
</RCC>