bugGNU Octave - Bugs: bug #59375, [Doc pane] Function index largely...

 
 

bug #59375: [Doc pane] Function index largely dysfunctional

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Wed 28 Oct 2020 04:58:56 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * 6.0.92 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 05 Nov 2020 09:20:16 PM UTC, comment #26: 

Pushed with cset http://hg.savannah.gnu.org/hgweb/octave/rev/a0ff81c8b8e8

Closing this report.

Torsten Lilge <ttl>
Group Member
Thu 05 Nov 2020 07:59:41 PM UTC, comment #25: 

As it appears to work, I'd say it is fine to go ahead and apply it to stable.  Thanks!

John W. Eaton <jwe>
Group administrator
Thu 05 Nov 2020 07:33:49 PM UTC, comment #24: 

Thanks for testing.

Markus, I see the warnings every time I compile with Qt 5.15, no matter whether the patch is applied or not. So I guess these warnings should have been showing up in mxe builds since Qt 5.15 is used there.

Torsten Lilge <ttl>
Group Member
Thu 05 Nov 2020 07:24:56 AM UTC, comment #23: 

Patch works here as well, thanks Torsten.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 05 Nov 2020 07:17:58 AM UTC, comment #22: 

I can confirm that without the patch, the function index doesn't work for MXE Octave build for Windows. With the patch it works.

During compilation the compiler emits the following warnings for the changed file:

/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc: In member function 'void octave::documentation::global_search()':
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:446:75: warning: 'QStringList QString::split(const QString&, QString::SplitBehavior, Qt::CaseSensitivity) const' is deprecated: Use Qt::SplitBehavior variant instead [-Wdeprecated-declarations]
  446 |       m_internal_search = query_string.split (" ", QString::SkipEmptyParts).first ();
      |                                                                           ^
