Skip to content

Commit

Permalink
Improve layers capabilities frame
Browse files Browse the repository at this point in the history
Add tooltip to the columns and buttons and do not allow text edit for checkboxes
  • Loading branch information
DelazJ authored and nyalldawson committed Oct 4, 2021
1 parent 5b47d46 commit bda3b04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/app/qgslayercapabilitiesmodel.cpp
Expand Up @@ -127,10 +127,13 @@ QVariant QgsLayerCapabilitiesModel::headerData( int section, Qt::Orientation ori
switch ( section )
{
case LayerColumn:
return QVariant();
case IdentifiableColumn:
return tr( "Layers which can be queried with the \"Identify features\" tool." );
case ReadOnlyColumn:
return tr( "Layers which are protected from edit." );
case SearchableColumn:
return QVariant();
return tr( "Layers which can be queried with the locator search tool." );
case RequiredColumn:
return tr( "Layers which are protected from inadvertent removal from the project." );
case PrivateColumn:
Expand Down Expand Up @@ -162,7 +165,7 @@ Qt::ItemFlags QgsLayerCapabilitiesModel::flags( const QModelIndex &idx ) const
{
if ( layer->isSpatial() )
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
}
else
{
Expand All @@ -173,7 +176,7 @@ Qt::ItemFlags QgsLayerCapabilitiesModel::flags( const QModelIndex &idx ) const
{
if ( layer->type() == QgsMapLayerType::VectorLayer )
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
}
else
{
Expand All @@ -184,7 +187,7 @@ Qt::ItemFlags QgsLayerCapabilitiesModel::flags( const QModelIndex &idx ) const
{
if ( layer->type() == QgsMapLayerType::VectorLayer )
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
}
else
{
Expand All @@ -193,11 +196,11 @@ Qt::ItemFlags QgsLayerCapabilitiesModel::flags( const QModelIndex &idx ) const
}
case RequiredColumn:
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
}
case PrivateColumn:
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/ui/qgsprojectpropertiesbase.ui
Expand Up @@ -1549,6 +1549,9 @@
<property name="text">
<string>Toggle Selection</string>
</property>
<property name="toolTip">
<string>Inverts the state of the selected checkboxes</string>
</property>
</widget>
</item>
<item row="3" column="2">
Expand Down

0 comments on commit bda3b04

Please sign in to comment.