File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
98
98
}
99
99
QVERIFY ( itemLayer1 );
100
100
101
+ QSignalSpy spyDataChanged ( &gpkgItem, &QgsDataItem::dataChanged );
102
+
101
103
// try to rename
102
104
const QList<QgsDataItemGuiProvider *> providers = QgsGui::dataItemGuiProviderRegistry ()->providers ();
103
105
bool success = false ;
@@ -112,6 +114,13 @@ void TestQgsOgrProviderGui::testGpkgDataItemRename()
112
114
}
113
115
QVERIFY ( success );
114
116
117
+ // gpkg item gets refreshed in the background and there will be multiple dataChanged signals
118
+ // emitted unfortunately, so let's just wait until no more data changes signals are coming.
119
+ // Animation of "loading" icon also triggers dataChanged() signals, making even the number
120
+ // of signals unpredictable...
121
+ while ( spyDataChanged.wait ( 500 ) )
122
+ ;
123
+
115
124
// Check that the style is still available
116
125
QgsVectorLayer metadataLayer ( QStringLiteral ( " /%1|layername=layer_styles" ).arg ( fileName ) );
117
126
QVERIFY ( metadataLayer.isValid () );
You can’t perform that action at this time.
0 commit comments