comparison widgets/LayerTreeDialog.cpp @ 1478:d39db4673676 by-id

Fix a number of Qt deprecation warnings
author Chris Cannam
date Wed, 03 Jul 2019 08:55:02 +0100
parents bf9ef624aadf
children
comparison
equal deleted inserted replaced
1477:0769eaacc6bf 1478:d39db4673676
23 #include <QGridLayout> 23 #include <QGridLayout>
24 #include <QGroupBox> 24 #include <QGroupBox>
25 #include <QDialogButtonBox> 25 #include <QDialogButtonBox>
26 #include <QHeaderView> 26 #include <QHeaderView>
27 #include <QApplication> 27 #include <QApplication>
28 #include <QDesktopWidget> 28 #include <QScreen>
29 29
30 LayerTreeDialog::LayerTreeDialog(PaneStack *stack, QWidget *parent) : 30 LayerTreeDialog::LayerTreeDialog(PaneStack *stack, QWidget *parent) :
31 QDialog(parent), 31 QDialog(parent),
32 m_paneStack(stack) 32 m_paneStack(stack)
33 { 33 {
87 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close); 87 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close);
88 connect(bb, SIGNAL(rejected()), this, SLOT(reject())); 88 connect(bb, SIGNAL(rejected()), this, SLOT(reject()));
89 grid->addWidget(bb, 2, 0); 89 grid->addWidget(bb, 2, 0);
90 grid->setRowStretch(2, 0); 90 grid->setRowStretch(2, 0);
91 91
92 QDesktopWidget *desktop = QApplication::desktop(); 92 QScreen *screen = QGuiApplication::primaryScreen();
93 QRect available = desktop->availableGeometry(); 93 QRect available = screen->availableGeometry();
94 94
95 int width = available.width() / 2; 95 int width = available.width() / 2;
96 int height = available.height() / 3; 96 int height = available.height() / 3;
97 if (height < 370) { 97 if (height < 370) {
98 if (available.height() > 500) height = 370; 98 if (available.height() > 500) height = 370;