Question
I have a small issue when testing the styles. This is my short code to switch styles and debug:
void MainWindow::on_actionLight_triggered()
{
QFile f(":/light/stylesheet.qss");
if (!f.exists()) {
printf("Unable to set stylesheet, file not found\n");
}
else {
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
}
}
void MainWindow::on_actionDark_triggered()
{
QFile f(":/dark/stylesheet.qss");
if (!f.exists()) {
printf("Unable to set stylesheet, file not found\n");
}
else {
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
}
}
void MainWindow::on_actionLight_Blue_triggered()
{
QFile f(":/light-blue/stylesheet.qss");
if (!f.exists()) {
printf("Unable to set stylesheet, file not found\n");
}
else {
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
}
}
void MainWindow::on_actionDark_Blue_triggered()
{
QFile f(":/dark-blue/stylesheet.qss");
if (!f.exists()) {
printf("Unable to set stylesheet, file not found\n");
}
else {
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
}
}
It's ugly, but for testing it's ok. Here are the issues:
- Light vs Light Blue has no difference, for instance checkboxes are black between them.
- Dark vs Dark Blue has no different, for instance checkboxes are blue between them (which is OK, no complaints, but then what's the difference between them?)
The resources are loaded and present, so I don't understand the issue.
Please advise, much appreciated!
Question
I have a small issue when testing the styles. This is my short code to switch styles and debug:
It's ugly, but for testing it's ok. Here are the issues:
The resources are loaded and present, so I don't understand the issue.
Please advise, much appreciated!