Add deprecation exclusion around deprecated calls in deprecated code

Fix:
io/qdir.cpp:1087:16: warning: ‘static void QResource::addSearchPath(const QString&)’ is deprecated: Use QDir::addSearchPath() instead [-Wdeprecated-declarations]
io/qprocess.cpp:1178:34: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
image/qpixmap.cpp:997:48: warning: ‘static QPixmap QPixmap::grabWidget(QObject*, const QRect&)’ is deprecated: Use QWidget::grab() instead [-Wdeprecated-declarations]
text/qfont.cpp:2218:29: warning: ‘QString QFont::lastResortFamily() const’ is deprecated [-Wdeprecated-declarations]
itemviews/qitemdelegate.cpp:1008:41: warning: ‘static QPixmap* QPixmapCache::find(const QString&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations]

Change-Id: I51259edc175b1f55f61ded3af50ebfffd8c304a8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
Friedemann Kleint 2019-02-06 10:12:48 +01:00 committed by Liang Qi
parent 71a1c66ab9
commit ca65efb0cc
6 changed files with 18 additions and 0 deletions

View File

@ -1084,7 +1084,10 @@ void QDir::setNameFilters(const QStringList &nameFilters)
void QDir::addResourceSearchPath(const QString &path)
{
#ifdef QT_BUILD_CORE_LIB
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QResource::addSearchPath(path);
QT_WARNING_POP
#else
Q_UNUSED(path)
#endif

View File

@ -1175,7 +1175,10 @@ bool QProcessPrivate::_q_processDied()
//emit q->standardErrorClosed();
#if QT_DEPRECATED_SINCE(5, 13)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
emit q->finished(exitCode);
QT_WARNING_POP
#endif
emit q->finished(exitCode, exitStatus);
}

View File

@ -994,7 +994,10 @@ QPixmap QPixmap::grabWidget(QObject *widget, const QRect &rectangle)
*/
QPixmap QPixmap::grabWidget(QObject *widget, int x, int y, int w, int h)
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
return grabWidget(widget, QRect(x, y, w, h));
QT_WARNING_POP
}
#endif

View File

@ -2981,7 +2981,10 @@ void QPainter::setMatrix(const QMatrix &matrix, bool combine)
const QMatrix &QPainter::matrix() const
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
return worldMatrix();
QT_WARNING_POP
}

View File

@ -2215,7 +2215,10 @@ QString QFont::defaultFamily() const
*/
QString QFont::lastResortFont() const
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
return lastResortFamily();
QT_WARNING_POP
}
#endif

View File

@ -1005,11 +1005,14 @@ static QString qPixmapSerial(quint64 i, bool enabled)
QPixmap *QItemDelegate::selected(const QPixmap &pixmap, const QPalette &palette, bool enabled) const
{
const QString key = qPixmapSerial(pixmap.cacheKey(), enabled);
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QPixmap *pm = QPixmapCache::find(key);
if (pm)
return pm;
selectedPixmap(pixmap, palette, enabled);
return QPixmapCache::find(key);
QT_WARNING_POP
}
#endif