Skip to content

Commit 9ed1803

Browse files
committed
Copy joins on duplicate layer. Fix #8243
1 parent f5632b6 commit 9ed1803

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/app/qgisapp.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6187,6 +6187,16 @@ void QgisApp::duplicateLayers( QList<QgsMapLayer *> lyrList )
61876187
copyStyle( selectedLyr );
61886188
pasteStyle( dupLayer );
61896189

6190+
QgsVectorLayer* vLayer = dynamic_cast<QgsVectorLayer*>( selectedLyr );
6191+
QgsVectorLayer* vDupLayer = dynamic_cast<QgsVectorLayer*>( dupLayer );
6192+
if ( vLayer && vDupLayer )
6193+
{
6194+
foreach( const QgsVectorJoinInfo join, vLayer->vectorJoins() )
6195+
{
6196+
vDupLayer->addJoin( join );
6197+
}
6198+
}
6199+
61906200
// always set duplicated layers to not visible
61916201
// so layer can be configured before being turned on,
61926202
// and no map canvas refresh needed when doing multiple duplications

0 commit comments

Comments
 (0)