Mercurial > octave
changeset 31744:9cc509a00b54
assume QPrinter::setPageSize is avaialable
The QPrinter::setPageSize function was introduced in Qt 5.3.
* acinclude.m4 (OCTAVE_CHECK_FUNC_QPRINTER_SETPAGESIZE): Delete.
(OCTAVE_CHECK_QT_VERSION): Delete use.
* octave-svgconvert.cc: Don't check HAVE_QPRINTER_SETPAGESIZE.
Eliminate code to work around the absence of QPrinter::setPageSize.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 17 Jan 2023 09:42:15 -0500 |
parents | 9f7cb0e647be |
children | 6973fe71f6c5 |
files | m4/acinclude.m4 src/octave-svgconvert.cc |
diffstat | 2 files changed, 0 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/m4/acinclude.m4 Tue Jan 17 09:11:44 2023 -0500 +++ b/m4/acinclude.m4 Tue Jan 17 09:42:15 2023 -0500 @@ -681,37 +681,6 @@ fi ]) dnl -dnl Check whether the Qt class QPrinter has the setPageSize member function. -dnl This member function was introduced in Qt 5.3. -dnl -dnl FIXME: remove this test when we drop support for Qt older than 5.3. -dnl -AC_DEFUN([OCTAVE_CHECK_FUNC_QPRINTER_SETPAGESIZE], [ - AC_CACHE_CHECK([for QPrinter::setPageSize in <QPrinter>], - [octave_cv_func_qprinter_setpagesize], - [AC_LANG_PUSH(C++) - ac_octave_save_CPPFLAGS="$CPPFLAGS" - ac_octave_save_CXXFLAGS="$CXXFLAGS" - CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" - CXXFLAGS="$CXXPICFLAG $CXXFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <QPrinter> - ]], [[ - QPrinter printer; - printer.setPageSize (QPageSize (QSizeF (8.5, 11.0), QPageSize::Inch)); - ]])], - octave_cv_func_qprinter_setpagesize=yes, - octave_cv_func_qprinter_setpagesize=no) - CPPFLAGS="$ac_octave_save_CPPFLAGS" - CXXFLAGS="$ac_octave_save_CXXFLAGS" - AC_LANG_POP(C++) - ]) - if test $octave_cv_func_qprinter_setpagesize = yes; then - AC_DEFINE(HAVE_QPRINTER_SETPAGESIZE, 1, - [Define to 1 if you have the 'QPrinter::setPageSize' member function.]) - fi -]) -dnl dnl Check whether the Qt class QScreen has the devicePixelRatio member function. dnl This member function was introduced in Qt 5.5. dnl @@ -2281,7 +2250,6 @@ OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API OCTAVE_CHECK_FUNC_QLIST_ITERATOR_CONSTRUCTOR OCTAVE_CHECK_FUNC_QMAINWINDOW_RESIZEDOCKS - OCTAVE_CHECK_FUNC_QPRINTER_SETPAGESIZE OCTAVE_CHECK_FUNC_QSCREEN_DEVICEPIXELRATIO OCTAVE_CHECK_FUNC_QHELPENGINE_DOCUMENTSFORIDENTIFIER OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION
--- a/src/octave-svgconvert.cc Tue Jan 17 09:11:44 2023 -0500 +++ b/src/octave-svgconvert.cc Tue Jan 17 09:42:15 2023 -0500 @@ -61,13 +61,9 @@ m_printer.setFontEmbeddingEnabled (true); m_printer.setOutputFileName (fname); m_printer.setFullPage (true); -#if defined (HAVE_QPRINTER_SETPAGESIZE) m_printer.setPageSize (QPageSize (sz.size (), QPageSize::Point, QString ("custom"), QPageSize::ExactMatch)); -#else - m_printer.setPaperSize (sz.size (), QPrinter::Point); -#endif // Painter settings begin (&m_printer);