# HG changeset patch # User Rik # Date 1604623803 28800 # Node ID e3bc897115ed37cfa542fa8711387c34b92ca3ff # Parent 2cbfd91aafb967861fbe4514f72c33337e216a27 Change feature test to OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API in cset a0ff81c8b8e8. * m4/acinclude.m4: Change name OCTAVE_CHECK_FUNC_QHELPLINK to OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API. * documentation.cc: Change instances of HAVE_QHELPLINK to HAVE_NEW_QHELPINDEXWIDGET_API. diff -r 2cbfd91aafb9 -r e3bc897115ed libgui/src/documentation.cc --- a/libgui/src/documentation.cc Thu Nov 05 16:51:25 2020 -0500 +++ b/libgui/src/documentation.cc Thu Nov 05 16:50:03 2020 -0800 @@ -36,8 +36,8 @@ #include #include #include -#if defined (HAVE_QHELPLINK) -#include +#if defined (HAVE_NEW_QHELPINDEXWIDGET_API) +# include #endif #include #include @@ -185,8 +185,8 @@ if (m_help_engine) { -#if defined (HAVE_QHELPLINK) - // Help engine uses filters instead of old api since Qt 5.15 +#if defined (HAVE_NEW_QHELPINDEXWIDGET_API) + // Starting in Qt 5.15, help engine uses filters instead of old API m_help_engine->setUsesFilterEngine (true); #endif // Layout contents, index and search @@ -234,16 +234,16 @@ navi->addTab (index_all, tr ("Function Index")); -#if defined (HAVE_QHELPLINK) +#if defined (HAVE_NEW_QHELPINDEXWIDGET_API) connect (m_help_engine->indexWidget (), &QHelpIndexWidget::documentActivated, - this, [this](const QHelpLink &link) { + this, [this](const QHelpLink &link) { m_doc_browser->handle_index_clicked (link.url);}); #else - connect(m_help_engine->indexWidget (), - SIGNAL (linkActivated (const QUrl&, const QString&)), - m_doc_browser, SLOT(handle_index_clicked (const QUrl&, - const QString&))); + connect (m_help_engine->indexWidget (), + SIGNAL (linkActivated (const QUrl&, const QString&)), + m_doc_browser, SLOT(handle_index_clicked (const QUrl&, + const QString&))); #endif connect (m_filter, SIGNAL (editTextChanged (const QString&)), diff -r 2cbfd91aafb9 -r e3bc897115ed m4/acinclude.m4 --- a/m4/acinclude.m4 Thu Nov 05 16:51:25 2020 -0500 +++ b/m4/acinclude.m4 Thu Nov 05 16:50:03 2020 -0800 @@ -604,15 +604,16 @@ fi ]) dnl -dnl Check whether the structure QtHelpLink is defined. Then, -dnl QHelpIndexWidget emits documentActivates instead of linkActivated. -dnl This structure/signal was introduced in Qt 5.15. +dnl Check whether new API is used with QHelpIndexWidget. +dnl Under new API, QHelpIndexWidget emits documentActivates. +dnl Under old API, QHelpIndexWidget emits linkActivated. +dnl New structure/signal API was introduced in Qt 5.15. dnl dnl FIXME: Delete this entirely when we drop support for Qt 5.14 or older. dnl -AC_DEFUN([OCTAVE_CHECK_FUNC_QHELPLINK], [ - AC_CACHE_CHECK([for QHelpLink], - [octave_cv_func_qhelplink], +AC_DEFUN([OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API], [ + AC_CACHE_CHECK([for new QHelpIndexWidget API], + [octave_cv_new_qhelpindexwidget_api], [AC_LANG_PUSH(C++) ac_octave_save_CPPFLAGS="$CPPFLAGS" ac_octave_save_CXXFLAGS="$CXXFLAGS" @@ -623,15 +624,15 @@ ]], [[ QHelpLink link; ]])], - octave_cv_func_qhelplink=yes, - octave_cv_func_qhelplink=no) + octave_cv_new_qhelpindexwidget_api=yes, + octave_cv_new_qhelpindexwidget_api=no) CPPFLAGS="$ac_octave_save_CPPFLAGS" CXXFLAGS="$ac_octave_save_CXXFLAGS" AC_LANG_POP(C++) ]) - if test $octave_cv_func_qhelplink = yes; then - AC_DEFINE(HAVE_QHELPLINK, 1, - [Define to 1 if you have the `QHelpLink' structure.]) + if test $octave_cv_new_qhelpindexwidget_api = yes; then + AC_DEFINE(HAVE_NEW_QHELPINDEXWIDGET_API, 1, + [Define to 1 if using new QHelpIndexWidget API.]) fi ]) dnl @@ -2398,7 +2399,7 @@ OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSCLICKABLE OCTAVE_CHECK_FUNC_QHEADERVIEW_SETSECTIONSMOVABLE OCTAVE_CHECK_FUNC_QHELPSEARCHQUERYWIDGET_SEARCHINPUT - OCTAVE_CHECK_FUNC_QHELPLINK + OCTAVE_CHECK_NEW_QHELPINDEXWIDGET_API OCTAVE_CHECK_FUNC_QINSTALLMESSAGEHANDLER OCTAVE_CHECK_FUNC_QLINEEDIT_SETPLACEHOLDERTEXT OCTAVE_CHECK_FUNC_QLIST_ITERATOR_CONSTRUCTOR