Showing with 250 additions and 2,154 deletions.
  1. +10 −61 python/core/composer/qgscomposition.sip
  2. +1 −12 python/core/qgsexpression.sip
  3. +64 −466 src/app/composer/qgscomposer.cpp
  4. +0 −29 src/app/composer/qgscomposerlabelwidget.cpp
  5. +0 −1 src/app/composer/qgscomposerlabelwidget.h
  6. +0 −169 src/app/composer/qgscomposermapwidget.cpp
  7. +4 −14 src/app/composer/qgscomposermapwidget.h
  8. +6 −6 src/core/composer/qgscomposerhtml.cpp
  9. +0 −1 src/core/composer/qgscomposeritem.h
  10. +5 −21 src/core/composer/qgscomposerlabel.cpp
  11. +0 −10 src/core/composer/qgscomposerlabel.h
  12. +3 −69 src/core/composer/qgscomposermap.cpp
  13. +1 −32 src/core/composer/qgscomposermap.h
  14. +16 −327 src/core/composer/qgscomposition.cpp
  15. +3 −62 src/core/composer/qgscomposition.h
  16. +1 −1 src/core/composer/qgslegendmodel.cpp
  17. +3 −3 src/core/qgscoordinatereferencesystem.cpp
  18. +4 −4 src/core/qgscoordinatetransform.cpp
  19. +9 −107 src/core/qgsexpression.cpp
  20. +1 −19 src/core/qgsexpression.h
  21. +4 −16 src/core/qgsexpressionparser.yy
  22. +24 −24 src/core/qgsgeometry.cpp
  23. +2 −18 src/gui/qgsexpressionbuilderwidget.cpp
  24. +8 −8 src/mapserver/qgswfsserver.cpp
  25. +3 −3 src/providers/gdal/qgsgdalprovider.cpp
  26. +11 −18 src/ui/qgscomposerlabelwidgetbase.ui
  27. +5 −5 src/ui/qgscomposerlegendwidgetbase.ui
  28. +62 −212 src/ui/qgscomposermapwidgetbase.ui
  29. +0 −2 tests/src/core/CMakeLists.txt
  30. +0 −181 tests/src/core/testqgscomposerlabel.cpp
  31. +0 −224 tests/src/core/testqgscomposermapatlas.cpp
  32. +0 −27 tests/src/core/testqgsexpression.cpp
  33. BIN tests/testdata/control_images/expected_composermapatlas/autoscale_0.png
  34. BIN tests/testdata/control_images/expected_composermapatlas/autoscale_1.png
  35. BIN tests/testdata/control_images/expected_composermapatlas/fixedscale_0.png
  36. BIN tests/testdata/control_images/expected_composermapatlas/fixedscale_1.png
  37. BIN tests/testdata/control_images/expected_composermapatlas/hiding_0.png
  38. BIN tests/testdata/control_images/expected_composermapatlas/hiding_1.png
  39. BIN tests/testdata/france_parts.dbf
  40. +0 −1 tests/testdata/france_parts.prj
  41. +0 −1 tests/testdata/france_parts.qpj
  42. BIN tests/testdata/france_parts.shp
  43. BIN tests/testdata/france_parts.shx
71 changes: 10 additions & 61 deletions python/core/composer/qgscomposition.sip
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
/** \ingroup MapComposer
* Class used to render an Atlas, iterating over geometry features.
* prepareForFeature() modifies the atlas map's extent to zoom on the given feature.
* This class is used for printing, exporting to PDF and images.
* */
class QgsAtlasRendering
{
public:
QgsAtlasRendering( QgsComposition* composition );
~QgsAtlasRendering();

/** Begins the rendering. Sets an optional output filename pattern */
void begin( const QString& filenamePattern = "" );
/** Ends the rendering. Restores original extent*/
void end();

/** Returns the number of features in the coverage layer */
size_t numFeatures() const;

/** Prepare the atlas map for the given feature. Sets the extent and context variables */
void prepareForFeature( size_t i );

/** Returns the current filename. Must be called after prepareForFeature( i ) */
const QString& currentFilename() const;
};

