Skip to content
Permalink
Browse files

fix python plugin crashes - changes GUI API

- QgsMapCanvas::xyCoordinates(QgsPoint & p) => xyCoordinates(const QgsPoint & p)
- QgsMapToolEmitPoint::canvasClicked(QgsPoint& point, Qt::MouseButton button) => canvasClicked( const QgsPoint& point, Qt::MouseButton button)
- might be a SIP 4.8 problem



git-svn-id: http://svn.osgeo.org/qgis/trunk@11540 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Sep 2, 2009
1 parent 6bea923 commit a17488239fdb620daafd6c72f31e20797df0f622
@@ -224,8 +224,10 @@ class QgsMapCanvas : QGraphicsView
signals:
/** Let the owner know how far we are with render operations */
void setProgress(int,int);
/** emits current mouse position */
void xyCoordinates(QgsPoint & p);

/** emits current mouse position
\note changed in 1.3 */
void xyCoordinates(const QgsPoint &p);

//! Emitted when the scale of the map changes
void scaleChanged(QString);
@@ -19,7 +19,7 @@ class QgsMapToolEmitPoint : QgsMapTool
virtual void canvasReleaseEvent(QMouseEvent * e);

signals:

//! signal emitted on canvas click
void canvasClicked(QgsPoint& point, Qt::MouseButton button);
// \note changed in 1.3
void canvasClicked( const QgsPoint &point, Qt::MouseButton button);
};
@@ -1680,7 +1680,7 @@ void QgisApp::setupConnections()
mMapTools.mNodeTool, SLOT( currentLayerChanged( QgsMapLayer* ) ) );

//signal when mouse moved over window (coords display in status bar)
connect( mMapCanvas, SIGNAL( xyCoordinates( QgsPoint & ) ), this, SLOT( showMouseCoordinate( QgsPoint & ) ) );
connect( mMapCanvas, SIGNAL( xyCoordinates( const QgsPoint & ) ), this, SLOT( showMouseCoordinate( const QgsPoint & ) ) );
connect( mMapCanvas->mapRenderer(), SIGNAL( drawingProgress( int, int ) ), this, SLOT( showProgress( int, int ) ) );
connect( mMapCanvas->mapRenderer(), SIGNAL( hasCrsTransformEnabled( bool ) ), this, SLOT( hasCrsTransformEnabled( bool ) ) );
connect( mMapCanvas->mapRenderer(), SIGNAL( destinationSrsChanged() ), this, SLOT( destinationSrsChanged() ) );
@@ -4641,7 +4641,7 @@ void QgisApp::toggleEditing( QgsMapLayer *layer )
vlayer->triggerRepaint();
}

void QgisApp::showMouseCoordinate( QgsPoint & p )
void QgisApp::showMouseCoordinate( const QgsPoint & p )
{
if ( mMapTipsVisible )
{
@@ -394,7 +394,7 @@ class QgisApp : public QMainWindow
/** toggles whether the current selected layer is in overview or not */
void isInOverview();
//! Slot to show the map coordinate position of the mouse cursor
void showMouseCoordinate( QgsPoint & );
void showMouseCoordinate( const QgsPoint & );
//! Slot to show current map scale;
void showScale( double theScale );
//! Slot to handle user scale input;
@@ -285,8 +285,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
signals:
/** Let the owner know how far we are with render operations */
void setProgress( int, int );
/** emits current mouse position */
void xyCoordinates( QgsPoint & p );

/** emits current mouse position
\note changed in 1.3 */
void xyCoordinates( const QgsPoint & p );

//! Emitted when the scale of the map changes
void scaleChanged( double );
@@ -47,7 +47,8 @@ class GUI_EXPORT QgsMapToolEmitPoint : public QgsMapTool
signals:

//! signal emitted on canvas click
void canvasClicked( QgsPoint& point, Qt::MouseButton button );
// \note changed in 1.3
void canvasClicked( const QgsPoint& point, Qt::MouseButton button );
};

#endif
@@ -40,8 +40,8 @@ MapCoordsDialog::MapCoordsDialog( const QgsPoint& pixelCoords, QgsMapCanvas* qgi

mToolEmitPoint = new QgsMapToolEmitPoint( qgisCanvas );
mToolEmitPoint->setButton( btnPointFromCanvas );
connect(( QgsMapToolEmitPoint* )mToolEmitPoint, SIGNAL( canvasClicked( QgsPoint&, Qt::MouseButton ) ),
this, SLOT( maybeSetXY( QgsPoint&, Qt::MouseButton ) ) );
connect(( QgsMapToolEmitPoint* )mToolEmitPoint, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
this, SLOT( maybeSetXY( const QgsPoint&, Qt::MouseButton ) ) );

connect( leXCoord, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateOK() ) );
connect( leYCoord, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateOK() ) );
@@ -73,7 +73,7 @@ void MapCoordsDialog::on_buttonCancel_clicked()
reject();
}

void MapCoordsDialog::maybeSetXY( QgsPoint & xy, Qt::MouseButton button )
void MapCoordsDialog::maybeSetXY( const QgsPoint & xy, Qt::MouseButton button )
{
// Only LeftButton should set point
if ( Qt::LeftButton == button )
@@ -35,7 +35,7 @@ class MapCoordsDialog : public QDialog, private Ui::MapCoordsDialogBase

void on_btnPointFromCanvas_clicked();

void maybeSetXY( QgsPoint &, Qt::MouseButton );
void maybeSetXY( const QgsPoint &, Qt::MouseButton );
void updateOK();

private:

0 comments on commit a174882

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