Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience method to directly convert QgsProviderSublayerDetails
object to a QgsMapLayer
- Loading branch information
1 parent
00db282
commit 69debff
Showing
5 changed files
with
89 additions
and
1 deletion.
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,27 @@ | ||
/*************************************************************************** | ||
qgsprovidersublayerdetails.cpp | ||
---------------------------- | ||
begin : May 2021 | ||
copyright : (C) 2021 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
/*************************************************************************** | ||
* * | ||
* 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 "qgsprovidersublayerdetails.h" | ||
#include "qgsmaplayerfactory.h" | ||
|
||
QgsProviderSublayerDetails::LayerOptions::LayerOptions( const QgsCoordinateTransformContext &transformContext ) | ||
: transformContext( transformContext ) | ||
{} | ||
|
||
QgsMapLayer *QgsProviderSublayerDetails::toLayer( const LayerOptions &options ) const | ||
{ | ||
return QgsMapLayerFactory::createLayer( mUri, mName, mType, mProviderKey, options.transformContext ); | ||
} |
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