QtWidgets: compile with QT_DISABLE_DEPRECATED_BEFORE=0x050d00

Don't call or implement functions which are not available when compiling
with QT_DISABLE_DEPRECATED_BEFORE=0x050d00

Change-Id: If427e20774b358dc16fa1c7d7ba8c0feba3e144b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Christian Ehrlicher 2019-02-09 14:44:43 +01:00
parent ee845dfc39
commit 7c254024f3
5 changed files with 29 additions and 5 deletions

View File

@ -779,7 +779,9 @@ void QDialog::setVisible(bool visible)
return;
QWidget::setVisible(visible);
#if QT_DEPRECATED_SINCE(5, 13)
showExtension(d->doShowExtension);
#endif
QWidget *fw = window()->focusWidget();
if (!fw)
fw = this;

View File

@ -103,7 +103,9 @@ class Q_WIDGETS_EXPORT QGraphicsScene : public QObject
Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth)
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
Q_PROPERTY(QFont font READ font WRITE setFont)
#if QT_DEPRECATED_SINCE(5, 13)
Q_PROPERTY(bool sortCacheEnabled READ isSortCacheEnabled WRITE setSortCacheEnabled)
#endif
Q_PROPERTY(bool stickyFocus READ stickyFocus WRITE setStickyFocus)
Q_PROPERTY(qreal minimumRenderSize READ minimumRenderSize WRITE setMinimumRenderSize)
Q_PROPERTY(bool focusOnTouch READ focusOnTouch WRITE setFocusOnTouch)

View File

@ -1243,6 +1243,7 @@ QStyle* QApplication::setStyle(const QString& style)
return s;
}
#if QT_DEPRECATED_SINCE(5, 8)
/*!
Returns the color specification.
\obsolete
@ -1317,6 +1318,7 @@ void QApplication::setColorSpec(int spec)
{
Q_UNUSED(spec)
}
#endif
/*!
\property QApplication::globalStrut

View File

@ -176,26 +176,32 @@ void QDesktopWidgetPrivate::_q_updateScreens()
// Notice that we trigger screenCountChanged even if a screen was removed and another one added,
// in which case the total number of screens did not change. This is the only way for applications
// to notice that a screen was swapped out against another one.
#if QT_DEPRECATED_SINCE(5, 11)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
emit q->screenCountChanged(targetLength);
QT_WARNING_POP
#endif
}
#if QT_DEPRECATED_SINCE(5, 11)
foreach (int changedScreen, changedScreens)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
emit q->resized(changedScreen);
QT_WARNING_POP
#endif
}
void QDesktopWidgetPrivate::_q_availableGeometryChanged()
{
#if QT_DEPRECATED_SINCE(5, 11)
Q_Q(QDesktopWidget);
if (QScreen *screen = qobject_cast<QScreen *>(q->sender()))
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
emit q->workAreaResized(QGuiApplication::screens().indexOf(screen));
QT_WARNING_POP
#endif
}
QDesktopWidget::QDesktopWidget()
@ -212,10 +218,12 @@ QDesktopWidget::~QDesktopWidget()
{
}
#if QT_DEPRECATED_SINCE(5, 11)
bool QDesktopWidget::isVirtualDesktop() const
{
return QDesktopWidgetPrivate::isVirtualDesktop();
}
#endif
bool QDesktopWidgetPrivate::isVirtualDesktop()
{
@ -242,26 +250,29 @@ int QDesktopWidgetPrivate::height()
return geometry().height();
}
#if QT_DEPRECATED_SINCE(5, 11)
int QDesktopWidget::primaryScreen() const
{
return QDesktopWidgetPrivate::primaryScreen();
}
#endif
int QDesktopWidgetPrivate::primaryScreen()
{
return 0;
}
int QDesktopWidget::numScreens() const
{
return QDesktopWidgetPrivate::numScreens();
}
int QDesktopWidgetPrivate::numScreens()
{
return qMax(QGuiApplication::screens().size(), 1);
}
#if QT_DEPRECATED_SINCE(5, 11)
int QDesktopWidget::numScreens() const
{
return QDesktopWidgetPrivate::numScreens();
}
QWidget *QDesktopWidget::screen(int screen)
{
Q_D(QDesktopWidget);
@ -274,6 +285,7 @@ const QRect QDesktopWidget::availableGeometry(int screenNo) const
{
return QDesktopWidgetPrivate::availableGeometry(screenNo);
}
#endif
const QRect QDesktopWidgetPrivate::availableGeometry(int screenNo)
{
@ -281,10 +293,12 @@ const QRect QDesktopWidgetPrivate::availableGeometry(int screenNo)
return screen ? screen->availableGeometry() : QRect();
}
#if QT_DEPRECATED_SINCE(5, 11)
const QRect QDesktopWidget::screenGeometry(int screenNo) const
{
return QDesktopWidgetPrivate::screenGeometry(screenNo);
}
#endif
const QRect QDesktopWidgetPrivate::screenGeometry(int screenNo)
{
@ -344,10 +358,12 @@ int QDesktopWidgetPrivate::screenNumber(const QWidget *w)
return allScreens.indexOf(widgetScreen);
}
#if QT_DEPRECATED_SINCE(5, 11)
int QDesktopWidget::screenNumber(const QPoint &p) const
{
return QDesktopWidgetPrivate::screenNumber(p);
}
#endif
int QDesktopWidgetPrivate::screenNumber(const QPoint &p)
{

View File

@ -52,9 +52,11 @@ class QDesktopWidgetPrivate;
class Q_WIDGETS_EXPORT QDesktopWidget : public QWidget
{
Q_OBJECT
#if QT_DEPRECATED_SINCE(5, 11)
Q_PROPERTY(bool virtualDesktop READ isVirtualDesktop)
Q_PROPERTY(int screenCount READ screenCount NOTIFY screenCountChanged)
Q_PROPERTY(int primaryScreen READ primaryScreen NOTIFY primaryScreenChanged)
#endif
public:
QDesktopWidget();
~QDesktopWidget();