Manual dialog test: Fix deprecation warnings
filedialogpanel.cpp:441:55: warning: 'bool QFileDialog::confirmOverwrite() const' is deprecated: Use !testOption(DontConfirmOverwrite) instead [-Wdeprecated-declarations] filedialogpanel.cpp:443:53: warning: 'bool QFileDialog::resolveSymlinks() const' is deprecated: Use !testOption(DontResolveSymlinks) instead [-Wdeprecated-declarations] printdialogpanel.cpp:708:62: warning: 'const QRect QDesktopWidget::availableGeometry(int) const' is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] Change-Id: I087615b7e62b5fc11ec1063590fe55b2615f95fd Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
7a64ffb773
commit
9732ecc321
@ -438,9 +438,9 @@ void FileDialogPanel::restoreDefaults()
|
||||
setComboBoxValue(m_viewMode, d.viewMode());
|
||||
m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly));
|
||||
m_allowedSchemes->setText(QString());
|
||||
m_confirmOverWrite->setChecked(d.confirmOverwrite());
|
||||
m_confirmOverWrite->setChecked(!d.testOption(QFileDialog::DontConfirmOverwrite));
|
||||
m_nameFilterDetailsVisible->setChecked(!d.testOption(QFileDialog::HideNameFilterDetails));
|
||||
m_resolveSymLinks->setChecked(d.resolveSymlinks());
|
||||
m_resolveSymLinks->setChecked(!d.testOption(QFileDialog::DontResolveSymlinks));
|
||||
m_readOnly->setChecked(d.isReadOnly());
|
||||
m_native->setChecked(true);
|
||||
m_customDirIcons->setChecked(d.testOption(QFileDialog::DontUseCustomDirectoryIcons));
|
||||
|
@ -55,6 +55,10 @@
|
||||
#include <QTextStream>
|
||||
#include <QDir>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QScreen>
|
||||
#endif
|
||||
|
||||
const FlagData printerModeComboData[] =
|
||||
{
|
||||
{"ScreenResolution", QPrinter::ScreenResolution},
|
||||
@ -705,7 +709,13 @@ void PrintDialogPanel::showPreviewDialog()
|
||||
{
|
||||
applySettings(m_printer.data());
|
||||
PrintPreviewDialog dialog(m_printer.data(), this);
|
||||
dialog.resize(QApplication::desktop()->availableGeometry().size() * 4/ 5);
|
||||
#if QT_VERSION >= 0x050000
|
||||
const int screenNumber = QApplication::desktop()->screenNumber(this);
|
||||
const QSize availableSize = QGuiApplication::screens().at(screenNumber)->availableSize();
|
||||
#else
|
||||
const QSize availableSize = QApplication::desktop()->availableGeometry().size();
|
||||
#endif
|
||||
dialog.resize(availableSize * 4/ 5);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
retrieveSettings(m_printer.data());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user