Details
-
User Story
-
Resolution: Done
-
P2: Important
-
5.15.0 Alpha
-
Qt6_Foundation_ Sprint 4
-
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
- is duplicated by
-
QTBUG-81959 Change the return type of QHelpEngineCore::linkForIdentifier()
-
- Withdrawn
-
For Gerrit Dashboard: QTBUG-82334 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
291144,13 | Adapt the QtHelp API according to recent QMap changes | 5.15 | qt/qttools | Status: MERGED | +2 | 0 |