Skip to content
Permalink
Browse files

re-allow circular dependencies (#37539)

see #30947
  • Loading branch information
3nids committed Jul 7, 2020
1 parent 546777f commit 960e53311312ecf24ca675315f7218943846b51d
@@ -42,7 +42,6 @@ Adds a properties page factory to the vector layer properties dialog.



public:
};


@@ -388,7 +388,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
dependencySources << layer;
}

mLayersDependenciesTreeModel = new DependenciesLayerTreeModel( mLayer, this );
mLayersDependenciesTreeModel = new QgsLayerTreeFilterProxyModel( this );
mLayersDependenciesTreeModel->setLayerTreeModel( new QgsLayerTreeModel( QgsProject::instance()->layerTreeRoot(), mLayersDependenciesTreeModel ) );
mLayersDependenciesTreeModel->setCheckedLayers( dependencySources );
connect( QgsProject::instance(), &QObject::destroyed, this, [ = ] {mLayersDependenciesTreeView->setModel( nullptr );} );
@@ -160,19 +160,6 @@ class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private

private:

class DependenciesLayerTreeModel : public QgsLayerTreeFilterProxyModel
{
public:
DependenciesLayerTreeModel( QgsVectorLayer *mainLayer, QObject *parent = nullptr )
: QgsLayerTreeFilterProxyModel( parent )
, mMainLayer( mainLayer )
{}

private:
QgsVectorLayer *mMainLayer = nullptr;
bool layerShown( QgsMapLayer *layer ) const override {return layer != mMainLayer;}
};

enum PropertyType
{
Style = 0,
@@ -241,7 +228,7 @@ class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private

QgsExpressionContext createExpressionContext() const override;

DependenciesLayerTreeModel *mLayersDependenciesTreeModel;
QgsLayerTreeFilterProxyModel *mLayersDependenciesTreeModel;

void showHelp();

0 comments on commit 960e533

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