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

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



    • Qt6_Foundation_ Sprint 4
    • 6c28b30cacc72959b8efdb4644b3d2bde2dd86f9


      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.


        Issue Links

          For Gerrit Dashboard: QTBUG-82334
          # Subject Branch Project Status CR V



              jkobus Jarek Kobus
              jkobus Jarek Kobus
              Maurice Kalinowski Maurice Kalinowski
              Alex Blasche Alex Blasche
              0 Vote for this issue
              6 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes