forked from qt-creator/qt-creator
Optimize usage of QPalette
setPalette() does not replace the old one but rather adds the difference. Thus a previous copy of the palette is unnecessary. Change-Id: I5c06da456b76144efc4a984ccda13c7d2243a7bc Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -191,7 +191,7 @@ VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *pa
|
||||
const QTextCharFormat tf = fs.toTextCharFormat(TextEditor::C_TEXT);
|
||||
descriptionEdit->setFont(tf.font());
|
||||
const QTextCharFormat selectionFormat = fs.toTextCharFormat(TextEditor::C_SELECTION);
|
||||
QPalette pal = descriptionEdit->palette();
|
||||
QPalette pal;
|
||||
pal.setColor(QPalette::Base, tf.background().color());
|
||||
pal.setColor(QPalette::Text, tf.foreground().color());
|
||||
pal.setColor(QPalette::Foreground, tf.foreground().color());
|
||||
|
||||
Reference in New Issue
Block a user