Skip to content

Commit

Permalink
[FEATURE][composer] Add tools for drawing polygon and polylines
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere authored and nyalldawson committed Apr 1, 2016
1 parent bde5126 commit 7a8a541
Show file tree
Hide file tree
Showing 49 changed files with 4,453 additions and 43 deletions.
2 changes: 2 additions & 0 deletions ci/travis/linux/qt5/blacklist.txt
Expand Up @@ -14,6 +14,8 @@ PyQgsComposerMap
PyQgsComposerMapGrid
PyQgsComposerPicture
PyQgsComposerShapes
PyQgsComposerPolygon
PyQgsComposerPolyline
PyQgsComposition
PyQgsConditionalStyle
PyQgsCoordinateTransform
Expand Down
4 changes: 4 additions & 0 deletions images/images.qrc
Expand Up @@ -115,6 +115,10 @@
<file>themes/default/mActionAddBasicShape.png</file>
<file>themes/default/mActionAddBasicShape.svg</file>
<file>themes/default/mActionAddBasicCircle.svg</file>
<file>themes/default/mActionEditNodesItem.svg</file>
<file>themes/default/mActionAddNodesItem.svg</file>
<file>themes/default/mActionAddPolygon.svg</file>
<file>themes/default/mActionAddPolyline.svg</file>
<file>themes/default/mActionAddBasicRectangle.svg</file>
<file>themes/default/mActionAddBasicTriangle.svg</file>
<file>themes/default/mActionAddGPSLayer.png</file>
Expand Down
332 changes: 332 additions & 0 deletions images/themes/default/mActionAddNodesItem.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

3 comments on commit 7a8a541

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 7a8a541 Apr 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson I get a compilation error:

`
Building CXX object src/core/CMakeFiles/qgis_core.dir/composer/qgscomposernodesitem.cpp.o
/home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposernodesitem.cpp: In member function ‘bool QgsComposerNodesItem::addNode(const QPointF&, bool, double)’:
/home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposernodesitem.cpp:82:22: error: ‘isinf’ was not declared in this scope
if ( isinf( coef ) )

/home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposernodesitem.cpp:82:22: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
from /usr/include/c++/5/bits/stl_algo.h:66,
from /usr/include/c++/5/algorithm:62,
from /usr/include/qt4/QtCore/qglobal.h:68,
from /usr/include/qt4/QtCore/qnamespace.h:45,
from /usr/include/qt4/QtCore/qobjectdefs.h:45,
from /usr/include/qt4/QtCore/qobject.h:47,
from /usr/include/qt4/QtGui/qundostack.h:45,
from /usr/include/qt4/QtGui/QUndoCommand:1,
from /home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposeritemcommand.h:21,
from /home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposeritem.h:20,
from /home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposernodesitem.h:20,
from /home/webmaster/dev/cpp/QGIS/src/core/composer/qgscomposernodesitem.cpp:17:
/usr/include/c++/5/cmath:621:5: note: ‘std::isinf’
isinf(_Tp __x)
^
`

(I'm on Ubuntu Xenial)

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 7a8a541 Apr 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson your suggestion to use qIsInf instead of isinf works, making process is successful.

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 7a8a541 Apr 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pblottiere , @nyalldawson , spotted a serious issue with polyline which needs addressing: http://hub.qgis.org/issues/14611

A white fill is drawn for polyline items if [x] draw effects is enabled:
line-effect-problem

Please sign in to comment.