diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-09 14:44:43 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-13 05:55:31 +0000 |
commit | 7c254024f32ab783385718dea08829c5e0c82408 (patch) | |
tree | 3d8a584d7ab3bae46f7c6e17893463f48ed984e9 /src/widgets/kernel/qdesktopwidget.cpp | |
parent | ee845dfc3907cde91ffe79d9c2372d92ae900813 (diff) |
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>
Diffstat (limited to 'src/widgets/kernel/qdesktopwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qdesktopwidget.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp index 5fb7882932..d17c7eb36c 100644 --- a/src/widgets/kernel/qdesktopwidget.cpp +++ b/src/widgets/kernel/qdesktopwidget.cpp @@ -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,24 +250,27 @@ 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 +int QDesktopWidgetPrivate::numScreens() { - return QDesktopWidgetPrivate::numScreens(); + return qMax(QGuiApplication::screens().size(), 1); } -int QDesktopWidgetPrivate::numScreens() +#if QT_DEPRECATED_SINCE(5, 11) +int QDesktopWidget::numScreens() const { - return qMax(QGuiApplication::screens().size(), 1); + return QDesktopWidgetPrivate::numScreens(); } QWidget *QDesktopWidget::screen(int screen) @@ -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) { |