Skip to content
Permalink
Browse files

Port legend item

  • Loading branch information
nyalldawson committed Oct 24, 2017
1 parent 585a8b7 commit d3430e4d42c043f75b0d8cb71bde73c399bd6bf5
Showing with 4,729 additions and 121 deletions.
  1. +1 −25 python/core/composer/qgscomposerlegend.sip
  2. +1 −0 python/core/core_auto.sip
  3. +17 −0 python/core/layout/qgslayoutitem.sip
  4. +474 −0 python/core/layout/qgslayoutitemlegend.sip
  5. +14 −14 python/core/layout/qgslayoutitemmap.sip
  6. +1 −0 python/core/layout/qgslayoutitemregistry.sip
  7. +2 −0 src/app/CMakeLists.txt
  8. +1 −0 src/app/composer/qgscomposerlegendwidget.cpp
  9. +28 −0 src/app/layout/qgslayoutapputils.cpp
  10. +0 −1 src/app/layout/qgslayoutlabelwidget.cpp
  11. +1,154 −0 src/app/layout/qgslayoutlegendwidget.cpp
  12. +135 −0 src/app/layout/qgslayoutlegendwidget.h
  13. +2 −0 src/core/CMakeLists.txt
  14. +14 −45 src/core/composer/qgscomposerlegend.cpp
  15. +5 −23 src/core/composer/qgscomposerlegend.h
  16. +17 −0 src/core/layout/qgslayoutitem.h
  17. +884 −0 src/core/layout/qgslayoutitemlegend.cpp
  18. +529 −0 src/core/layout/qgslayoutitemlegend.h
  19. +13 −12 src/core/layout/qgslayoutitemmap.h
  20. +2 −0 src/core/layout/qgslayoutitemregistry.cpp
  21. +1 −0 src/core/layout/qgslayoutitemregistry.h
  22. +1 −0 src/server/CMakeLists.txt
  23. +1 −0 src/server/services/wms/CMakeLists.txt
  24. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
  25. +1,187 −0 src/ui/layout/qgslayoutlegendwidgetbase.ui
  26. +1 −0 tests/src/core/testqgscomposition.cpp
  27. +1 −0 tests/src/python/CMakeLists.txt
  28. +242 −0 tests/src/python/test_qgslayoutlegend.py
  29. BIN ...ages/composer_legend/expected_composer_legend_noresize/expected_composer_legend_noresize_mask.png
  30. BIN ...ser_legend/expected_composer_legend_noresize_crop/expected_composer_legend_noresize_crop_mask.png
  31. BIN ...poser_legend/expected_composer_legend_size_content/expected_composer_legend_size_content_mask.png
@@ -11,31 +11,6 @@



class QgsLegendModel : QgsLayerTreeModel
{
%Docstring
Item model implementation based on layer tree model for composer legend.
Overrides some functionality of QgsLayerTreeModel to better fit the needs of composer legend.

.. versionadded:: 2.6
%End

%TypeHeaderCode
#include "qgscomposerlegend.h"
%End
public:
QgsLegendModel( QgsLayerTree *rootNode, QObject *parent /TransferThis/ = 0 );
%Docstring
Construct the model based on the given layer tree
%End

virtual QVariant data( const QModelIndex &index, int role ) const;


virtual Qt::ItemFlags flags( const QModelIndex &index ) const;

};


class QgsComposerLegend : QgsComposerItem
{
@@ -48,6 +23,7 @@ class QgsComposerLegend : QgsComposerItem
%End
public:
QgsComposerLegend( QgsComposition *composition /TransferThis/ );
~QgsComposerLegend();

virtual int type() const;
%Docstring
@@ -408,6 +408,7 @@
%Include layout/qgslayoutitem.sip
%Include layout/qgslayoutitemgroup.sip
%Include layout/qgslayoutitemlabel.sip
%Include layout/qgslayoutitemlegend.sip
%Include layout/qgslayoutitemmap.sip
%Include layout/qgslayoutitemmapgrid.sip
%Include layout/qgslayoutitemmapitem.sip
@@ -84,6 +84,23 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
UndoLabelFont,
UndoLabelMargin,
UndoLabelFontColor,
UndoLegendText,
UndoLegendColumnCount,
UndoLegendSymbolWidth,
UndoLegendSymbolHeight,
UndoLegendWmsLegendWidth,
UndoLegendWmsLegendHeight,
UndoLegendTitleSpaceBottom,
UndoLegendGroupSpace,
UndoLegendLayerSpace,
UndoLegendSymbolSpace,
UndoLegendIconSymbolSpace,
UndoLegendFontColor,
UndoLegendBoxSpace,
UndoLegendColumnSpace,
UndoLegendLineSpacing,
UndoLegendRasterStrokeWidth,
UndoLegendRasterStrokeColor,
UndoCustomCommand,
};

0 comments on commit d3430e4

Please sign in to comment.
You can’t perform that action at this time.