PVS: V629 Consider inspecting the 'col.red() << 24' expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type.

This commit is contained in:
wmayer
2019-02-17 22:27:00 +01:00
parent 2bb5797568
commit f0320d954a
5 changed files with 71 additions and 59 deletions

View File

@@ -378,10 +378,11 @@ void ReportOutput::changeEvent(QEvent *ev)
if (ev->type() == QEvent::StyleChange) {
QPalette pal = palette();
QColor color = pal.windowText().color();
unsigned long text = (color.red() << 24) | (color.green() << 16) | (color.blue() << 8);
unsigned int text = (color.red() << 24) | (color.green() << 16) | (color.blue() << 8);
unsigned long value = static_cast<unsigned long>(text);
// if this parameter is not already set use the style's window text color
text = getWindowParameter()->GetUnsigned("colorText", text);
getWindowParameter()->SetUnsigned("colorText", text);
value = getWindowParameter()->GetUnsigned("colorText", value);
getWindowParameter()->SetUnsigned("colorText", value);
}
QTextEdit::changeEvent(ev);
}