Commit
do not clear intermediate points when digitizing points in construction mode increase maximum height of dock widget when tools are disabled
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,7 +235,7 @@ void QgsAdvancedDigitizingDockWidget::mapToolChanged( QgsMapTool* tool ) | |
mErrorLabel->setText( lblText ); | ||
mErrorLabel->show(); | ||
mCadWidget->hide(); | ||
setMaximumSize( 5000, 70 ); | ||
setMaximumSize( 5000, 80 ); | ||
|
||
setCadEnabled( false ); | ||
} | ||
|
@@ -870,8 +870,10 @@ bool QgsAdvancedDigitizingDockWidget::canvasReleaseEventFilter( QgsMapMouseEvent | |
|
||
if ( e->button() == Qt::LeftButton ) | ||
{ | ||
// continue digitizing if line or polygon | ||
if ( e->mapTool()->mode() == QgsMapToolCapture::CaptureNone || e->mapTool()->mode() == QgsMapToolCapture::CapturePoint ) | ||
// stop digitizing if not intermediate point and if line or polygon | ||
if ( !mConstructionMode && | ||
( e->mapTool()->mode() == QgsMapToolCapture::CaptureNone || | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
3nids
Author
Member
|
||
e->mapTool()->mode() == QgsMapToolCapture::CapturePoint ) ) | ||
{ | ||
clearPoints(); | ||
} | ||
|
5 comments
on commit a1e0f01
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is that it depends on the map tool. Since it's called from the dock, I set him at the top class (QgsAdvancedDigitizingMapTool). QgsMapToolCapture is the only class using it because, right now, only QgsMapToolCapture classes are doing something else than capturing points. But this could change ass move feature for instance would be a CaptureLine for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the mode is not only used for the snapping but also for the behavior on the left click: for Line/polygon digitizing goes on while it stops for Point.
What would be the advantage of moving the enum to the dock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dock could live entirely without knowing anything about the maptool and theoretically used with something different than a maptool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but does it really make sense to use this out of a map tool?
@3nids currently refactoring this into the gui library. I wonder if we want a dependency of this on QgsMapToolCapture.
An alternative would be to move the mode enum into this class here (or at least into the cad map tool).
Ideas, opinions?