forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -83,8 +83,12 @@ QList<Core::LocatorFilterEntry> CMakeLocatorFilter::matchesFor(QFutureInterface<
|
||||
return m_result;
|
||||
}
|
||||
|
||||
void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const
|
||||
void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const
|
||||
{
|
||||
Q_UNUSED(newText)
|
||||
Q_UNUSED(selectionStart)
|
||||
Q_UNUSED(selectionLength)
|
||||
// Get the project containing the target selected
|
||||
const auto cmakeProject = qobject_cast<CMakeProject *>(
|
||||
Utils::findOrDefault(SessionManager::projects(), [selection](Project *p) {
|
||||
|
||||
@@ -40,7 +40,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;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user