Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for adding custom properties to providers
- Loading branch information
Showing
5 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*************************************************************************** | ||
qgsdataprovider.cpp - DataProvider Interface | ||
-------------------------------------- | ||
Date : May 2016 | ||
Copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsdataprovider.h" | ||
|
||
|
||
void QgsDataProvider::setProviderProperty( QgsDataProvider::ProviderProperty property, const QVariant& value ) | ||
{ | ||
mProviderProperties.insert( property, value ); | ||
} | ||
|
||
void QgsDataProvider::setProviderProperty( int property, const QVariant& value ) | ||
{ | ||
mProviderProperties.insert( property, value ); | ||
} | ||
|
||
QVariant QgsDataProvider::providerProperty( QgsDataProvider::ProviderProperty property, const QVariant& defaultValue ) const | ||
{ | ||
return mProviderProperties.value( property, defaultValue ); | ||
} | ||
|
||
QVariant QgsDataProvider::providerProperty( int property, const QVariant& defaultValue = QVariant() ) const | ||
{ | ||
return mProviderProperties.value( property, defaultValue ); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters