-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved QgsLayerTreeModelLegendNode (+derived classes) to a new file
- Loading branch information
Showing
12 changed files
with
701 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
/** | ||
* The QgsLegendRendererItem class is abstract interface for legend items | ||
* returned from QgsMapLayerLegend implementation. | ||
* | ||
* The objects are used in QgsLayerTreeModel. Custom implementations may offer additional interactivity | ||
* and customized look. | ||
* | ||
* @note added in 2.6 | ||
*/ | ||
class QgsLayerTreeModelLegendNode : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgslayertreemodellegendnode.h> | ||
%End | ||
|
||
public: | ||
|
||
/** Return pointer to the parent layer node */ | ||
QgsLayerTreeLayer* parent() const; | ||
|
||
/** Return item flags associated with the item. Default implementation returns Qt::ItemIsEnabled. */ | ||
virtual Qt::ItemFlags flags() const; | ||
|
||
/** Return data associated with the item. Must be implemented in derived class. */ | ||
virtual QVariant data( int role ) const = 0; | ||
|
||
/** Set some data associated with the item. Default implementation does nothing and returns false. */ | ||
virtual bool setData( const QVariant& value, int role ); | ||
|
||
protected: | ||
/** Construct the node with pointer to its parent layer node */ | ||
explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer* nodeL ); | ||
}; | ||
|
||
|
||
|
||
/** | ||
* Implementation of legend node interface for displaying preview of vector symbols and their labels | ||
* and allowing interaction with the symbol / renderer. | ||
* | ||
* @note added in 2.6 | ||
*/ | ||
/* | ||
class QgsSymbolV2LegendNode : QgsLayerTreeModelLegendNode | ||
{ | ||
%TypeHeaderCode | ||
#include <qgslayertreemodellegendnode.h> | ||
%End | ||
public: | ||
QgsSymbolV2LegendNode( QgsLayerTreeLayer* nodeLayer, const QgsLegendSymbolItemV2& item ); | ||
|
||
virtual Qt::ItemFlags flags() const; | ||
virtual QVariant data( int role ) const; | ||
virtual bool setData( const QVariant& value, int role ); | ||
};*/ | ||
|
||
|
||
/** | ||
* Implementation of legend node interface for displaying arbitrary label with icon. | ||
* | ||
* @note added in 2.6 | ||
*/ | ||
class QgsSimpleLegendNode : QgsLayerTreeModelLegendNode | ||
{ | ||
%TypeHeaderCode | ||
#include <qgslayertreemodellegendnode.h> | ||
%End | ||
public: | ||
QgsSimpleLegendNode( QgsLayerTreeLayer* nodeLayer, const QString& label, const QIcon& icon = QIcon() ); | ||
|
||
virtual QVariant data( int role ) const; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.