mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Make click on a unchecked layer in the tree view check all its parents.
This removes the Ctrl+clic requirement added initially.
This commit is contained in:
parent
60a1701377
commit
02b78a96f6
@ -394,7 +394,11 @@ bool QgsLayerTreeModel::setData( const QModelIndex& index, const QVariant& value
|
||||
return false;
|
||||
|
||||
bool checked = static_cast< Qt::CheckState >( value.toInt() ) == Qt::Checked;
|
||||
if ( testFlag( ActionHierarchical ) )
|
||||
if ( checked && node->children().isEmpty() )
|
||||
{
|
||||
node->setItemVisibilityCheckedParentRecursive( checked );
|
||||
}
|
||||
else if ( testFlag( ActionHierarchical ) )
|
||||
{
|
||||
if ( node->children().isEmpty() )
|
||||
node->setItemVisibilityCheckedParentRecursive( checked );
|
||||
|
@ -148,7 +148,7 @@ QAction* QgsLayerTreeViewDefaultActions::actionCheckAndAllParents( QObject* pare
|
||||
QgsLayerTreeNode* node = mView->currentNode();
|
||||
if ( !node || !QgsLayerTree::isLayer( node ) || node->isVisible() )
|
||||
return nullptr;
|
||||
QAction* a = new QAction( tr( "Check and all its parents (Ctrl-click)" ), parent );
|
||||
QAction* a = new QAction( tr( "Check and all its parents" ), parent );
|
||||
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::checkAndAllParents );
|
||||
return a;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user