62 if ( sipCpp->inherits(
"QgsLayerTreeModel" ) )
63 sipType = sipType_QgsLayerTreeModel;
82 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
83 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
84 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
85 QModelIndex parent(
const QModelIndex &child )
const override;
86 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
87 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
88 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
89 Qt::DropActions supportedDropActions()
const override;
90 QStringList mimeTypes()
const override;
91 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
92 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
93 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
101 ShowLegendAsTree = 0x0004,
102 DeferredLegendInvalidation = 0x0008,
103 UseEmbeddedWidgets = 0x0010,
104 UseTextFormatting = 0x0020,
107 AllowNodeReorder = 0x1000,
108 AllowNodeRename = 0x2000,
109 AllowNodeChangeVisibility = 0x4000,
110 AllowLegendChangeState = 0x8000,
111 ActionHierarchical = 0x10000,
112 UseThreadedHitTest = 0x20000,
114 Q_DECLARE_FLAGS( Flags, Flag )
117 void setFlags( QgsLayerTreeModel::Flags f );
119 void setFlag( Flag f,
bool on =
true );
123 bool testFlag( Flag f )
const;
138 QList<QgsLayerTreeNode *> indexes2nodes(
const QModelIndexList &list,
bool skipInternal =
false )
const;
160 QList<QgsLayerTreeModelLegendNode *> layerLegendNodes(
QgsLayerTreeLayer *nodeLayer,
bool skipNodeEmbeddedInParent =
false );
167 QList<QgsLayerTreeModelLegendNode *> layerOriginalLegendNodes(
QgsLayerTreeLayer *nodeLayer );
201 QModelIndex currentIndex()
const;
203 void setCurrentIndex(
const QModelIndex ¤tIndex );
206 void setLayerTreeNodeFont(
int nodeType,
const QFont &font );
208 QFont layerTreeNodeFont(
int nodeType )
const;
222 void setLegendFilterByScale(
double scale );
282 void setLegendMapViewData(
double mapUnitsPerPixel,
int dpi,
double scale );
289 void legendMapViewData(
double *mapUnitsPerPixel
SIP_OUT,
int *dpi
SIP_OUT,
double *scale
SIP_OUT ) const;
295 QMap<QString, QString> layerStyleOverrides() const;
301 void setLayerStyleOverrides( const QMap<QString, QString> &overrides );
333 static
int scaleIconSize(
int standardSize );
341 void waitForHitTestBlocking();
351 bool hitTestInProgress() const;
359 void messageEmitted( const QString &message,
Qgis::MessageLevel level =
Qgis::MessageLevel::Info,
int duration = 5 );
369 void hitTestStarted();
379 void hitTestCompleted();
382 void nodeWillAddChildren(
QgsLayerTreeNode *node,
int indexFrom,
int indexTo );
383 void nodeAddedChildren(
QgsLayerTreeNode *node,
int indexFrom,
int indexTo );
384 void nodeWillRemoveChildren(
QgsLayerTreeNode *node,
int indexFrom,
int indexTo );
385 void nodeRemovedChildren();
395 void nodeCustomPropertyChanged(
QgsLayerTreeNode *node, const QString &key );
397 void nodeLayerLoaded();
398 void nodeLayerWillBeUnloaded();
399 void layerLegendChanged();
405 void layerFlagsChanged();
407 void layerNeedsUpdate();
409 void legendNodeDataChanged();
411 void invalidateLegendMapBasedData();
422 void connectToRootNode();
423 void disconnectFromRootNode();
426 void recursivelyEmitDataChanged( const QModelIndex &index = QModelIndex() );
433 void refreshScaleBasedLayers( const QModelIndex &index = QModelIndex(),
double previousScale = 0.0 );
435 static QIcon iconGroup();
440 QModelIndex indexOfParentLayerTreeNode(
QgsLayerTreeNode *parentNode ) const;
451 void legendCleanup();
452 void legendInvalidateMapBasedData();
468 QPersistentModelIndex mCurrentIndex;
470 int mAutoCollapseLegendNodesCount = -1;
486 QMap<QgsLayerTreeModelLegendNode *, QgsLayerTreeModelLegendNode *>
parents;
488 QMap<QgsLayerTreeModelLegendNode *, QList<QgsLayerTreeModelLegendNode *> >
children;
534 QHash<QgsLayerTreeLayer *, LayerLegendData>
mLegend;
546 double mLegendFilterByScale = 0;
554 double mLegendMapViewMupp = 0;
555 int mLegendMapViewDpi = 0;
556 double mLegendMapViewScale = 0;
562 void legendNodeSizeChanged();
563 void hitTestTaskCompleted();
566 void handleHitTestResults();
Contains information about the context of a rendering operation.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)