QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
src
core
locator
qgslocator.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslocator.h
3
------------
4
begin : May 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSLOCATOR_H
19
#define QGSLOCATOR_H
20
21
#include <QObject>
22
#include <QFuture>
23
#include <QFutureWatcher>
24
#include <QMap>
25
#include <memory>
26
27
#include "qgis_core.h"
28
#include "
qgis_sip.h
"
29
#include "
qgslocatorfilter.h
"
30
#include "
qgsfeedback.h
"
31
#include "
qgslocatorcontext.h
"
32
33
57
class
CORE_EXPORT
QgsLocator
:
public
QObject
58
{
59
Q_OBJECT
60
61
public
:
62
64
static
const
QList<QString>
CORE_FILTERS
;
65
69
QgsLocator
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
70
74
~
QgsLocator
()
override
;
75
83
void
registerFilter(
QgsLocatorFilter
*filter
SIP_TRANSFER
);
84
94
void
deregisterFilter(
QgsLocatorFilter
*filter );
95
101
QList< QgsLocatorFilter *> filters(
const
QString &prefix = QString() );
102
109
Q_DECL_DEPRECATED QMap<QString, QgsLocatorFilter *> prefixedFilters()
const
;
110
121
void
fetchResults(
const
QString &
string
,
const
QgsLocatorContext
&context,
QgsFeedback
*feedback =
nullptr
);
122
128
void
cancel();
129
135
void
cancelWithoutBlocking();
136
140
bool
isRunning()
const
;
141
146
void
clearPreviousResults();
147
148
signals:
149
154
void
foundResult(
const
QgsLocatorResult
&result );
155
160
void
finished();
161
162
private
slots:
163
164
void
filterSentResult(
QgsLocatorResult
result );
165
166
private
:
167
168
QgsFeedback
*mFeedback =
nullptr
;
169
std::unique_ptr< QgsFeedback > mOwnedFeedback;
170
171
QList< QgsLocatorFilter * > mFilters;
172
QList< QThread * > mActiveThreads;
173
174
void
cancelRunningQuery();
175
176
};
177
178
#endif // QGSLOCATOR_H
179
180
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:53
qgslocatorcontext.h
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread...
Definition:
qgsfeedback.h:44
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition:
qgis_sip.h:36
QgsLocatorContext
Encapsulates the properties relating to the context of a locator search.
Definition:
qgslocatorcontext.h:31
QgsLocatorResult
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
Definition:
qgslocatorfilter.h:39
QgsLocatorFilter
Abstract base class for filters which collect locator results.
Definition:
qgslocatorfilter.h:145
QgsLocator
Handles the management of QgsLocatorFilter objects and async collection of search results from them...
Definition:
qgslocator.h:57
QgsLocator::CORE_FILTERS
static const QList< QString > CORE_FILTERS
List of core filters (i.e. not plugin filters)
Definition:
qgslocator.h:64
qgsfeedback.h
qgslocatorfilter.h
Generated on Sun Oct 27 2019 00:43:28 for QGIS API Documentation by
1.8.13