In file included from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtGui/qkeysequence.h:44,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtWidgets/qaction.h:44,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtWidgets/QAction:1,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:30:
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtCore/qstring.h:604:17: note: declared here
  604 |     QStringList split(const QString &sep, SplitBehavior behavior,
      |                 ^~~~~
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc: In member function 'void octave::documentation::load_ref(const QString&)':
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:632:52: warning: 'QMap<QString, QUrl> QHelpEngineCore::linksForIdentifier(const QString&) const' is deprecated: Use documentsForIdentifier() instead [-Wdeprecated-declarations]
  632 |       = m_help_engine->linksForIdentifier (ref_name);
      |                                                    ^
In file included from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtHelp/qhelpengine.h:43,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtHelp/QHelpEngine:1,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.h:37,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:51:
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtHelp/qhelpenginecore.h:110:25: note: declared here
  110 |     QMap<QString, QUrl> linksForIdentifier(const QString &id) const;
      |                         ^~~~~~~~~~~~~~~~~~
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc: In member function 'void octave::documentation::find(bool)':
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:724:43: warning: 'constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = QTextDocument::FindFlag; QFlags<T>::Zero = int QFlags<QTextDocument::FindFlag>::Private::*]' is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  724 |     QTextDocument::FindFlags find_flags = 0;
      |                                           ^
In file included from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtCore/qglobal.h:1302,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtGui/qtguiglobal.h:43,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtWidgets/qtwidgetsglobal.h:43,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtWidgets/qaction.h:43,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtWidgets/QAction:1,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:30:
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc: In member function 'virtual void octave::documentation_browser::wheelEvent(QWheelEvent*)':
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:972:24: warning: 'int QWheelEvent::delta() const' is deprecated: Use angleDelta() [-Wdeprecated-declarations]
  972 |         if (we->delta () > 0)
      |                        ^
In file included from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtGui/QKeyEvent:1,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/shortcut-manager.h:29,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/octave-qobject.h:39,
                 from /home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/tmp-stable-octave/octave-6.0.93/libgui/src/documentation.cc:54:
/home/osboxes/Documents/Repositories/Octave/mxe-octave-stable/usr/x86_64-w64-mingw32/qt5/include/QtGui/qevent.h:219:16: note: declared here
  219 |     inline int delta() const  { return qt4D; }
      |                ^~~~~


Those are probably unrelated. I'm not sure if they are important.

Markus Mützel <mmuetzel>
Group administrator
Wed 04 Nov 2020 09:54:14 PM UTC, comment #21: 

OK, building now. Tomorrow I'll have results (slow build box).

Philip Nienhuis <philipnienhuis>
Group Member
Wed 04 Nov 2020 07:32:31 PM UTC, comment #20: 

The patch is for the stable branch. If it can fix the issue we can still use Qt 5.15 for the MXE-build of the release.

Torsten Lilge <ttl>
Group Member
Wed 04 Nov 2020 07:19:12 PM UTC, comment #19: 

Thanks Torsten.
But doesn't apply cleanly here:

[philip@lx230 dev_p]$ hg -v import ../patch_trials/bug59375_doc-pane_v01.patch
applying ../patch_trials/bug59375_doc-pane_v01.patch
patching file libgui/src/documentation.cc
patching file m4/acinclude.m4
Hunk #1 FAILED at 603
Hunk #2 FAILED at 2366
2 out of 2 hunks FAILED -- saving rejects to file m4/acinclude.m4.rej


I tried against dev Octave, is that OK?

$ hg -v summary
parent: 29022:e8fa10f8920c tip
 Fix typo in BIST for save() and mark it as fixed.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 03 Nov 2020 09:28:24 PM UTC, comment #18: 

And here the promised attachment ...

(file #50200)

Torsten Lilge <ttl>
Group Member
Tue 03 Nov 2020 09:23:46 PM UTC, comment #17: 

No patch attached ?

Philip Nienhuis <philipnienhuis>
Group Member
Tue 03 Nov 2020 09:19:35 PM UTC, comment #16: 

I have attached a patch (do not want to directly push just before the release) that solves the issue for me when building by using Qt 5.15 in Linux. It adds a test for the new QHelpLink that is used in the new API of Qt's help system.

Torsten Lilge <ttl>
Group Member
Fri 30 Oct 2020 12:03:10 PM UTC, comment #15: 

I can avoid the problem in our Windows builds by using 5.14.2 but unless this is actually a bug in Qt then we'll begin seeing it soon on other systems as they move to Qt 5.15 and later.

As I noted in comment #10, I think this means we need to understand how "filtering" works for these index lists.

John W. Eaton <jwe>
Group administrator
Fri 30 Oct 2020 06:27:02 AM UTC, comment #14: 

I am seeing comment #10 and comment #11 just now. If linkActivated should still be emitted but is not, I have currently no idea how to quickly fix this.

Torsten Lilge <ttl>
Group Member
Fri 30 Oct 2020 03:06:34 AM UTC, comment #13: 

I confirm the problem on Fedora 33 (qt-5.15.1)

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 30 Oct 2020 02:28:23 AM UTC, comment #12: 

The QHelpIndexWidget::showLink function from 5.15 (shown in comment #10, copied from the 5.15 sources used to build 6.0.92) emits the documentsActivated and linksActivated signals if the list returned from documentsForKeyword has more than one element, or the documentActivated and linkActivated signals if there is only one element in the list.

I tried tracing this with gdb but couldn't get good info so I added some old-fashioned print statements that showed the showLink function not emitting any signals because the list returned by documentsForKeyword was empty.  I have no idea why.

I've since built 6.0.92 with Qt 5.14.2 and the links work as expected.

Unless there is a quick fix for this problem using Qt 5.15, then my solution is to build the 6.1 release using Qt 5.14.2.

John W. Eaton <jwe>
Group administrator
Thu 29 Oct 2020 09:35:28 PM UTC, comment #11: 

The QHelpIndexWidget::linkActivated(QUrl, QString) signal was replaced by QHelpIndexWidget::documentActivated(QHelpLink) in Qt 5.15, which is used for the MXE build. That's why the related slot was not executed (as reported in comment #5). The QHelpLink type of the new signal's argument was also introduced in 5.15, so it should be sufficient that configure just tests for QHelpLink.

However, this explains the dead link but not the empty contents and index panes, which I am seeing from time to time (not always) on windows.

Torsten Lilge <ttl>
Group Member
Thu 29 Oct 2020 09:15:04 PM UTC, comment #10: 

I think the problem might be due to changes in the Qt Help system? On my Debian system, I have Qt 5.14.2, but mxe-octave is now using 5.15 and there have apparently been some changes for filtered data?  I'm not sure exactly how the selection is supposed to work, but in 5.15, QHelpIndexWidget::linkActivated signal is deprecated.  It is still supposed to work, but for some reason appears to not be emitted in Octave now.  I traced it to the QHelpIndexWidget::showLink function and it seems that the list of docs returned by the call to QHelpEngineCore::documentsForKeyword is empty.  The Qt 5.15 docs  say


Returns a list of all the document links found for the keyword. The returned list contents depend on the current filter, and therefore only the keywords registered for the current filter will be returned.

This function was introduced in Qt 5.15.


https://doc.qt.io/qt-5/qhelpenginecore.html#documentsForKeyword

I don't understand how filtering is supposed to work or what it means for "keywords to be registered for the current filter" or even if we are using filters in this sense.  But it seems there have been many changes in 5.15 related to this topic, so I'm going back to see whether 5.14.2 solves the problem.  I expect it will, as that was the version we used for 5.2.0 and selecting an entry from the list works for me using that version.  If it does, then maybe we should just go back to that version for building the Windows binaries for the 6.1 release?


void QHelpIndexWidget::showLink(const QModelIndex &index)
{
    if (!index.isValid())
        return;

    QHelpIndexModel *indexModel = qobject_cast<QHelpIndexModel*>(model());
    if (!indexModel)
        return;

    const QVariant &v = indexModel->data(index, Qt::DisplayRole);
    const QString name = v.isValid() ? v.toString() : QString();

    const QList<QHelpLink> &docs = indexModel->helpEngine()->documentsForKeyword(name);
    if (docs.count() > 1) {
        emit documentsActivated(docs, name);
        QT_WARNING_PUSH
        QT_WARNING_DISABLE_DEPRECATED
        QMap<QString, QUrl> links;
        for (const auto &doc : docs)
            static_cast<QMultiMap<QString, QUrl> &>(links).insert(doc.title, doc.url);
        emit linksActivated(links, name);
        QT_WARNING_POP
    } else if (!docs.isEmpty()) {
        emit documentActivated(docs.first(), name);
        QT_WARNING_PUSH
        QT_WARNING_DISABLE_DEPRECATED
        emit linkActivated(docs.first().url, name);
        QT_WARNING_POP
    }
}


John W. Eaton <jwe>
Group administrator
Thu 29 Oct 2020 03:09:45 PM UTC, comment #9: 

@Torsten, comment #7:

Yes I see a list of functions in the function index (none of the items clickable let alone double-clickable) and an expandable & double-clickable "GNU Octave manual" item in the lower left pane of the Doc tab.

The search tab also works.

It's only the Function index tab that is crippled.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 29 Oct 2020 08:53:28 AM UTC, comment #8: 

Regarding comment #7: "Are you seeing a list of functions in the function index tab and the table of contents in the contents tab?"

Using MS Windows 10 Home (2004) Octave 6.0.92 (RC2) -- Yes.  But the OP is right, clicking on anything in the "function index" tab does not open anything, while the "contents" tab works.

Using OpenSUSE 15.2 custom build of stable, all works as expected.


Kai Torben Ohlhus <siko1056>
Group Member
Thu 29 Oct 2020 06:37:32 AM UTC, comment #7: 

With my windows build, not only the right pane is initially empty, but also the contents and the function index tabs in the left pane. The initialization of the doc browser widget might be broken on windows or the help files collection is not properly prepared during the build.

@Philip: Are you seeing a list of functions in the function index tab and the table of contents in the contents tab?

Torsten Lilge <ttl>
Group Member
Wed 28 Oct 2020 09:50:23 PM UTC, comment #6: 

The second argument is for the connection to an activated link signal in the index widget:


connect(m_help_engine->indexWidget (),
        SIGNAL (linkActivated (const QUrl&, const QString&)),
        m_doc_browser, SLOT(handle_index_clicked (const QUrl&,
                                             const QString&)));


Torsten Lilge <ttl>
Group Member
Wed 28 Oct 2020 09:27:45 PM UTC, comment #5: 

Hmm, it also works for me on my Debian system with the current sources but not with the Windows 6.0.92 binary.  Running the debugger on both and setting a breakpoint at documentation_browser::handle_index_clicked, execution stops there in the debugger on the Debian system when I click on an entry in the list but not on the Windows system.

Not that it should matter since there is a default value supplied for the second argument, but is there a reason for that slot to be declared to have two arguments when only one is used in the definition?

John W. Eaton <jwe>
Group administrator
Wed 28 Oct 2020 09:17:50 PM UTC, comment #4: 

Ah, I didn't realize John's comments while typing.

With Linux: After activating the tab "Function Index" in the left pane and typing "inputdlg" into the "Search" inputbox, I can double click on "inputdlg" in the list below and the related help text appears in the right pain, as expected.



Torsten Lilge <ttl>
Group Member
Wed 28 Oct 2020 09:04:44 PM UTC, comment #3: 

This works for me on Linux with a recent stable build.

Torsten Lilge <ttl>
Group Member
Wed 28 Oct 2020 09:02:27 PM UTC, comment #2: 

However, in the Windows binary version, there is nothing displayed in the right hand pane of the doc browser for me when I first open it.  I have to click on a section in the table of contents in the left pane of the doc browser first.  In the version I have on my Debian system, the table of contents is displayed in the right hand pane when I first open the doc browser.

OH, and now I see that in the left pane, the "search" dialog for the "Function Index" tab isn't doing anything.

I thought you meant "click on the function index entry in the table of contents".  Sorry for the misunderstanding.

I'm guessing this is just a missing signal/slot connection, or one that is somehow broken because of an incorrect prototype or something.  I'll look at it.

John W. Eaton <jwe>
Group administrator
Wed 28 Oct 2020 08:56:17 PM UTC, comment #1: 

I'm able to search in the index (brings up a "find" dialog when I click on the icon that looks like a magnifying glass over a sheet of paper) or in the contents pane of the doc browser ("search" tab there).

What do you mean by

> Click on tab "Function index".
> Enter e.g., "inputdlg"  (obviously w/o double quotes)


Are you just typing "inputdlg" in the window where the function index is displayed?  That does nothing for me.  I have to type in one of the text entry boxes ("search" or "find").

John W. Eaton <jwe>
Group administrator
Wed 28 Oct 2020 04:58:56 PM UTC, original submission:  

This has been so for a long time, I have no idea if this is a bug or not. But it is at least unexpected behavior:

In the GUI, open documentation pane.
Click on tab "Function index".
Enter e.g., "inputdlg"  (obviously w/o double quotes)
==> A line appears with 'inputdlg'; fine
Double-click on that line
==> Nothing happens.  I'd expect the paragraph about 'ínputdlg' to appear in the right subpane, but no joy.

It does work fine in the "Search" tab. Entering 'inputdlg' gives a collection clickable results that lead one to the respective paragraphs.

Philip Nienhuis <philipnienhuis>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #50200:  bug59375_v01.patch added by ttl (4KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-05 ttl StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2020-11-03 ttl Attached File- Added bug59375_v01.patch, #50200
    2020-11-03 ttl StatusNone Patch Submitted
        Operating SystemMicrosoft Windows Any

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code