Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new composer item to draw basic shapes (atm ellipse, rectangle,…
… triangle), fix some composer related bugs and bring rotation to composer item level git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12183 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
mhugent
committed
Nov 19, 2009
1 parent
c9c6ffc
commit 701ba52
Showing
31 changed files
with
982 additions
and
165 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/**A composer items that draws common shapes (ellipse, triangle, rectangle)*/ | ||
class QgsComposerShape: public QgsComposerItem | ||
{ | ||
%TypeHeaderCode | ||
#include "qgscomposershape.h" | ||
%End | ||
public: | ||
|
||
enum Shape | ||
{ | ||
Ellipse, | ||
Rectangle, | ||
Triangle | ||
}; | ||
|
||
QgsComposerShape( QgsComposition* composition /TransferThis/); | ||
QgsComposerShape( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition ); | ||
~QgsComposerShape(); | ||
|
||
/** \brief Reimplementation of QCanvasItem::paint - draw on canvas */ | ||
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ); | ||
|
||
/** stores state in Dom node | ||
* @param node is Dom node corresponding to 'Composer' tag | ||
* @param temp write template file | ||
*/ | ||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | ||
|
||
/** sets state from Dom document | ||
* @param itemElem is Dom node corresponding to item tag | ||
*/ | ||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | ||
|
||
//setters and getters | ||
void setLineWidth( double width ); | ||
double lineWidth() const; | ||
void setOutlineColor( const QColor& color ); | ||
QColor outlineColor() const; | ||
void setFillColor( const QColor& color ); | ||
QColor fillColor() const; | ||
QgsComposerShape::Shape shapeType() const; | ||
void setShapeType( QgsComposerShape::Shape s ); | ||
}; |
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
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.