+ improve handling of default colors of report view and Python console when using style sheets

This commit is contained in:
wmayer
2014-01-31 11:34:30 +01:00
parent a7d297c33d
commit d927d0bcb9
5 changed files with 28 additions and 19 deletions

View File

@@ -852,6 +852,14 @@ void PythonConsole::changeEvent(QEvent *e)
this, SLOT(visibilityChanged(bool)));
}
}
else if (e->type() == QEvent::StyleChange) {
QPalette pal = palette();
QColor color = pal.windowText().color();
unsigned long text = (color.red() << 24) | (color.green() << 16) | (color.blue() << 8);
// if this parameter is not already set use the style's window text color
text = getWindowParameter()->GetUnsigned("Text", text);
getWindowParameter()->SetUnsigned("Text", text);
}
TextEdit::changeEvent(e);
}