Qt5: QDesktopWidget is deprecated use QScreen [-Wdeprecated-declarations]

This commit is contained in:
wmayer
2020-06-11 02:21:57 +02:00
committed by wwmayer
parent deb39c4321
commit eced0cb568
6 changed files with 48 additions and 0 deletions

View File

@@ -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));
}