Qt5: QDesktopWidget is deprecated use QScreen [-Wdeprecated-declarations]
This commit is contained in:
@@ -37,6 +37,10 @@
|
||||
# include <QToolButton>
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <QScreen>
|
||||
#endif
|
||||
|
||||
#include <Base/Tools.h>
|
||||
#include "Action.h"
|
||||
#include "Application.h"
|
||||
@@ -420,7 +424,11 @@ void WorkbenchComboBox::showPopup()
|
||||
int rows = count();
|
||||
if (rows > 0) {
|
||||
int height = view()->sizeHintForRow(0);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
int maxHeight = QApplication::primaryScreen()->size().height();
|
||||
#else
|
||||
int maxHeight = QApplication::desktop()->height();
|
||||
#endif
|
||||
view()->setMinimumHeight(qMin(height * rows, maxHeight/2));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
# include <QScrollBar>
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <QScreen>
|
||||
#endif
|
||||
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Console.h>
|
||||
#include <App/Application.h>
|
||||
@@ -307,7 +311,11 @@ void DlgPreferencesImp::resizeEvent(QResizeEvent* ev)
|
||||
if (canEmbedScrollArea) {
|
||||
// embed the widget stack into a scroll area if the size is
|
||||
// bigger than the available desktop
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QRect rect = QApplication::primaryScreen()->availableGeometry();
|
||||
#else
|
||||
QRect rect = QApplication::desktop()->availableGeometry();
|
||||
#endif
|
||||
int maxHeight = rect.height() - 60;
|
||||
int maxWidth = rect.width();
|
||||
if (height() > maxHeight || width() > maxWidth) {
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
# include <QWhatsThis>
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <QScreen>
|
||||
#endif
|
||||
|
||||
// FreeCAD Base header
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/Exception.h>
|
||||
@@ -1409,7 +1413,11 @@ void MainWindow::loadWindowSettings()
|
||||
QString qtver = QString::fromLatin1("Qt%1.%2").arg(major).arg(minor);
|
||||
QSettings config(vendor, application);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QRect rect = QApplication::primaryScreen()->availableGeometry();
|
||||
#else
|
||||
QRect rect = QApplication::desktop()->availableGeometry();
|
||||
#endif
|
||||
int maxHeight = rect.height();
|
||||
int maxWidth = rect.width();
|
||||
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
# include <QGLContext>
|
||||
#endif
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <QScreen>
|
||||
#endif
|
||||
|
||||
#include <LibraryVersions.h>
|
||||
#include <zlib.h>
|
||||
#include <boost/version.hpp>
|
||||
@@ -234,7 +238,11 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent)
|
||||
|
||||
setModal(true);
|
||||
ui->setupUi(this);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QRect rect = QApplication::primaryScreen()->availableGeometry();
|
||||
#else
|
||||
QRect rect = QApplication::desktop()->availableGeometry();
|
||||
#endif
|
||||
QPixmap image = getMainWindow()->splashImage();
|
||||
|
||||
// Make sure the image is not too big
|
||||
|
||||
Reference in New Issue
Block a user