Fix some deprecation warnings in basic plugins

Fix warnings apppearing in 5.13, for example:
warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
...
warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations]
warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
...
warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
...
warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations]
warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations]
...
warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations]

Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Friedemann Kleint
2019-02-11 10:17:53 +01:00
parent 77392c7dea
commit 963dc84cc5
29 changed files with 60 additions and 58 deletions

View File

@@ -254,16 +254,16 @@ QColor FormatDescription::defaultForeground(TextStyle id)
{
if (id == C_LINE_NUMBER) {
const QPalette palette = Utils::Theme::initialPalette();
const QColor bg = palette.background().color();
const QColor bg = palette.window().color();
if (bg.value() < 128)
return palette.foreground().color();
return palette.windowText().color();
else
return palette.dark().color();
} else if (id == C_CURRENT_LINE_NUMBER) {
const QPalette palette = Utils::Theme::initialPalette();
const QColor bg = palette.background().color();
const QColor bg = palette.window().color();
if (bg.value() < 128)
return palette.foreground().color();
return palette.windowText().color();
else
return QColor();
} else if (id == C_PARENTHESES) {
@@ -279,7 +279,7 @@ QColor FormatDescription::defaultBackground(TextStyle id)
if (id == C_TEXT) {
return Qt::white;
} else if (id == C_LINE_NUMBER) {
return Utils::Theme::initialPalette().background().color();
return Utils::Theme::initialPalette().window().color();
} else if (id == C_SEARCH_RESULT) {
return QColor(0xffef0b);
} else if (id == C_PARENTHESES) {