comparison widgets/KeyReference.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 c8a6fd3f9dff
children
comparison
equal deleted inserted replaced
1477:0769eaacc6bf 1478:d39db4673676
19 #include <QTextEdit> 19 #include <QTextEdit>
20 #include <QDialog> 20 #include <QDialog>
21 #include <QVBoxLayout> 21 #include <QVBoxLayout>
22 #include <QDialogButtonBox> 22 #include <QDialogButtonBox>
23 #include <QApplication> 23 #include <QApplication>
24 #include <QDesktopWidget> 24 #include <QScreen>
25 25
26 KeyReference::KeyReference() : 26 KeyReference::KeyReference() :
27 m_text(nullptr), 27 m_text(nullptr),
28 m_dialog(nullptr) 28 m_dialog(nullptr)
29 { 29 {
183 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close); 183 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Close);
184 connect(bb, SIGNAL(clicked(QAbstractButton *)), this, SLOT(dialogButtonClicked(QAbstractButton *))); 184 connect(bb, SIGNAL(clicked(QAbstractButton *)), this, SLOT(dialogButtonClicked(QAbstractButton *)));
185 layout->addWidget(bb); 185 layout->addWidget(bb);
186 186
187 m_dialog->show(); 187 m_dialog->show();
188 188
189 QDesktopWidget *desktop = QApplication::desktop(); 189 QScreen *screen = QGuiApplication::primaryScreen();
190 QRect available = desktop->availableGeometry(); 190 QRect available = screen->availableGeometry();
191 191
192 int width = available.width() * 3 / 5; 192 int width = available.width() * 3 / 5;
193 int height = available.height() * 2 / 3; 193 int height = available.height() * 2 / 3;
194 if (height < 450) { 194 if (height < 450) {
195 if (available.height() > 500) height = 450; 195 if (available.height() > 500) height = 450;