QGIS API Documentation 4.3.0-Master (9dce731a7a1)
Loading...
Searching...
No Matches
qgspointlocatorinittask.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgspointlocatorinittask.cpp
3 --------------------------------------
4 Date : September 2019
5 Copyright : (C) 2019 by Julien Cabieces
6 Email : julien dot cabieces at oslandia dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include "qgspointlocator.h"
19#include "qgsvectorlayer.h"
20
21#include "moc_qgspointlocatorinittask.cpp"
22
24
25QgsPointLocatorInitTask::QgsPointLocatorInitTask( QgsPointLocator *loc )
26 : QgsTask( tr( "Indexing %1" ).arg( loc->layer()->id() ), QgsTask::Silent )
27 , mLoc( loc )
28{
29 mFeedback = std::make_unique< QgsFeedback >();
30}
31
32bool QgsPointLocatorInitTask::isBuildOK() const
33{
34 return mBuildOK;
35}
36
37void QgsPointLocatorInitTask::cancel()
38{
39 if ( mFeedback )
40 mFeedback->cancel();
41
43}
44
45bool QgsPointLocatorInitTask::run()
46{
47 mBuildOK = mLoc->rebuildIndex( -1, mFeedback.get() );
48 return true;
49}
50
Defines the interface for querying point locations.
Abstract base class for long running background tasks.
virtual void cancel()
Notifies the task that it should terminate.