Mercurial > octave
diff libgui/src/documentation.cc @ 29053:0678fdb81efc stable
avoid deprecated QHelpEngine::linksForIdentifier function
* documentation.cc (void documentation::load_ref): If it is available,
call QHelpEngine::documentsForIdentifier instead of
QHelpEngine::linksForIdentifier. Adapt to different type of returned
object.
* acinclude.m4 (OCTAVE_CHECK_FUNC_QHELPENGINE_DOCUMENTSFORIDENTIFIER):
New macro.
(OCTAVE_CHECK_QT_VERSION): Use it.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Nov 2020 01:21:29 -0500 |
parents | ce849f006568 |
children | d34558c873dc |
line wrap: on
line diff
--- a/libgui/src/documentation.cc Thu Nov 12 01:17:52 2020 -0500 +++ b/libgui/src/documentation.cc Thu Nov 12 01:21:29 2020 -0500 @@ -632,14 +632,23 @@ return; // First search in the function index +#if defined (HAVE_QHELPENGINE_DOCUMENTSFORIDENTIFIER) + QList<QHelpLink> found_links + = m_help_engine->documentsForIdentifier (ref_name); + + QUrl first_url = found_links.constFirst().url; +#else QMap<QString, QUrl> found_links = m_help_engine->linksForIdentifier (ref_name); - QTabWidget *navi = static_cast<QTabWidget*> (widget (0)); + QUrl first_url = found_links.constBegin().value (); +#endif + + QTabWidget *navi = static_cast<QTabWidget*> (widget (0)); if (found_links.count() > 0) { - m_doc_browser->setSource (found_links.constBegin().value()); + m_doc_browser->setSource (first_url); // Switch to function index tab m_help_engine->indexWidget()->filterIndices (ref_name);