Bug#976062: qcustomplot autopkgtest fails with Qt 5.15.2: stderr: warning: ‘QRect QPrinter::pageRect() const’ is deprecated

Dmitry Shachnev mitya57 at debian.org
Sun Nov 29 07:55:33 GMT 2020


Source: qcustomplot
Version: 2.0.1+dfsg1-3
Severity: important
Control: block 975962 by -1

Dear Maintainer,

qcustomplot autopkgtests fail with Qt 5.15.2, which is currently available
in experimental (but which I want to upload to unstable soon).

The test buildtest-text fails because of stderr:

  autopkgtest [02:09:14]: test buildtest-text:  - - - - - - - - - - stderr - - - - - - - - - -
  /tmp/tmp.CkmI82UdMG/src/mainwindow.cpp: In member function ‘void MainWindow::on_actionSave_Document_triggered()’:
  /tmp/tmp.CkmI82UdMG/src/mainwindow.cpp:125:60: warning: ‘QRect QPrinter::pageRect() const’ is deprecated: Use pageLayout().paintRectPixels(resolution()) instead. [-Wdeprecated-declarations]
    125 |     ui->textEdit->document()->setPageSize(printer.pageRect().size());
        |                                                            ^
  In file included from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/qprintengine.h:45,
                   from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:14,
                   from /usr/include/qcustomplot.h:91,
                   from /tmp/tmp.CkmI82UdMG/src/qcpdocumentobject.h:34,
                   from /tmp/tmp.CkmI82UdMG/src/mainwindow.h:32,
                   from /tmp/tmp.CkmI82UdMG/src/mainwindow.cpp:26:
  /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/qprinter.h:259:11: note: declared here
    259 |     QRect pageRect() const;
        |           ^~~~~~~~

Now I think that the previously chosen strategy of fixing all deprecation
warnings was bad, and the tests should just use -Wno-deprecated-declarations.

However, this one is easy to fix: you can just use the suggested replacement
API.

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20201129/2c994e51/attachment.sig>


More information about the debian-science-maintainers mailing list