Skip to content
Permalink
Browse files

Remove redundant composer selection tolerance setting

  • Loading branch information
nyalldawson committed Oct 31, 2013
1 parent 0a59d43 commit 247e6c762de07dcfe56ccb8dd27418106f56af2a
@@ -150,9 +150,6 @@ class QgsComposition : QGraphicsScene
QgsComposerMap* worldFileMap();
void setWorldFileMap( QgsComposerMap* map );

double selectionTolerance() const;
void setSelectionTolerance( double tol );

/**Returns pointer to map renderer of qgis map canvas*/
QgsMapRenderer* mapRenderer();

@@ -104,7 +104,6 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
mGridStyleComboBox->setCurrentIndex( 2 );
}

mSelectionToleranceSpinBox->setValue( mComposition->selectionTolerance() );
mGridToleranceSpinBox->setValue( mComposition->snapGridTolerance() );
}
blockSignals( false );
@@ -560,14 +559,6 @@ void QgsCompositionWidget::on_mGridToleranceSpinBox_valueChanged( double d )
}
}

void QgsCompositionWidget::on_mSelectionToleranceSpinBox_valueChanged( double d )
{
if ( mComposition )
{
mComposition->setSelectionTolerance( d );
}
}

void QgsCompositionWidget::on_mAlignmentToleranceSpinBox_valueChanged( double d )
{
if ( mComposition )
@@ -592,6 +583,5 @@ void QgsCompositionWidget::blockSignals( bool block )
mGridColorButton->blockSignals( block );
mGridStyleComboBox->blockSignals( block );
mGridToleranceSpinBox->blockSignals( block );
mSelectionToleranceSpinBox->blockSignals( block );
mAlignmentToleranceSpinBox->blockSignals( block );
}
@@ -59,7 +59,6 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
void on_mGridColorButton_colorChanged( const QColor &newColor );
void on_mGridStyleComboBox_currentIndexChanged( const QString& text );
void on_mGridToleranceSpinBox_valueChanged( double d );
void on_mSelectionToleranceSpinBox_valueChanged( double d );
void on_mAlignmentToleranceSpinBox_valueChanged( double d );

/**Sets GUI elements to width/height from composition*/
@@ -58,7 +58,6 @@ QgsComposition::QgsComposition( QgsMapRenderer* mapRenderer )
, mGenerateWorldFile( false )
, mWorldFileMap( 0 )
, mUseAdvancedEffects( true )
, mSelectionTolerance( 0.0 )
, mSnapToGrid( false )
, mGridVisible( false )
, mSnapGridResolution( 10.0 )
@@ -99,7 +98,6 @@ QgsComposition::QgsComposition()
mGenerateWorldFile( false ),
mWorldFileMap( 0 ),
mUseAdvancedEffects( true ),
mSelectionTolerance( 0.0 ),
mSnapToGrid( false ),
mGridVisible( false ),
mSnapGridResolution( 10.0 ),
@@ -226,15 +224,7 @@ QgsComposerItem* QgsComposition::composerItemAt( const QPointF & position, const
{
//get a list of items which intersect the specified position, in descending z order
QList<QGraphicsItem*> itemList;
if ( mSelectionTolerance <= 0.0 )
{
itemList = items( position, Qt::IntersectsItemShape, Qt::DescendingOrder );
}
else
{
itemList = items( QRectF( position.x() - mSelectionTolerance, position.y() - mSelectionTolerance, 2 * mSelectionTolerance, 2 * mSelectionTolerance ),
Qt::IntersectsItemShape, Qt::DescendingOrder );
}
itemList = items( position, Qt::IntersectsItemShape, Qt::DescendingOrder );
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();

bool foundBelowItem = false;
@@ -1671,12 +1661,6 @@ void QgsComposition::setGridStyle( GridStyle s )
saveSettings();
}

void QgsComposition::setSelectionTolerance( double tol )
{
mSelectionTolerance = tol;
saveSettings();
}

void QgsComposition::loadSettings()
{
//read grid style, grid color and pen width from settings
@@ -1705,8 +1689,6 @@ void QgsComposition::loadSettings()
{
mGridStyle = Solid;
}

mSelectionTolerance = s.value( "/qgis/composerSelectionTolerance", 0.0 ).toDouble();
}

void QgsComposition::saveSettings()
@@ -1729,9 +1711,6 @@ void QgsComposition::saveSettings()
{
s.setValue( "/qgis/composerGridStyle", "Crosses" );
}

//store also selection tolerance
s.setValue( "/qgis/composerSelectionTolerance", mSelectionTolerance );
}

void QgsComposition::beginCommand( QgsComposerItem* item, const QString& commandText, QgsComposerMergeCommand::Context c )
@@ -238,9 +238,6 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
@note: added in version 1.9*/
void setUseAdvancedEffects( bool effectsEnabled );

double selectionTolerance() const { return mSelectionTolerance; }
void setSelectionTolerance( double tol );

/**Returns pointer to map renderer of qgis map canvas*/
QgsMapRenderer* mapRenderer() {return mMapRenderer;}

@@ -446,9 +443,6 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
/**Flag if advanced visual effects such as blend modes should be used. True by default*/
bool mUseAdvancedEffects;

/**Distance tolerance for item selection (in mm)*/
double mSelectionTolerance;

/**Parameters for snap to grid function*/
bool mSnapToGrid;
bool mGridVisible;
@@ -276,38 +276,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBoxBasic" name="generalSettingsGroupBox">
<property name="title">
<string>General settings</string>
</property>
<property name="collapsed" stdset="0">
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Selection tolerance</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="mSelectionToleranceSpinBox">
<property name="suffix">
<string> mm</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBoxBasic" name="mSnapToGridGroupCheckBox">
<property name="title">

0 comments on commit 247e6c7

Please sign in to comment.
You can’t perform that action at this time.