mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
[API] restore QgsMapLayerRegistry::addMapLayer() but keep it deprecated
This commit is contained in:
parent
b74cb5fe4a
commit
aae400ecf1
@ -44,6 +44,12 @@ class QgsMapLayerRegistry : QObject
|
|||||||
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers /Transfer/,
|
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers /Transfer/,
|
||||||
bool theEmitSignal = true );
|
bool theEmitSignal = true );
|
||||||
|
|
||||||
|
/** Add a layer to the map of loaded layers
|
||||||
|
@returns NULL if unable to add layer, otherwise pointer to newly added layer
|
||||||
|
@see addMapLayers
|
||||||
|
@note Use addMapLayers if adding more than one layer at a time
|
||||||
|
*/
|
||||||
|
QgsMapLayer *addMapLayer( QgsMapLayer * theMapLayer /Transfer/, bool theEmitSignal = true ) /Deprecated/;
|
||||||
|
|
||||||
/** Remove a set of layers from qgis
|
/** Remove a set of layers from qgis
|
||||||
@note As a side-effect QgsProject is made dirty.
|
@note As a side-effect QgsProject is made dirty.
|
||||||
@ -57,7 +63,6 @@ class QgsMapLayerRegistry : QObject
|
|||||||
*/
|
*/
|
||||||
void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = true );
|
void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = true );
|
||||||
|
|
||||||
|
|
||||||
/** Remove all registered layers
|
/** Remove all registered layers
|
||||||
@note raises removedAll()
|
@note raises removedAll()
|
||||||
As a side-effect QgsProject is made dirty.
|
As a side-effect QgsProject is made dirty.
|
||||||
|
@ -104,6 +104,18 @@ QList<QgsMapLayer *> QgsMapLayerRegistry::addMapLayers(
|
|||||||
return myResultList;
|
return myResultList;
|
||||||
} // QgsMapLayerRegistry::addMapLayers
|
} // QgsMapLayerRegistry::addMapLayers
|
||||||
|
|
||||||
|
//this is just a thin wrapper for addMapLayers
|
||||||
|
QgsMapLayer *
|
||||||
|
QgsMapLayerRegistry::addMapLayer( QgsMapLayer * theMapLayer,
|
||||||
|
bool theEmitSignal )
|
||||||
|
{
|
||||||
|
QList<QgsMapLayer *> myList, myList2;
|
||||||
|
myList.append( theMapLayer );
|
||||||
|
myList2 = addMapLayers( myList, theEmitSignal );
|
||||||
|
return myList2.isEmpty() ? 0 : myList2[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//introduced in 1.8
|
//introduced in 1.8
|
||||||
void QgsMapLayerRegistry::removeMapLayers( QStringList theLayerIds,
|
void QgsMapLayerRegistry::removeMapLayers( QStringList theLayerIds,
|
||||||
bool theEmitSignal )
|
bool theEmitSignal )
|
||||||
|
@ -67,6 +67,12 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
|
|||||||
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers,
|
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers,
|
||||||
bool theEmitSignal = true );
|
bool theEmitSignal = true );
|
||||||
|
|
||||||
|
/** Add a layer to the map of loaded layers
|
||||||
|
@returns NULL if unable to add layer, otherwise pointer to newly added layer
|
||||||
|
@see addMapLayers
|
||||||
|
@note addMapLayers is prefered and must be used if adding more than one layer at a time
|
||||||
|
*/
|
||||||
|
Q_DECL_DEPRECATED QgsMapLayer *addMapLayer( QgsMapLayer * theMapLayer, bool theEmitSignal = true );
|
||||||
|
|
||||||
/** Remove a set of layers from qgis
|
/** Remove a set of layers from qgis
|
||||||
@note As a side-effect QgsProject is made dirty.
|
@note As a side-effect QgsProject is made dirty.
|
||||||
@ -80,7 +86,6 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
|
|||||||
*/
|
*/
|
||||||
void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = true );
|
void removeMapLayers( QStringList theLayerIds, bool theEmitSignal = true );
|
||||||
|
|
||||||
|
|
||||||
/** Remove all registered layers
|
/** Remove all registered layers
|
||||||
@note raises removedAll()
|
@note raises removedAll()
|
||||||
As a side-effect QgsProject is made dirty.
|
As a side-effect QgsProject is made dirty.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user