forked from qt-creator/qt-creator
Remove usages of deprecated APIs
Replaced: QPalette::ColorRole::Background -> QPalette::ColorRole::Window QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole QFontMetrics::width() -> QFontMetrics::horizontalAdvance() Task-number: QTBUG-76491 Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -216,7 +216,7 @@ void GerritPushDialog::setChangeRange()
|
||||
QPalette palette = QApplication::palette();
|
||||
if (currentRange > ReasonableDistance) {
|
||||
const QColor errorColor = Utils::creatorTheme()->color(Utils::Theme::TextColorError);
|
||||
palette.setColor(QPalette::Foreground, errorColor);
|
||||
palette.setColor(QPalette::WindowText, errorColor);
|
||||
palette.setColor(QPalette::ButtonText, errorColor);
|
||||
labelText.append("\n" + tr("Are you sure you selected the right target branch?"));
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ void DescriptionWidgetDecorator::highlightCurrentContents(
|
||||
sel.cursor.select(QTextCursor::LineUnderCursor);
|
||||
sel.format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
|
||||
const QColor textColor = TextEditor::TextEditorSettings::fontSettings().formatFor(TextEditor::C_TEXT).foreground();
|
||||
sel.format.setUnderlineColor(textColor.isValid() ? textColor : textEditor->palette().color(QPalette::Foreground));
|
||||
sel.format.setUnderlineColor(textColor.isValid() ? textColor : textEditor->palette().color(QPalette::WindowText));
|
||||
textEditor->setExtraSelections(TextEditor::TextEditorWidget::OtherSelection,
|
||||
QList<QTextEdit::ExtraSelection>() << sel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user