Skip to content
Permalink
Browse files
Add distance item
  • Loading branch information
mhugent committed Feb 17, 2012
1 parent 112b9f1 commit 41a3280103c0b33d4c2301e2cdd8739c8cbba0de
Showing with 21 additions and 1 deletion.
  1. +16 −1 src/app/qgsmaptooloffsetcurve.cpp
  2. +5 −0 src/app/qgsmaptooloffsetcurve.h
@@ -20,7 +20,7 @@
#include "qgsvectorlayer.h"
#include <QMouseEvent>

QgsMapToolOffsetCurve::QgsMapToolOffsetCurve( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ), mRubberBand( 0 ), mOriginalGeometry( 0 ), mGeometryModified( false )
QgsMapToolOffsetCurve::QgsMapToolOffsetCurve( QgsMapCanvas* canvas ): QgsMapToolEdit( canvas ), mRubberBand( 0 ), mOriginalGeometry( 0 ), mGeometryModified( false ), mDistanceItem( 0 )
{
}

@@ -182,6 +182,21 @@ QgsGeometry* QgsMapToolOffsetCurve::createOriginGeometry( QgsVectorLayer* vl, co
}
}

QGraphicsProxyWidget* QgsMapToolOffsetCurve::createDistanceItem()
{
if ( !mCanvas )
{
return 0;
}

QGraphicsProxyWidget* pw = new QGraphicsProxyWidget();
//Embed double spin box
QDoubleSpinBox* sb = new QDoubleSpinBox();
pw->setWidget( sb );

return pw;
}

void QgsMapToolOffsetCurve::deleteRubberBandAndGeometry()
{
delete mRubberBand;
@@ -20,6 +20,8 @@
#include "qgsgeometry.h"
#include "qgssnapper.h"

class QGraphicsProxyWidget;

class QgsMapToolOffsetCurve: public QgsMapToolEdit
{
public:
@@ -44,10 +46,13 @@ class QgsMapToolOffsetCurve: public QgsMapToolEdit
QString mSourceLayerId;
/**Internal flag to distinguish move from click*/
bool mGeometryModified;
/**Shows current distance value and allows numerical editing*/
QGraphicsProxyWidget* mDistanceItem;


void deleteRubberBandAndGeometry();
QgsGeometry* createOriginGeometry( QgsVectorLayer* vl, const QgsSnappingResult& sr, QgsFeature& snappedFeature );
QGraphicsProxyWidget* createDistanceItem();
};

#endif // QGSMAPTOOLOFFSETCURVE_H

0 comments on commit 41a3280

Please sign in to comment.