/** \ingroup MapComposer
* Graphics scene for map printing. The class manages the paper item which always
* is the item in the back (z-value 0). It maintains the z-Values of the items and stores
* them in a list in ascending z-Order. This list can be changed to lower/raise items one position
* or to bring them to front/back.
* */
class QgsComposition : QGraphicsScene
class QgsComposition: QGraphicsScene
{
%TypeHeaderCode
#include <qgscomposition.h>
%End

public:

/** \brief Plot type */
Expand Down Expand Up @@ -94,27 +67,20 @@ class QgsComposition : QGraphicsScene
/**Returns pointer to undo/redo command storage*/
QUndoStack* undoStack();

/**Returns the topmost composer item. Ignores mPaperItem*/
/**Returns the topmose composer item. Ignores mPaperItem*/
QgsComposerItem* composerItemAt( const QPointF & position );

/** Returns the page number (0-bsaed) given a coordinate */
int pageNumberAt( const QPointF& position ) const;

/** Returns on which page number (0-based) is displayed an item */
int itemPageNumber( const QgsComposerItem* ) const;

QList<QgsComposerItem*> selectedComposerItems();

/**Returns pointers to all composer maps in the scene*/
%If (QLISTCONSTPTR_CONVERSION)
QList<const QgsComposerMap*> composerMapItems() const;
%End
//todo: needs a new mapping for QList<const T*> ?
// QList<const QgsComposerMap*> composerMapItems() const;

/**Return composer items of a specific type*/
// template<class T> void composerItems( QList<T*>& itemList );

/**Returns the composer map with specified id
@return QgsComposerMap or 0 pointer if the composer map item does not exist*/
@return id or 0 pointer if the composer map item does not exist*/
const QgsComposerMap* getComposerMapById( int id ) const;

/*Returns the composer html with specified id (a string as named in the
Expand Down Expand Up @@ -145,10 +111,7 @@ class QgsComposition : QGraphicsScene
/**Returns pointer to map renderer of qgis map canvas*/
QgsMapRenderer* mapRenderer();

QgsComposerMap* atlasMap();
void setAtlasMap( QgsComposerMap* map );

QgsComposition::PlotStyle plotStyle() const;
QgsComposition::PlotStyle plotStyle();
void setPlotStyle( QgsComposition::PlotStyle style );

/**Returns the pixel font size for a font that has point size set.
Expand Down Expand Up @@ -177,13 +140,8 @@ class QgsComposition : QGraphicsScene
@param doc xml document
@param mapsToRestore for reading from project file: set preview move 'rectangle' to all maps and save the preview states to show composer maps on demand
@param addUndoCommands insert AddItem commands if true (e.g. for copy/paste)
@param pos item position. Optional, take position from xml if 0
@note not available in python bindings
*/
/*
void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore = 0,
bool addUndoCommands = false, QPointF* pos = 0 );
*/
@param pos item position. Optional, take position from xml if 0*/
//void addItemsFromXML( const QDomElement& elem, const QDomDocument& doc, QMap< QgsComposerMap*, int >* mapsToRestore, bool addUndoCommands = false, QPointF* pos = 0 );

/**Adds item to z list. Usually called from constructor of QgsComposerItem*/
void addItemToZList( QgsComposerItem* item );
Expand Down Expand Up @@ -234,7 +192,7 @@ class QgsComposition : QGraphicsScene
/**Removes multi frame (but does not delete it)*/
void removeMultiFrame( QgsComposerMultiFrame* multiFrame );
/**Adds an arrow item to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerArrow( QgsComposerArrow* arrow );
//void addComposerArrow( QgsComposerArrow* arrow );
/**Adds label to the graphics scene and advices composer to create a widget for it (through signal)*/
void addComposerLabel( QgsComposerLabel* label );
/**Adds map to the graphics scene and advices composer to create a widget for it (through signal)*/
Expand All @@ -261,19 +219,10 @@ class QgsComposition : QGraphicsScene

//printing

/** Prepare the printer for printing */
void beginPrint( QPrinter& printer );
/** Prepare the printer for printing in a PDF */
void beginPrintAsPDF( QPrinter& printer, const QString& file );
/** Print on a preconfigured printer */
void doPrint( QPrinter& printer, QPainter& painter );
void exportAsPDF( const QString& file );

/** Convenience function that prepares the printer and prints */
void print( QPrinter &printer );

/** Convenience function that prepares the printer for printing in PDF and prints */
void exportAsPDF( const QString& file );

//! print composer page to image
//! If the image does not fit into memory, a null image is returned
QImage printPageAsRaster( int page );
Expand Down
13 changes: 1 addition & 12 deletions python/core/qgsexpression.sip
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ class QgsExpression
//! Return the number used for $rownum special column
int currentRowNumber();

//! Assign a special column
static void setSpecialColumn( const QString& name, QVariant value );
//! Unset a special column
static void unsetSpecialColumn( const QString& name );
//! Return the value of the given special column or a null QVariant if undefined
static QVariant specialColumn( const QString& name );

void setScale( double scale );

int scale();
Expand All @@ -71,6 +64,7 @@ class QgsExpression
static QString replaceExpressionText( QString action, QgsFeature &feat,
QgsVectorLayer* layer,
const QMap<QString, QVariant> *substitutionMap = 0 );

//

enum UnaryOperator
Expand Down Expand Up @@ -147,11 +141,6 @@ class QgsExpression
*/
static int functionCount();

/**
* Returns a list of special Column definitions
*/
static QList<QgsExpression::FunctionDef> specialColumns();

//! return quoted column reference (in double quotes)
static QString quotedColumnRef( QString name );
//! return quoted string (in single quotes)
Expand Down
Loading