mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Removed unused QgsLayerTreeModelLegendNode::SymbolLegacyRuleKeyRole
This commit is contained in:
parent
6d0203d612
commit
7de1cc2f13
@ -1016,6 +1016,11 @@ QgsLayerTreeModel {#qgis_api_break_3_0_QgsLayerTreeMode}
|
|||||||
- setAutoCollapseSymbologyNodes() was removed. Use setAutoCollapseLegendNodes() instead.
|
- setAutoCollapseSymbologyNodes() was removed. Use setAutoCollapseLegendNodes() instead.
|
||||||
- autoCollapseSymbologyNodes() was removed. Use autoCollapseLegendNodes() instead.
|
- autoCollapseSymbologyNodes() was removed. Use autoCollapseLegendNodes() instead.
|
||||||
|
|
||||||
|
QgsLayerTreeModelLegendNode {#qgis_api_break_3_0_QgsLayerTreeModelLegendNode}
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
- The SymbolLegacyRuleKeyRole role was removed. Use RuleKeyRole instead.
|
||||||
|
|
||||||
|
|
||||||
QgsLayerTreeNode {#qgis_api_break_3_0_QgsLayerTreeNode}
|
QgsLayerTreeNode {#qgis_api_break_3_0_QgsLayerTreeNode}
|
||||||
----------------
|
----------------
|
||||||
|
@ -20,7 +20,6 @@ class QgsLayerTreeModelLegendNode : QObject
|
|||||||
enum LegendNodeRoles
|
enum LegendNodeRoles
|
||||||
{
|
{
|
||||||
RuleKeyRole, //!< rule key of the node (QString)
|
RuleKeyRole, //!< rule key of the node (QString)
|
||||||
SymbolLegacyRuleKeyRole, //!< for QgsSymbolLegendNode only - legacy rule key (void ptr, to be cast to QgsSymbol ptr)
|
|
||||||
ParentRuleKeyRole //!< rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
|
ParentRuleKeyRole //!< rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1130,16 +1130,19 @@ QList<QgsLayerTreeModelLegendNode*> QgsLayerTreeModel::filterLegendNodes( const
|
|||||||
{
|
{
|
||||||
Q_FOREACH ( QgsLayerTreeModelLegendNode* node, nodes )
|
Q_FOREACH ( QgsLayerTreeModelLegendNode* node, nodes )
|
||||||
{
|
{
|
||||||
QgsSymbol* ruleKey = reinterpret_cast< QgsSymbol* >( node->data( QgsSymbolLegendNode::SymbolLegacyRuleKeyRole ).value<void*>() );
|
QString ruleKey = node->data( QgsSymbolLegendNode::RuleKeyRole ).toString();
|
||||||
bool checked = mLegendFilterUsesExtent || node->data( Qt::CheckStateRole ).toInt() == Qt::Checked;
|
bool checked = mLegendFilterUsesExtent || node->data( Qt::CheckStateRole ).toInt() == Qt::Checked;
|
||||||
if ( ruleKey && checked )
|
if ( checked )
|
||||||
{
|
{
|
||||||
QString ruleKey = node->data( QgsSymbolLegendNode::RuleKeyRole ).toString();
|
|
||||||
if ( QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( node->layerNode()->layer() ) )
|
if ( QgsVectorLayer* vl = qobject_cast<QgsVectorLayer*>( node->layerNode()->layer() ) )
|
||||||
{
|
{
|
||||||
if ( mLegendFilterHitTest->legendKeyVisible( ruleKey, vl ) )
|
if ( mLegendFilterHitTest->legendKeyVisible( ruleKey, vl ) )
|
||||||
filtered << node;
|
filtered << node;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filtered << node;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // unknown node type or unchecked
|
else // unknown node type or unchecked
|
||||||
filtered << node;
|
filtered << node;
|
||||||
|
@ -311,10 +311,6 @@ QVariant QgsSymbolLegendNode::data( int role ) const
|
|||||||
{
|
{
|
||||||
return mItem.ruleKey();
|
return mItem.ruleKey();
|
||||||
}
|
}
|
||||||
else if ( role == SymbolLegacyRuleKeyRole )
|
|
||||||
{
|
|
||||||
return QVariant::fromValue<void*>( mItem.legacyRuleKey() );
|
|
||||||
}
|
|
||||||
else if ( role == ParentRuleKeyRole )
|
else if ( role == ParentRuleKeyRole )
|
||||||
{
|
{
|
||||||
return mItem.parentRuleKey();
|
return mItem.parentRuleKey();
|
||||||
|
@ -49,7 +49,6 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
|
|||||||
enum LegendNodeRoles
|
enum LegendNodeRoles
|
||||||
{
|
{
|
||||||
RuleKeyRole = Qt::UserRole, //!< Rule key of the node (QString)
|
RuleKeyRole = Qt::UserRole, //!< Rule key of the node (QString)
|
||||||
SymbolLegacyRuleKeyRole, //!< For QgsSymbolLegendNode only - legacy rule key (void ptr, to be cast to QgsSymbol ptr)
|
|
||||||
ParentRuleKeyRole //!< Rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
|
ParentRuleKeyRole //!< Rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2.8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user