QGIS API Documentation  3.6.0-Noosa (5873452)
qgsdataprovider.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdataprovider.cpp - DataProvider Interface
3  --------------------------------------
4  Date : May 2016
5  Copyright : (C) 2016 by Matthias Kuhn
6  email : [email protected]
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 
16 #include "qgsdataprovider.h"
17 
18 QString QgsDataProvider::SUBLAYER_SEPARATOR = QString( "!!::!!" );
19 
21 {
22  mProviderProperties.insert( property, value );
23 }
24 
25 void QgsDataProvider::setProviderProperty( int property, const QVariant &value )
26 {
27  mProviderProperties.insert( property, value );
28 }
29 
30 QVariant QgsDataProvider::providerProperty( QgsDataProvider::ProviderProperty property, const QVariant &defaultValue ) const
31 {
32  return mProviderProperties.value( property, defaultValue );
33 }
34 
35 QVariant QgsDataProvider::providerProperty( int property, const QVariant &defaultValue = QVariant() ) const
36 {
37  return mProviderProperties.value( property, defaultValue );
38 }
39 
40 void QgsDataProvider::setListening( bool isListening )
41 {
42  Q_UNUSED( isListening );
43 }
44 
46 {
47  return context.lastRenderingTimeMs <= context.maxRenderingTimeMs;
48 }
QVariant providerProperty(ProviderProperty property, const QVariant &defaultValue=QVariant()) const
Gets the current value of a certain provider property.
static QString SUBLAYER_SEPARATOR
String sequence used for separating components of sublayers strings.
double maxRenderingTimeMs
Default maximum allowable render time, in ms.
virtual void setListening(bool isListening)
Set whether the provider will listen to datasource notifications If set, the provider will issue noti...
void setProviderProperty(ProviderProperty property, const QVariant &value)
Allows setting arbitrary properties on the provider.
virtual bool renderInPreview(const QgsDataProvider::PreviewContext &context)
Returns whether the layer must be rendered in preview jobs.
double lastRenderingTimeMs
Previous rendering time for the layer, in ms.
Stores settings related to the context in which a preview job runs.
ProviderProperty
Properties are used to pass custom configuration options into data providers.