mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Added layerIsExpanded() to QgsLegendInterface
This commit is contained in:
parent
e7c34ea9da
commit
85b684c962
@ -43,6 +43,10 @@ class QgsLegendInterface : QObject
|
||||
//! @note added in 1.5
|
||||
virtual bool isGroupVisible( int groupIndex ) = 0;
|
||||
|
||||
//! Check if a layer is expanded
|
||||
//! @note added in 2.0
|
||||
virtual bool isLayerExpanded( QgsMapLayer * ml ) = 0;
|
||||
|
||||
//! Check if a layer is visible
|
||||
//! @note added in 1.5
|
||||
virtual bool isLayerVisible( QgsMapLayer * ml ) = 0;
|
||||
|
@ -167,6 +167,11 @@ bool QgsAppLegendInterface::isGroupVisible( int groupIndex )
|
||||
return ( Qt::Checked == getItem( groupIndex )->checkState( 0 ) );
|
||||
}
|
||||
|
||||
bool QgsAppLegendInterface::isLayerExpanded( QgsMapLayer * ml )
|
||||
{
|
||||
return mLegend->layerIsExpanded( ml );
|
||||
}
|
||||
|
||||
bool QgsAppLegendInterface::isLayerVisible( QgsMapLayer * ml )
|
||||
{
|
||||
return ( Qt::Checked == mLegend->layerCheckState( ml ) );
|
||||
|
@ -61,6 +61,9 @@ class QgsAppLegendInterface : public QgsLegendInterface
|
||||
//! Check if a group is visible
|
||||
bool isGroupVisible( int groupIndex );
|
||||
|
||||
//! Check if a layer is expanded
|
||||
bool isLayerExpanded( QgsMapLayer * ml );
|
||||
|
||||
//! Check if a layer is visible
|
||||
bool isLayerVisible( QgsMapLayer * ml );
|
||||
|
||||
|
@ -831,6 +831,13 @@ Qt::CheckState QgsLegend::layerCheckState( QgsMapLayer * layer )
|
||||
return ll ? ll->checkState( 0 ) : Qt::Unchecked;
|
||||
}
|
||||
|
||||
bool QgsLegend::layerIsExpanded( QgsMapLayer * layer )
|
||||
{
|
||||
QgsLegendLayer * ll = findLegendLayer( layer );
|
||||
|
||||
return ll->isExpanded();
|
||||
}
|
||||
|
||||
QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QString& projectFilePath, QgsLegendItem* parent )
|
||||
{
|
||||
mEmbeddedGroups.insert( groupName, projectFilePath );
|
||||
|
@ -221,6 +221,9 @@ class QgsLegend : public QTreeWidget
|
||||
/**Returns a layers check state*/
|
||||
Qt::CheckState layerCheckState( QgsMapLayer * layer );
|
||||
|
||||
/**Returns a layers expanded state*/
|
||||
bool layerIsExpanded( QgsMapLayer * layer );
|
||||
|
||||
/**Add group from other project file. Returns a pointer to the new group in case of success or 0 in case of error*/
|
||||
QgsLegendGroup* addEmbeddedGroup( const QString& groupName, const QString& projectFilePath, QgsLegendItem* parent = 0 );
|
||||
|
||||
|
@ -75,6 +75,10 @@ class GUI_EXPORT QgsLegendInterface : public QObject
|
||||
//! @note added in 1.5
|
||||
virtual bool isGroupVisible( int groupIndex ) = 0;
|
||||
|
||||
//! Check if a layer is expanded
|
||||
//! @note added in 2.0
|
||||
virtual bool isLayerExpanded( QgsMapLayer * ml ) = 0;
|
||||
|
||||
//! Check if a layer is visible
|
||||
//! @note added in 1.5
|
||||
virtual bool isLayerVisible( QgsMapLayer * ml ) = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user