mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Add test for style synchronisation in offline editing
This commit is contained in:
parent
3cd9a3995e
commit
6c5ac93001
@ -26,6 +26,7 @@
|
||||
#include "qgstest.h"
|
||||
#include "qgsvectorlayerref.h"
|
||||
#include "qgslayertree.h"
|
||||
#include "qgsmaplayerstylemanager.h"
|
||||
|
||||
/**
|
||||
* \ingroup UnitTests
|
||||
@ -164,6 +165,10 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
|
||||
QgsLayerTreeLayer *layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
|
||||
layerTreelayer->setCustomProperty( QStringLiteral( "showFeatureCount" ), 1 );
|
||||
layerTreelayer->setItemVisibilityChecked( false );
|
||||
QgsMapLayerStyle style;
|
||||
style.readFromLayer( mpLayer );
|
||||
|
||||
mpLayer->styleManager()->addStyle( QStringLiteral( "testStyle" ), style );
|
||||
|
||||
//convert
|
||||
mOfflineEditing->convertToOfflineProject( offlineDataPath, offlineDbFile, layerIds, false, QgsOfflineEditing::GPKG );
|
||||
@ -177,6 +182,7 @@ void TestQgsOfflineEditing::createGeopackageAndSynchronizeBack()
|
||||
layerTreelayer = QgsProject::instance()->layerTreeRoot()->findLayer( mpLayer->id() );
|
||||
QCOMPARE( layerTreelayer->customProperty( QStringLiteral( "showFeatureCount" ), 0 ).toInt(), 1 );
|
||||
QCOMPARE( layerTreelayer->isVisible(), false );
|
||||
QVERIFY( mpLayer->styleManager()->styles().contains( QStringLiteral( "testStyle" ) ) );
|
||||
|
||||
QgsFeature firstFeatureInAction;
|
||||
it = mpLayer->getFeatures();
|
||||
|
Loading…
x
Reference in New Issue
Block a user