Skip to content
Permalink
Browse files

Merge pull request #34015 from elpaso/bugfix-gh33854-custom-layer-ord…

…er-toggle

Toggle layer visibility in custom layer order panel
  • Loading branch information
elpaso committed Jan 24, 2020
2 parents 276a314 + 9604e00 commit e083988d71b2960b586b35c4043d2a1c920e58c7
@@ -132,13 +132,14 @@ QVariant CustomLayerOrderModel::data( const QModelIndex &index, int role ) const

bool CustomLayerOrderModel::setData( const QModelIndex &index, const QVariant &value, int role )
{
Q_UNUSED( value ); // Toggle
if ( role == Qt::CheckStateRole )
{
QString id = mOrder.at( index.row() );
QgsLayerTreeLayer *nodeLayer = mBridge->rootGroup()->findLayer( id );
if ( nodeLayer )
{
nodeLayer->setItemVisibilityChecked( static_cast< Qt::CheckState >( value.toInt() ) == Qt::Checked );
nodeLayer->setItemVisibilityChecked( ! nodeLayer->itemVisibilityChecked() );
return true;
}
}
@@ -53,7 +53,7 @@ class GUI_EXPORT QgsCustomLayerOrderWidget : public QWidget
private slots:
void bridgeHasCustomLayerOrderChanged( bool state );
void bridgeCustomLayerOrderChanged();
//! Slot triggered when the ivsibility of a node changes
//! Slot triggered when the visibility of a node changes
void nodeVisibilityChanged( QgsLayerTreeNode *node );

void modelUpdated();

0 comments on commit e083988

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