Skip to content
Permalink
Browse files

Allow editing joins by double clicking on them in list

  • Loading branch information
nyalldawson committed Jun 10, 2016
1 parent acedb39 commit 50a6ed07f7f8c3e50f5df1f4bc879a6e20332d4a
Showing with 9 additions and 3 deletions.
  1. +8 −3 src/app/qgsvectorlayerproperties.cpp
  2. +1 −0 src/app/qgsvectorlayerproperties.h
@@ -1156,13 +1156,18 @@ void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
void QgsVectorLayerProperties::on_mButtonEditJoin_clicked()
{
QTreeWidgetItem* currentJoinItem = mJoinTreeWidget->currentItem();
if ( !mLayer || !currentJoinItem )
on_mJoinTreeWidget_itemDoubleClicked( currentJoinItem, 0 );
}

void QgsVectorLayerProperties::on_mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem* item, int )
{
if ( !mLayer || !item )
{
return;
}

QList<QgsMapLayer*> joinedLayers;
QString joinLayerId = currentJoinItem->data( 0, Qt::UserRole ).toString();
QString joinLayerId = item->data( 0, Qt::UserRole ).toString();
const QList< QgsVectorJoinInfo >& joins = mLayer->vectorJoins();
int j = -1;
for ( int i = 0; i < joins.size(); ++i )
@@ -1191,7 +1196,7 @@ void QgsVectorLayerProperties::on_mButtonEditJoin_clicked()

// remove old join
mLayer->removeJoin( joinLayerId );
int idx = mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem );
int idx = mJoinTreeWidget->indexOfTopLevelItem( item );
mJoinTreeWidget->takeTopLevelItem( idx );

// add the new edited
@@ -123,6 +123,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private

void on_mButtonAddJoin_clicked();
void on_mButtonEditJoin_clicked();
void on_mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
void on_mButtonRemoveJoin_clicked();

void on_mSimplifyDrawingGroupBox_toggled( bool checked );

0 comments on commit 50a6ed0

Please sign in to comment.
You can’t perform that action at this time.