diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-09-09 16:11:48 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-10-15 20:09:29 +0200 |
commit | 9cc040a806fd2e6f1458e801a99311168d594c77 (patch) | |
tree | 828ca4008a50f44b7b98f7e50f67d01951b4d9ba /examples/xml | |
parent | 92b9dcfe2ba602fc396a4806597b9440ed63bded (diff) |
Prepare for deprecating the QDesktopWidget
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.
Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()
Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'examples/xml')
-rw-r--r-- | examples/xml/dombookmarks/mainwindow.cpp | 2 | ||||
-rw-r--r-- | examples/xml/saxbookmarks/mainwindow.cpp | 2 | ||||
-rw-r--r-- | examples/xml/streambookmarks/mainwindow.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp index fade2dfc96..b8f2e12918 100644 --- a/examples/xml/dombookmarks/mainwindow.cpp +++ b/examples/xml/dombookmarks/mainwindow.cpp @@ -63,7 +63,7 @@ MainWindow::MainWindow() statusBar()->showMessage(tr("Ready")); setWindowTitle(tr("DOM Bookmarks")); - const QSize availableSize = QApplication::desktop()->availableGeometry(this).size(); + const QSize availableSize = screen()->availableGeometry().size(); resize(availableSize.width() / 2, availableSize.height() / 3); } diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp index 0583cd82cf..8b7733081f 100644 --- a/examples/xml/saxbookmarks/mainwindow.cpp +++ b/examples/xml/saxbookmarks/mainwindow.cpp @@ -74,7 +74,7 @@ MainWindow::MainWindow() statusBar()->showMessage(tr("Ready")); setWindowTitle(tr("SAX Bookmarks")); - const QSize availableSize = QApplication::desktop()->availableGeometry(this).size(); + const QSize availableSize = screen()->availableGeometry().size(); resize(availableSize.width() / 2, availableSize.height() / 3); } diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp index c9a18fa3c4..d0e7bf30c9 100644 --- a/examples/xml/streambookmarks/mainwindow.cpp +++ b/examples/xml/streambookmarks/mainwindow.cpp @@ -75,7 +75,7 @@ MainWindow::MainWindow() statusBar()->showMessage(tr("Ready")); setWindowTitle(tr("QXmlStream Bookmarks")); - const QSize availableSize = QApplication::desktop()->availableGeometry(this).size(); + const QSize availableSize = screen()->availableGeometry().size(); resize(availableSize.width() / 2, availableSize.height() / 3); } //! [0] |