Mercurial > octave
comparison m4/acinclude.m4 @ 29271:0348f3f57e3c stable
avoid build errors with Qt4 (bug #59813)
* acinclude.m4 (OCTAVE_CHECK_FUNC_QFONTDATABASE_SYSTEMFONT,
OCTAVE_CHECK_QVARIANT_CANCONVERT_ACCEPTS_QMETATYPE_TYPE): New macros.
(OCTAVE_CHECK_QT_VERSION): Use them.
* resource-manager.cc (resource_manager::get_default_font_family):
Check availability of QFontDatabase::systemFont, fall back on
QFont::setStyleHint, then global_font_family.
* octave-dock-widget.cc (octave_dock_widget::handle_settings):
Check whether QVariant::canConvert accepts QMetatype::Type. Use
QVariant::Type as fallback.
* variable-editor-model.cc (variable_editor_model::setData): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 04 Jan 2021 13:37:34 -0500 |
parents | 5d7a651bf0bb |
children | 11bc1b22b29f 0a5b15007766 |
comparison
equal
deleted
inserted
replaced
29263:a3d92c4ad550 | 29271:0348f3f57e3c |
---|---|
1086 AC_LANG_POP(C++) | 1086 AC_LANG_POP(C++) |
1087 ]) | 1087 ]) |
1088 if test $octave_cv_qt_splitbehavior_enum = yes; then | 1088 if test $octave_cv_qt_splitbehavior_enum = yes; then |
1089 AC_DEFINE(HAVE_QT_SPLITBEHAVIOR_ENUM, 1, | 1089 AC_DEFINE(HAVE_QT_SPLITBEHAVIOR_ENUM, 1, |
1090 [Define to 1 if you have the `Qt::SplitBehavior' enum.]) | 1090 [Define to 1 if you have the `Qt::SplitBehavior' enum.]) |
1091 fi | |
1092 ]) | |
1093 dnl | |
1094 dnl Check whether the Qt class QFontDatabase has the systemFont member | |
1095 dnl function. This function was introduced in Qt 5.2. | |
1096 dnl | |
1097 AC_DEFUN([OCTAVE_CHECK_FUNC_QFONTDATABASE_SYSTEMFONT], [ | |
1098 AC_CACHE_CHECK([for QFontDatabase::systemFont function], | |
1099 [octave_cv_func_qfontdatabase_systemfont], | |
1100 [AC_LANG_PUSH(C++) | |
1101 ac_octave_save_CPPFLAGS="$CPPFLAGS" | |
1102 ac_octave_save_CXXFLAGS="$CXXFLAGS" | |
1103 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" | |
1104 CXXFLAGS="$CXXPICFLAG $CXXFLAGS" | |
1105 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
1106 #include <QFontDatabase> | |
1107 #include <QFont> | |
1108 ]], [[ | |
1109 QFont font = QFontDatabase::systemFont (QFontDatabase::FixedFont); | |
1110 ]])], | |
1111 octave_cv_func_qfontdatabase_systemfont=yes, | |
1112 octave_cv_func_qfontdatabase_systemfont=no) | |
1113 CPPFLAGS="$ac_octave_save_CPPFLAGS" | |
1114 CXXFLAGS="$ac_octave_save_CXXFLAGS" | |
1115 AC_LANG_POP(C++) | |
1116 ]) | |
1117 if test $octave_cv_func_qfontdatabase_systemfont = yes; then | |
1118 AC_DEFINE(HAVE_QFONTDATABASE_SYSTEMFONT, 1, | |
1119 [Define to 1 if you have the `QFontDatabase::systemFont' function.]) | |
1091 fi | 1120 fi |
1092 ]) | 1121 ]) |
1093 dnl | 1122 dnl |
1094 dnl Check whether the Qt class QList has a constructor that accepts | 1123 dnl Check whether the Qt class QList has a constructor that accepts |
1095 dnl a pair of iterators. This constructor was introduced in Qt 5.14. | 1124 dnl a pair of iterators. This constructor was introduced in Qt 5.14. |
1965 AC_DEFINE(HAVE_QFONT_MONOSPACE, 1, | 1994 AC_DEFINE(HAVE_QFONT_MONOSPACE, 1, |
1966 [Define to 1 if `Monospace' is a member of `QFont'.]) | 1995 [Define to 1 if `Monospace' is a member of `QFont'.]) |
1967 fi | 1996 fi |
1968 ]) | 1997 ]) |
1969 dnl | 1998 dnl |
1999 dnl Check whether QVariant::canConvert accepts a QMetaType::Type | |
2000 dnl enumeration value as an argument. | |
2001 dnl | |
2002 AC_DEFUN([OCTAVE_CHECK_QVARIANT_CANCONVERT_ACCEPTS_QMETATYPE_TYPE], [ | |
2003 AC_CACHE_CHECK([whether QVariant::canConvert accepts QMetaType::Type argument], | |
2004 [octave_cv_qvariant_canconvert_accepts_qmetatype_type], | |
2005 [AC_LANG_PUSH(C++) | |
2006 ac_octave_save_CPPFLAGS="$CPPFLAGS" | |
2007 ac_octave_save_CXXFLAGS="$CXXFLAGS" | |
2008 CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" | |
2009 CXXFLAGS="$CXXPICFLAG $CXXFLAGS" | |
2010 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | |
2011 #include <QMetaType> | |
2012 #include <QVariant> | |
2013 ]], [[ | |
2014 QVariant var; | |
2015 QMetaType::Type type = QMetaType::QString; | |
2016 var.canConvert (type); | |
2017 ]])], | |
2018 octave_cv_qvariant_canconvert_accepts_qmetatype_type=yes, | |
2019 octave_cv_qvariant_canconvert_accepts_qmetatype_type=no) | |
2020 CPPFLAGS="$ac_octave_save_CPPFLAGS" | |
2021 CXXFLAGS="$ac_octave_save_CXXFLAGS" | |
2022 AC_LANG_POP(C++) | |
2023 ]) | |
2024 if test $octave_cv_qvariant_canconvert_accepts_qmetatype_type = yes; then | |
2025 AC_DEFINE(QVARIANT_CANCONVERT_ACCEPTS_QMETATYPE_TYPE, 1, | |
2026 [Define to 1 if `QVariant::canConvert' accepts `QMetaType::Type' enumeration value as argument.]) | |
2027 fi | |
2028 ]) | |
2029 dnl | |
1970 dnl Check for the Qhull version. | 2030 dnl Check for the Qhull version. |
1971 dnl | 2031 dnl |
1972 AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION], [ | 2032 AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION], [ |
1973 AC_CACHE_CHECK([for qh_version in $QHULL_LIBS], | 2033 AC_CACHE_CHECK([for qh_version in $QHULL_LIBS], |
1974 [octave_cv_lib_qhull_version], | 2034 [octave_cv_lib_qhull_version], |
2516 ## We don't need to unset cache variables for any of the remaining | 2576 ## We don't need to unset cache variables for any of the remaining |
2517 ## tests if they fail because we have already decided that the Qt | 2577 ## tests if they fail because we have already decided that the Qt |
2518 ## version that we are testing now will be the one used. | 2578 ## version that we are testing now will be the one used. |
2519 | 2579 |
2520 OCTAVE_CHECK_FUNC_QCOMBOBOX_SETCURRENTTEXT | 2580 OCTAVE_CHECK_FUNC_QCOMBOBOX_SETCURRENTTEXT |
2581 OCTAVE_CHECK_FUNC_QFONTDATABASE_SYSTEMFONT | |
2521 OCTAVE_CHECK_FUNC_QFONTMETRICS_HORIZONTAL_ADVANCE | 2582 OCTAVE_CHECK_FUNC_QFONTMETRICS_HORIZONTAL_ADVANCE |
2522 OCTAVE_CHECK_FUNC_QGUIAPPLICATION_SETDESKTOPFILENAME | 2583 OCTAVE_CHECK_FUNC_QGUIAPPLICATION_SETDESKTOPFILENAME |
2523 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONRESIZEMODE | 2584 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONRESIZEMODE |
2524 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSCLICKABLE | 2585 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSCLICKABLE |
2525 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSMOVABLE | 2586 OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSMOVABLE |
2537 OCTAVE_CHECK_FUNC_QHELPENGINE_DOCUMENTSFORIDENTIFIER | 2598 OCTAVE_CHECK_FUNC_QHELPENGINE_DOCUMENTSFORIDENTIFIER |
2538 OCTAVE_CHECK_FUNC_QWHEELEVENT_ANGLEDELTA | 2599 OCTAVE_CHECK_FUNC_QWHEELEVENT_ANGLEDELTA |
2539 OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION | 2600 OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION |
2540 OCTAVE_CHECK_MEMBER_QFONT_FORCE_INTEGER_METRICS | 2601 OCTAVE_CHECK_MEMBER_QFONT_FORCE_INTEGER_METRICS |
2541 OCTAVE_CHECK_MEMBER_QFONT_MONOSPACE | 2602 OCTAVE_CHECK_MEMBER_QFONT_MONOSPACE |
2603 OCTAVE_CHECK_QVARIANT_CANCONVERT_ACCEPTS_QMETATYPE_TYPE | |
2542 OCTAVE_HAVE_QGUIAPPLICATION | 2604 OCTAVE_HAVE_QGUIAPPLICATION |
2543 | 2605 |
2544 OCTAVE_CHECK_QREGION_ITERATORS | 2606 OCTAVE_CHECK_QREGION_ITERATORS |
2545 OCTAVE_CHECK_QT_SPLITBEHAVIOR_ENUM | 2607 OCTAVE_CHECK_QT_SPLITBEHAVIOR_ENUM |
2546 | 2608 |