Skip to content

Commit 663e6b4

Browse files
author
wonder
committed
Added possibility not to draw vertex markers when a layer is in editing mode
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10121 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0455872 commit 663e6b4

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/app/qgsoptions.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
207207
//vertex marker
208208
mMarkerStyleComboBox->addItem( tr( "Semi transparent circle" ) );
209209
mMarkerStyleComboBox->addItem( tr( "Cross" ) );
210+
mMarkerStyleComboBox->addItem( tr( "None" ) );
210211

211212
QString markerStyle = settings.value( "/qgis/digitizing/marker_style", "SemiTransparentCircle" ).toString();
212213
if ( markerStyle == "SemiTransparentCircle" )
@@ -217,6 +218,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
217218
{
218219
mMarkerStyleComboBox->setCurrentIndex( mMarkerStyleComboBox->findText( tr( "Cross" ) ) );
219220
}
221+
else if (markerStyle == "None" )
222+
{
223+
mMarkerStyleComboBox->setCurrentIndex( mMarkerStyleComboBox->findText( tr( "None" ) ) );
224+
}
220225

221226
chkDisableAttributeValuesDlg->setChecked( settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool() );
222227

@@ -387,6 +392,10 @@ void QgsOptions::saveOptions()
387392
{
388393
settings.setValue( "/qgis/digitizing/marker_style", "Cross" );
389394
}
395+
else if ( markerComboText == tr( "None" ) )
396+
{
397+
settings.setValue( "/qgis/digitizing/marker_style", "None" );
398+
}
390399

391400
settings.setValue( "/qgis/digitizing/disable_enter_attribute_values_dialog", chkDisableAttributeValuesDlg->isChecked() );
392401

src/core/qgsvectorlayer.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ void QgsVectorLayer::drawVertexMarker( int x, int y, QPainter& p, QgsVectorLayer
808808
p.setBrush( QColor( 200, 200, 210, 120 ) );
809809
p.drawEllipse( QRectF( x - 7, y - 7, 14, 14 ) );
810810
}
811-
else
811+
else if ( type == QgsVectorLayer::Cross )
812812
{
813813
int size = 15;
814814
int m = ( size - 1 ) / 2;
@@ -3303,10 +3303,14 @@ QgsVectorLayer::VertexMarkerType QgsVectorLayer::currentVertexMarkerType()
33033303
{
33043304
return QgsVectorLayer::Cross;
33053305
}
3306-
else
3306+
else if ( markerTypeString == "SemiTransparentCircle" )
33073307
{
33083308
return QgsVectorLayer::SemiTransparentCircle;
33093309
}
3310+
else
3311+
{
3312+
return QgsVectorLayer::NoMarker;
3313+
}
33103314
}
33113315

33123316
void QgsVectorLayer::drawFeature( QPainter* p,

src/core/qgsvectorlayer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
465465
enum VertexMarkerType
466466
{
467467
SemiTransparentCircle,
468-
Cross
468+
Cross,
469+
NoMarker /* added in version 1.1 */
469470
};
470471

471472
/** vector layers are not copyable */

0 commit comments

Comments
 (0)