Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82334

Refactor QtHelp API according to deprecation of QMap as a multi map

    XMLWordPrintable

    Details

    • Sprint:
      Qt6_Foundation_ Sprint 4
    • Commits:
      6c28b30cacc72959b8efdb4644b3d2bde2dd86f9

      Description

      As of Qt 5.15 the usage of QMap as a multi map is deprecated. Currently QtHelp module exposes some API that use QMap as a multi map:

      QMap<QString, QUrl> QHelpEngineCore::linksForIdentifier(const QString &id) const;
      QMap<QString, QUrl> QHelpEngineCore::linksForKeyword(const QString &keyword) const;

      QMap<QString, QUrl> QHelpIndexModel::linksForKeyword(const QString &keyword) const;
      [signal] void QHelpIndexWidget::linkActivated(const QUrl &link, const QString &keyword);
      [signal] void QHelpIndexWidget::linksActivated(const QMap<QString, QUrl> &links, const QString &keyword);

      So, we need to deprecate the above methods and provide replacement. However, changing the data structure will cause a conflict inside QHelpEngineCore, since we can't return a different type for linksForIdentifier(const QString &id). So we need to change names in QHelpEngineCore for the mentioned methods.

      Possible solutions:
      1) Replace QMap<QString, QUrl> with QMultiMap<QString, QUrl>.
      2) Replace QMap<QString, QUrl> with QList<QHelpSearchResult>. However, this struct contains the "snippet" field, which would be useless in this case.
      3) Provide a new struct, e.g. QHelpLink (name to be discussed), containing QUrl and QString (as a doc title) and replace QMap<QString, QUrl> with QList<QHelpLink>.

      ...Other options?

      My preference is: 3 (the best option), 2 and then 1 (the worst).

      Note, that we should still do it for Qt 5.15.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              jkobus Jarek Kobus
              Reporter:
              jkobus Jarek Kobus
              PM Owner:
              Maurice Kalinowski Maurice Kalinowski
              RnD Owner:
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes