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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user