-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0
-
None
-
Windows 11 22H2
I have a class that initialises a colour name in the ctor initialiser list:
windowColourName{ palette().color(QPalette::ColorRole::Window).name()}, // Default base window colour
{{}}
If the active windows theme is a Light theme it is set to "#f0f0f0" at that point.
If the active windows theme is a Dark theme it is set to "#1e1e1e"
If I switch themes, I enter this code:
void ExplorerBar::onColorSchemeChanged(Qt::ColorScheme scheme)
{
//
// Dark colour scheme?
//
if (Qt::ColorScheme::Dark == scheme)
activeGroupColourName = "darkcyan";
else
activeGroupColourName = "lightcyan";
windowColourName = palette().color(QPalette::ColorRole::Window).name(); // Default base window colour
const auto tabID = dssApp->tab();
if (IDD_REGISTERING == tabID)
{
ui->registerAndStack->setStyleSheet(QString("background-color: %1").arg(activeGroupColourName)); ui->processing->setStyleSheet(QString("background-color: %1").arg(windowColourName)); }
else
{
ui->registerAndStack->setStyleSheet(QString("background-color: %1").arg(windowColourName));
ui->processing->setStyleSheet(QString("background-color: %1").arg(activeGroupColourName));
}
ui->options->setStyleSheet(QString("background-color: %1").arg(activeGroupColourName));
makeLinks();
}
My problem is that the line that sets windowColourName is returning #1e1e1e when switching to a light theme from a Dark theme, or #f0f0f0 when switching the other way.