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
This commit is contained in:
jef 2009-09-02 22:41:43 +00:00
parent 6bea923d75
commit a17488239f
8 changed files with 19 additions and 14 deletions

View File

@ -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);

View File

@ -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);
};

View File

@ -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 )
{

View File

@ -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;

View File

@ -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 );

View File

@ -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

View File

@ -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 )

View File

@ -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: