octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59375] [Doc pane] Function index largely dysf


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #59375] [Doc pane] Function index largely dysfunctional
Date: Thu, 29 Oct 2020 17:15:04 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #10, bug #59375 (project octave):

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
    }
}


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59375>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]