aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libs/qmleditorwidgets/customcolordialog.cpp4
-rw-r--r--src/libs/utils/fadingindicator.cpp4
-rw-r--r--src/plugins/beautifier/configurationdialog.cpp2
-rw-r--r--src/plugins/coreplugin/find/searchresulttreemodel.cpp2
-rw-r--r--src/plugins/coreplugin/iwelcomepage.cpp21
-rw-r--r--src/plugins/coreplugin/manhattanstyle.cpp6
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp2
-rw-r--r--src/plugins/git/gerrit/gerritpushdialog.cpp2
-rw-r--r--src/plugins/git/gitclient.cpp2
-rw-r--r--src/plugins/projectexplorer/panelswidget.cpp4
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp2
-rw-r--r--src/plugins/projectexplorer/targetsettingspanel.cpp2
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp2
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/utils.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp10
-rw-r--r--src/plugins/texteditor/texteditor.cpp27
-rw-r--r--src/plugins/todo/todoitemsmodel.cpp2
-rw-r--r--src/plugins/todo/todooutputpane.cpp2
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp2
-rw-r--r--src/plugins/welcome/introductionwidget.cpp2
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp7
-rw-r--r--src/shared/designerintegrationv2/widgethost.cpp2
22 files changed, 52 insertions, 59 deletions
diff --git a/src/libs/qmleditorwidgets/customcolordialog.cpp b/src/libs/qmleditorwidgets/customcolordialog.cpp
index 198d273081..3792785ad2 100644
--- a/src/libs/qmleditorwidgets/customcolordialog.cpp
+++ b/src/libs/qmleditorwidgets/customcolordialog.cpp
@@ -140,7 +140,7 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
void CustomColorDialog::setupColor(const QColor &color)
{
QPalette pal;
- pal.setColor(QPalette::Background, color);
+ pal.setColor(QPalette::Window, color);
m_beforeColorWidget->setPalette(pal);
setColor(color);
}
@@ -175,7 +175,7 @@ void CustomColorDialog::setupWidgets()
m_bSpinBox->setValue(m_color.blueF());
m_colorBox->setColor(m_color);
QPalette pal;
- pal.setColor(QPalette::Background, m_color);
+ pal.setColor(QPalette::Window, m_color);
m_currentColorWidget->setPalette(pal);
m_blockUpdate = false;
}
diff --git a/src/libs/utils/fadingindicator.cpp b/src/libs/utils/fadingindicator.cpp
index 954d076e53..1c822aeaba 100644
--- a/src/libs/utils/fadingindicator.cpp
+++ b/src/libs/utils/fadingindicator.cpp
@@ -56,7 +56,7 @@ public:
font.setPixelSize(size == FadingIndicator::LargeText ? 45 : 22);
m_label->setFont(font);
QPalette pal = palette();
- pal.setColor(QPalette::Foreground, pal.color(QPalette::Background));
+ pal.setColor(QPalette::WindowText, pal.color(QPalette::Window));
m_label->setPalette(pal);
auto layout = new QHBoxLayout;
setLayout(layout);
@@ -98,7 +98,7 @@ protected:
if (!m_pixmap.isNull()) {
p.drawPixmap(rect(), m_pixmap);
} else {
- p.setBrush(palette().color(QPalette::Foreground));
+ p.setBrush(palette().color(QPalette::WindowText));
p.setPen(Qt::NoPen);
p.drawRoundedRect(rect(), 15, 15);
}
diff --git a/src/plugins/beautifier/configurationdialog.cpp b/src/plugins/beautifier/configurationdialog.cpp
index 48fcd18483..7d84c73023 100644
--- a/src/plugins/beautifier/configurationdialog.cpp
+++ b/src/plugins/beautifier/configurationdialog.cpp
@@ -62,7 +62,7 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent) :
QPalette pal;
pal.setColor(QPalette::Base, tf.background().color());
pal.setColor(QPalette::Text, tf.foreground().color());
- pal.setColor(QPalette::Foreground, tf.foreground().color());
+ pal.setColor(QPalette::WindowText, tf.foreground().color());
if (selectionFormat.background().style() != Qt::NoBrush)
pal.setColor(QPalette::Highlight, selectionFormat.background().color());
pal.setBrush(QPalette::HighlightedText, selectionFormat.foreground());
diff --git a/src/plugins/coreplugin/find/searchresulttreemodel.cpp b/src/plugins/coreplugin/find/searchresulttreemodel.cpp
index 3fba0f899d..854bb94ed3 100644
--- a/src/plugins/coreplugin/find/searchresulttreemodel.cpp
+++ b/src/plugins/coreplugin/find/searchresulttreemodel.cpp
@@ -247,7 +247,7 @@ QVariant SearchResultTreeModel::data(const SearchResultTreeItem *row, int role)
else
result = QVariant();
break;
- case Qt::TextColorRole:
+ case Qt::ForegroundRole:
result = m_color.textForeground;
break;
case Qt::BackgroundRole:
diff --git a/src/plugins/coreplugin/iwelcomepage.cpp b/src/plugins/coreplugin/iwelcomepage.cpp
index 0f93bb1f3b..3858294133 100644
--- a/src/plugins/coreplugin/iwelcomepage.cpp
+++ b/src/plugins/coreplugin/iwelcomepage.cpp
@@ -64,31 +64,28 @@ static QPalette buttonPalette(bool isActive, bool isCursorInside, bool forText)
Theme *theme = Utils::creatorTheme();
if (isActive) {
if (forText) {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_BackgroundColor));
} else {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
+ pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundPrimaryColor));
}
} else {
if (isCursorInside) {
if (forText) {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_HoverColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_HoverColor));
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
} else {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_HoverColor));
+ pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundSecondaryColor));
}
} else {
if (forText) {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_BackgroundColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_ForegroundPrimaryColor));
pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
} else {
- pal.setColor(QPalette::Background, theme->color(Theme::Welcome_BackgroundColor));
- pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
+ pal.setColor(QPalette::Window, theme->color(Theme::Welcome_BackgroundColor));
+ pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_ForegroundSecondaryColor));
}
}
}
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index 76593c18d0..544f57ad3e 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -246,14 +246,12 @@ QPalette panelPalette(const QPalette &oldPalette, bool lightColored = false)
QPalette pal = oldPalette;
pal.setBrush(QPalette::All, QPalette::WindowText, color);
pal.setBrush(QPalette::All, QPalette::ButtonText, color);
- pal.setBrush(QPalette::All, QPalette::Foreground, color);
if (lightColored)
color.setAlpha(100);
else
color = creatorTheme()->color(Theme::IconsDisabledColor);
pal.setBrush(QPalette::Disabled, QPalette::WindowText, color);
pal.setBrush(QPalette::Disabled, QPalette::ButtonText, color);
- pal.setBrush(QPalette::Disabled, QPalette::Foreground, color);
return pal;
}
@@ -291,7 +289,7 @@ void ManhattanStyle::polish(QWidget *widget)
const bool isLightColored = lightColored(widget);
QPalette palette = panelPalette(widget->palette(), isLightColored);
if (!isLightColored)
- palette.setBrush(QPalette::All, QPalette::Foreground,
+ palette.setBrush(QPalette::All, QPalette::WindowText,
creatorTheme()->color(Theme::ComboBoxTextColor));
widget->setPalette(palette);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
@@ -738,7 +736,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
painter->drawText(editRect.adjusted(1, 0, -1, 0), Qt::AlignLeft | Qt::AlignVCenter, text);
}
painter->setPen((option->state & State_Enabled)
- ? option->palette.color(QPalette::Foreground)
+ ? option->palette.color(QPalette::WindowText)
: creatorTheme()->color(Theme::IconsDisabledColor));
painter->drawText(editRect.adjusted(1, 0, -1, 0), Qt::AlignLeft | Qt::AlignVCenter, text);
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index c5e4dcca96..29defad573 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -284,7 +284,7 @@ protected:
QPainter p(this);
QPalette pal = m_editor->extraArea()->palette();
const QColor fg = pal.color(QPalette::Dark);
- const QColor bg = pal.color(QPalette::Background);
+ const QColor bg = pal.color(QPalette::Window);
p.setPen(fg);
// Draw relative line numbers.
diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp
index a59f615b57..9a251b5eda 100644
--- a/src/plugins/git/gerrit/gerritpushdialog.cpp
+++ b/src/plugins/git/gerrit/gerritpushdialog.cpp
@@ -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?"));
}
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 8c84c61354..0d34fd25a8 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -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);
}
diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp
index 77e4cb204a..6e2b50bfcd 100644
--- a/src/plugins/projectexplorer/panelswidget.cpp
+++ b/src/plugins/projectexplorer/panelswidget.cpp
@@ -186,9 +186,9 @@ void PanelsWidget::addPropertiesPanel(const QString &displayName, const QIcon &i
QPalette palette = nameLabel->palette();
for (int i = QPalette::Active; i < QPalette::NColorGroups; ++i ) {
// FIXME: theming
- QColor foregroundColor = palette.color(QPalette::ColorGroup(i), QPalette::Foreground);
+ QColor foregroundColor = palette.color(QPalette::ColorGroup(i), QPalette::WindowText);
foregroundColor.setAlpha(110);
- palette.setBrush(QPalette::ColorGroup(i), QPalette::Foreground, foregroundColor);
+ palette.setBrush(QPalette::ColorGroup(i), QPalette::WindowText, foregroundColor);
}
nameLabel->setPalette(palette);
nameLabel->setContentsMargins(0, ABOVE_HEADING_MARGIN, 0, 0);
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 015c260fdb..523cc458d3 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -175,7 +175,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
result = font;
break;
}
- case Qt::TextColorRole: {
+ case Qt::ForegroundRole: {
result = node->isEnabled() ? m_enabledTextColor : m_disabledTextColor;
break;
}
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp
index 6774cb73e3..aabb2d33a6 100644
--- a/src/plugins/projectexplorer/targetsettingspanel.cpp
+++ b/src/plugins/projectexplorer/targetsettingspanel.cpp
@@ -350,7 +350,7 @@ public:
return k->icon();
}
- case Qt::TextColorRole: {
+ case Qt::ForegroundRole: {
if (!isEnabled())
return Utils::creatorTheme()->color(Theme::TextColorDisabled);
break;
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
index ed968bd007..d5685a161e 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
@@ -538,7 +538,7 @@ void GraphicsView::drawValueScale(QPainter *painter, const QRectF &rect)
double GraphicsView::timeLabelInterval(QPainter *painter, double maxTime)
{
QFontMetrics fm(painter->font());
- int minTextSpacing = fm.width(QString("X%1X").arg(maxTime));
+ int minTextSpacing = fm.horizontalAdvance(QString("X%1X").arg(maxTime));
int deltaTime = 1;
int nextFactor = 5;
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/utils.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/utils.cpp
index 4bc1cd285d..f255cfd29e 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/utils.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/utils.cpp
@@ -70,9 +70,7 @@ QPalette singleColorPalette(const QColor &color)
{
QPalette palette;
palette.setColor(QPalette::Window, color);
- palette.setColor(QPalette::Background, color);
palette.setColor(QPalette::WindowText, color);
- palette.setColor(QPalette::Foreground, color);
palette.setColor(QPalette::Base, color);
palette.setColor(QPalette::AlternateBase, color);
palette.setColor(QPalette::ToolTipBase, color);
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
index 6192f17bf4..ad203258a6 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
@@ -219,7 +219,7 @@ QVariant QmlProfilerStatisticsModel::dataForMainEntry(const QModelIndex &index,
return m_rootDuration > 0 ? "+" : "-";
case TypeIdRole:
return s_mainEntryTypeId;
- case Qt::TextColorRole:
+ case Qt::ForegroundRole:
return Utils::creatorTheme()->color(Utils::Theme::Timeline_TextColor);
case SortRole:
switch (index.column()) {
@@ -296,7 +296,7 @@ QVariant QmlProfilerStatisticsModel::data(const QModelIndex &index, int role) co
auto it = m_notes.constFind(typeIndex);
return it == m_notes.constEnd() ? QString() : it.value();
}
- case Qt::TextColorRole:
+ case Qt::ForegroundRole:
return (stats.recursive > 0 || m_notes.contains(typeIndex))
? Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor)
: Utils::creatorTheme()->color(Utils::Theme::Timeline_TextColor);
@@ -393,7 +393,7 @@ void QmlProfilerStatisticsModel::typeDetailsChanged(int typeIndex)
void QmlProfilerStatisticsModel::notesChanged(int typeIndex)
{
- static const QVector<int> noteRoles({Qt::ToolTipRole, Qt::TextColorRole});
+ static const QVector<int> noteRoles({Qt::ToolTipRole, Qt::ForegroundRole});
const Timeline::TimelineNotesModel *notesModel = m_modelManager->notesModel();
if (typeIndex == s_invalidTypeId) {
m_notes.clear();
@@ -564,7 +564,7 @@ QVariant QmlProfilerStatisticsRelativesModel::dataForMainEntry(qint64 totalDurat
switch (role) {
case TypeIdRole:
return QmlProfilerStatisticsModel::s_mainEntryTypeId;
- case Qt::TextColorRole:
+ case Qt::ForegroundRole:
return Utils::creatorTheme()->color(Utils::Theme::Timeline_TextColor);
case SortRole:
if (column == RelativeTotalTime)
@@ -614,7 +614,7 @@ QVariant QmlProfilerStatisticsRelativesModel::data(const QModelIndex &index, int
return type.location().column();
case Qt::ToolTipRole:
return stats.isRecursive ? tr("called recursively") : QString();
- case Qt::TextColorRole:
+ case Qt::ForegroundRole:
return stats.isRecursive
? Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor)
: Utils::creatorTheme()->color(Utils::Theme::Timeline_TextColor);
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 325cc11775..b022a5a7e3 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -4092,7 +4092,8 @@ void TextEditorWidgetPrivate::paintRightMarginArea(PaintEventData &data, QPainte
return;
// Don't use QFontMetricsF::averageCharWidth here, due to it returning
// a fractional size even when this is not supported by the platform.
- data.rightMargin = QFontMetricsF(q->font()).width(QLatin1Char('x')) * m_visibleWrapColumn
+ data.rightMargin = QFontMetricsF(q->font()).horizontalAdvance(QLatin1Char('x'))
+ * m_visibleWrapColumn
+ data.offset.x() + 4;
const QRect viewportRect = q->viewport()->rect();
if (data.rightMargin < viewportRect.width()) {
@@ -4268,7 +4269,7 @@ void TextEditorWidgetPrivate::paintFindScope(const PaintEventData &data, QPainte
QTextLayout *layout = block.layout();
QString text = block.text();
const TabSettings ts = m_document->tabSettings();
- qreal spacew = QFontMetricsF(q->font()).width(QLatin1Char(' '));
+ qreal spacew = QFontMetricsF(q->font()).horizontalAdvance(QLatin1Char(' '));
int offset = 0;
int relativePos = ts.positionAtColumn(text,
@@ -4358,7 +4359,7 @@ void TextEditorWidgetPrivate::paintBlockSelection(const PaintEventData &data, QP
QRectF blockBoundingRect = q->blockBoundingRect(data.block).translated(data.offset);
QString text = data.block.text();
const TabSettings tabSettings = m_document->tabSettings();
- const qreal spacew = QFontMetricsF(q->font()).width(QLatin1Char(' '));
+ const qreal spacew = QFontMetricsF(q->font()).horizontalAdvance(QLatin1Char(' '));
const int cursorw = q->overwriteMode() ? QFontMetrics(q->font()).horizontalAdvance(QLatin1Char(' '))
: q->cursorWidth();
@@ -4433,14 +4434,14 @@ void TextEditorWidgetPrivate::paintCursorAsBlock(const PaintEventData &data, QPa
w = line.cursorToX(relativePos + 1) - x;
if (data.doc->characterAt(data.context.cursorPosition) == QLatin1Char('\t')) {
doSelection = false;
- qreal space = fontMetrics.width(QLatin1Char(' '));
+ qreal space = fontMetrics.horizontalAdvance(QLatin1Char(' '));
if (w > space) {
x += w-space;
w = space;
}
}
} else
- w = fontMetrics.width(QLatin1Char(' ')); // in sync with QTextLine::draw()
+ w = fontMetrics.horizontalAdvance(QLatin1Char(' ')); // in sync with QTextLine::draw()
QRectF lineRect = line.rect();
lineRect.moveTop(lineRect.top() + blockData.boundingRect.top());
@@ -5122,7 +5123,7 @@ void TextEditorWidget::extraAreaPaintEvent(QPaintEvent *e)
QPainter painter(d->m_extraArea);
- painter.fillRect(e->rect(), data.palette.color(QPalette::Background));
+ painter.fillRect(e->rect(), data.palette.color(QPalette::Window));
data.block = firstVisibleBlock();
QPointF offset = contentOffset();
@@ -5448,7 +5449,7 @@ void TextEditorWidget::mouseMoveEvent(QMouseEvent *e)
int column = tabSettings.columnAt(
cursor.block().text(), cursor.positionInBlock());
if (cursor.positionInBlock() == cursor.block().length()-1)
- column += (e->pos().x() - cursorRect().center().x()) / QFontMetricsF(font()).width(QLatin1Char(' '));
+ column += (e->pos().x() - cursorRect().center().x()) / QFontMetricsF(font()).horizontalAdvance(QLatin1Char(' '));
int block = cursor.blockNumber();
if (block == blockCount() - 1)
block += (e->pos().y() - cursorRect().center().y()) / QFontMetricsF(font()).lineSpacing();
@@ -5461,7 +5462,7 @@ void TextEditorWidget::mouseMoveEvent(QMouseEvent *e)
int column = tabSettings.columnAt(
cursor.block().text(), cursor.positionInBlock());
if (cursor.positionInBlock() == cursor.block().length()-1)
- column += (e->pos().x() - cursorRect().center().x()) / QFontMetricsF(font()).width(QLatin1Char(' '));
+ column += (e->pos().x() - cursorRect().center().x()) / QFontMetricsF(font()).horizontalAdvance(QLatin1Char(' '));
d->m_blockSelection.positionBlock = cursor.blockNumber();
d->m_blockSelection.positionColumn = column;
@@ -5499,7 +5500,7 @@ void TextEditorWidget::mousePressEvent(QMouseEvent *e)
int column = d->m_document->tabSettings().columnAt(
cursor.block().text(), cursor.positionInBlock());
if (cursor.positionInBlock() == cursor.block().length()-1)
- column += (e->pos().x() - cursorRect(cursor).center().x()) / QFontMetricsF(font()).width(QLatin1Char(' '));
+ column += (e->pos().x() - cursorRect(cursor).center().x()) / QFontMetricsF(font()).horizontalAdvance(QLatin1Char(' '));
int block = cursor.blockNumber();
if (block == blockCount() - 1)
block += (e->pos().y() - cursorRect(cursor).center().y()) / QFontMetricsF(font()).lineSpacing();
@@ -7254,7 +7255,7 @@ void TextEditorWidget::applyFontSettings()
const QColor background = textFormat.background().color();
QPalette p = palette();
p.setColor(QPalette::Text, foreground);
- p.setColor(QPalette::Foreground, foreground);
+ p.setColor(QPalette::WindowText, foreground);
p.setColor(QPalette::Base, background);
p.setColor(QPalette::Highlight, (selectionFormat.background().style() != Qt::NoBrush) ?
selectionFormat.background().color() :
@@ -7271,7 +7272,7 @@ void TextEditorWidget::applyFontSettings()
// Line numbers
QPalette ep;
ep.setColor(QPalette::Dark, lineNumberFormat.foreground().color());
- ep.setColor(QPalette::Background, lineNumberFormat.background().style() != Qt::NoBrush ?
+ ep.setColor(QPalette::Window, lineNumberFormat.background().style() != Qt::NoBrush ?
lineNumberFormat.background().color() : background);
d->m_extraArea->setPalette(ep);
@@ -8107,7 +8108,7 @@ void TextEditorWidgetPrivate::updateTabStops()
{
// Although the tab stop is stored as qreal the API from QPlainTextEdit only allows it
// to be set as an int. A work around is to access directly the QTextOption.
- qreal charWidth = QFontMetricsF(q->font()).width(QLatin1Char(' '));
+ qreal charWidth = QFontMetricsF(q->font()).horizontalAdvance(QLatin1Char(' '));
QTextOption option = q->document()->defaultTextOption();
option.setTabStopDistance(charWidth * m_document->tabSettings().m_tabSize);
q->document()->setDefaultTextOption(option);
@@ -8116,7 +8117,7 @@ void TextEditorWidgetPrivate::updateTabStops()
int TextEditorWidget::columnCount() const
{
QFontMetricsF fm(font());
- return int(viewport()->rect().width() / fm.width(QLatin1Char('x')));
+ return int(viewport()->rect().width() / fm.horizontalAdvance(QLatin1Char('x')));
}
int TextEditorWidget::rowCount() const
diff --git a/src/plugins/todo/todoitemsmodel.cpp b/src/plugins/todo/todoitemsmodel.cpp
index 03d48a1352..7776ec169c 100644
--- a/src/plugins/todo/todoitemsmodel.cpp
+++ b/src/plugins/todo/todoitemsmodel.cpp
@@ -78,7 +78,7 @@ QVariant TodoItemsModel::data(const QModelIndex &index, int role) const
TodoItem item = m_todoItemsList->at(index.row());
- if (role == Qt::TextColorRole)
+ if (role == Qt::ForegroundRole)
return item.color;
switch (index.column()) {
diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp
index 9f8a528124..940f6e97f2 100644
--- a/src/plugins/todo/todooutputpane.cpp
+++ b/src/plugins/todo/todooutputpane.cpp
@@ -178,7 +178,7 @@ void TodoOutputPane::todoTreeViewClicked(const QModelIndex &index)
item.text = index.sibling(row, Constants::OUTPUT_COLUMN_TEXT).data().toString();
item.file = Utils::FilePath::fromUserInput(index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString());
item.line = index.sibling(row, Constants::OUTPUT_COLUMN_LINE).data().toInt();
- item.color = index.data(Qt::TextColorRole).value<QColor>();
+ item.color = index.data(Qt::ForegroundRole).value<QColor>();
item.iconType = static_cast<IconType>(index.sibling(row, Constants::OUTPUT_COLUMN_TEXT)
.data(Qt::UserRole).toInt());
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 3c60cbd474..4c36057945 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -181,7 +181,7 @@ VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *pa
QPalette pal;
pal.setColor(QPalette::Base, tf.background().color());
pal.setColor(QPalette::Text, tf.foreground().color());
- pal.setColor(QPalette::Foreground, tf.foreground().color());
+ pal.setColor(QPalette::WindowText, tf.foreground().color());
if (selectionFormat.background().style() != Qt::NoBrush)
pal.setColor(QPalette::Highlight, selectionFormat.background().color());
pal.setBrush(QPalette::HighlightedText, selectionFormat.foreground());
diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp
index 8eb3a268d0..a719a4ae90 100644
--- a/src/plugins/welcome/introductionwidget.cpp
+++ b/src/plugins/welcome/introductionwidget.cpp
@@ -78,7 +78,7 @@ IntroductionWidget::IntroductionWidget(QWidget *parent)
parent->installEventFilter(this);
QPalette p = palette();
- p.setColor(QPalette::Foreground, QColor(220, 220, 220));
+ p.setColor(QPalette::WindowText, QColor(220, 220, 220));
setPalette(p);
m_textWidget = new QWidget(this);
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index 8ccf751ddd..08e763ab09 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -88,7 +88,6 @@ static QFont sizedFont(int size, const QWidget *widget, bool underline = false)
static QPalette lightText()
{
QPalette pal;
- pal.setColor(QPalette::Foreground, themeColor(Theme::Welcome_ForegroundPrimaryColor));
pal.setColor(QPalette::WindowText, themeColor(Theme::Welcome_ForegroundPrimaryColor));
return pal;
}
@@ -199,7 +198,7 @@ public:
void enterEvent(QEvent *) override
{
QPalette pal;
- pal.setColor(QPalette::Background, themeColor(Theme::Welcome_HoverColor));
+ pal.setColor(QPalette::Window, themeColor(Theme::Welcome_HoverColor));
setPalette(pal);
m_label->setFont(sizedFont(11, m_label, true));
update();
@@ -208,7 +207,7 @@ public:
void leaveEvent(QEvent *) override
{
QPalette pal;
- pal.setColor(QPalette::Background, themeColor(Theme::Welcome_BackgroundColor));
+ pal.setColor(QPalette::Window, themeColor(Theme::Welcome_BackgroundColor));
setPalette(pal);
m_label->setFont(sizedFont(11, m_label, false));
update();
@@ -319,7 +318,7 @@ WelcomeMode::WelcomeMode()
setContext(Context(Constants::C_WELCOME_MODE));
QPalette palette = creatorTheme()->palette();
- palette.setColor(QPalette::Background, themeColor(Theme::Welcome_BackgroundColor));
+ palette.setColor(QPalette::Window, themeColor(Theme::Welcome_BackgroundColor));
m_modeWidget = new QWidget;
m_modeWidget->setPalette(palette);
diff --git a/src/shared/designerintegrationv2/widgethost.cpp b/src/shared/designerintegrationv2/widgethost.cpp
index d4f18d30e2..ed7f2fb91d 100644
--- a/src/shared/designerintegrationv2/widgethost.cpp
+++ b/src/shared/designerintegrationv2/widgethost.cpp
@@ -66,7 +66,7 @@ void WidgetHost::setFormWindow(QDesignerFormWindowInterface *fw)
setBackgroundRole(QPalette::Base);
m_formWindow->setAutoFillBackground(true);
- m_formWindow->setBackgroundRole(QPalette::Background);
+ m_formWindow->setBackgroundRole(QPalette::Window);
connect(m_formResizer, &Internal::FormResizer::formWindowSizeChanged,
this, &WidgetHost::fwSizeWasChanged);