diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-05-29 12:50:20 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-06-13 12:42:13 +0000 |
commit | 247639d9c301cfd6bed6096260d047c2b82ea129 (patch) | |
tree | d360d5a887e837d663e6badb8d04748b5f34707b /src/plugins/help | |
parent | 19a47fed29969484313d76c125915dedf19cb6e6 (diff) | |
download | qt-creator-247639d9c301cfd6bed6096260d047c2b82ea129.tar.gz |
Remove 1-1 dependency between locator and locator input widget
Add possibility for filters to set a new search text when accepting
an entry.
Move placeholder text update from locator manager to widget.
Propagate filter update through signal-slot connection instead of directly.
LocatorManager::show is the only place left that directly references the locator widget.
Change-Id: Id61354d9f166c2af8c9d5528ad8998c7c6b8e1ab
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/helpindexfilter.cpp | 6 | ||||
-rw-r--r-- | src/plugins/help/helpindexfilter.h | 3 | ||||
-rw-r--r-- | src/plugins/help/remotehelpfilter.cpp | 6 | ||||
-rw-r--r-- | src/plugins/help/remotehelpfilter.h | 3 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/help/helpindexfilter.cpp b/src/plugins/help/helpindexfilter.cpp index 61bf3d76b3..0428ee9c83 100644 --- a/src/plugins/help/helpindexfilter.cpp +++ b/src/plugins/help/helpindexfilter.cpp @@ -137,8 +137,12 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi return entries; } -void HelpIndexFilter::accept(LocatorFilterEntry selection) const +void HelpIndexFilter::accept(LocatorFilterEntry selection, + QString *newText, int *selectionStart, int *selectionLength) const { + Q_UNUSED(newText) + Q_UNUSED(selectionStart) + Q_UNUSED(selectionLength) const QString &key = selection.displayName; const QMap<QString, QUrl> &links = HelpManager::linksForKeyword(key); diff --git a/src/plugins/help/helpindexfilter.h b/src/plugins/help/helpindexfilter.h index 701c37dbd3..1cf1f41297 100644 --- a/src/plugins/help/helpindexfilter.h +++ b/src/plugins/help/helpindexfilter.h @@ -45,7 +45,8 @@ public: void prepareSearch(const QString &entry) override; QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry) override; - void accept(Core::LocatorFilterEntry selection) const override; + void accept(Core::LocatorFilterEntry selection, + QString *newText, int *selectionStart, int *selectionLength) const override; void refresh(QFutureInterface<void> &future) override; Q_INVOKABLE QSet<QString> searchMatches(const QString &databaseFilePath, diff --git a/src/plugins/help/remotehelpfilter.cpp b/src/plugins/help/remotehelpfilter.cpp index 85684df6b7..6e176b9df6 100644 --- a/src/plugins/help/remotehelpfilter.cpp +++ b/src/plugins/help/remotehelpfilter.cpp @@ -143,8 +143,12 @@ QList<Core::LocatorFilterEntry> RemoteHelpFilter::matchesFor(QFutureInterface<Co return entries; } -void RemoteHelpFilter::accept(Core::LocatorFilterEntry selection) const +void RemoteHelpFilter::accept(Core::LocatorFilterEntry selection, + QString *newText, int *selectionStart, int *selectionLength) const { + Q_UNUSED(newText) + Q_UNUSED(selectionStart) + Q_UNUSED(selectionLength) const QString &url = selection.displayName; if (!url.isEmpty()) emit linkActivated(url); diff --git a/src/plugins/help/remotehelpfilter.h b/src/plugins/help/remotehelpfilter.h index 1dc89ab085..607cbab943 100644 --- a/src/plugins/help/remotehelpfilter.h +++ b/src/plugins/help/remotehelpfilter.h @@ -45,7 +45,8 @@ public: // ILocatorFilter QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry) override; - void accept(Core::LocatorFilterEntry selection) const override; + void accept(Core::LocatorFilterEntry selection, + QString *newText, int *selectionStart, int *selectionLength) const override; void refresh(QFutureInterface<void> &future) override; QByteArray saveState() const override; void restoreState(const QByteArray &state) override; |