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

Change the return type of QHelpEngineCore::linkForIdentifier()

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • None
    • Tools: Assistant
    • None

      Currently there are the following methods in the public API of QHelpEngineCore:

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

      In general they may return multi maps. After the recent deprecation, we should adapt this API. Possible solutions:

      1. Return QMultiMap<QString, QUrl> instead.
      2. Return QMap<QString, QList<QUrl>> instead.
      3. We could possibly return other structures, like QHash<QUrl, QString> or list of pairs, however the result is usually used for displaying search results, so having them already sorted by title is an advantage.

      Looks like the option 1 is the preferred one. However, we cannot provide an overload in Qt 5.15 which would differ only in return type. The solution would be to provide new methods with new names for them in Qt 5.15 and deprecate the above methods there.

      I'm rather reluctant to do the hack like in QCursor::bitmap() case, since it doesn't really provide a substitution in 5.15 (the substitution is very artificial IMO, and would require people to change their code twice).

      Other options?

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

            jkobus Jarek Kobus
            jkobus Jarek Kobus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes