Skip to content

Commit a174882

Browse files
author
jef
committed
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
1 parent 6bea923 commit a174882

File tree

8 files changed

+19
-14
lines changed

8 files changed

+19
-14
lines changed

python/gui/qgsmapcanvas.sip

+4-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ class QgsMapCanvas : QGraphicsView
224224
signals:
225225
/** Let the owner know how far we are with render operations */
226226
void setProgress(int,int);
227-
/** emits current mouse position */
228-
void xyCoordinates(QgsPoint & p);
227+
228+
/** emits current mouse position
229+
\note changed in 1.3 */
230+
void xyCoordinates(const QgsPoint &p);
229231

230232
//! Emitted when the scale of the map changes
231233
void scaleChanged(QString);

python/gui/qgsmaptoolemitpoint.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class QgsMapToolEmitPoint : QgsMapTool
1919
virtual void canvasReleaseEvent(QMouseEvent * e);
2020

2121
signals:
22-
2322
//! signal emitted on canvas click
24-
void canvasClicked(QgsPoint& point, Qt::MouseButton button);
23+
// \note changed in 1.3
24+
void canvasClicked( const QgsPoint &point, Qt::MouseButton button);
2525
};

src/app/qgisapp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ void QgisApp::setupConnections()
16801680
mMapTools.mNodeTool, SLOT( currentLayerChanged( QgsMapLayer* ) ) );
16811681

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

4644-
void QgisApp::showMouseCoordinate( QgsPoint & p )
4644+
void QgisApp::showMouseCoordinate( const QgsPoint & p )
46454645
{
46464646
if ( mMapTipsVisible )
46474647
{

src/app/qgisapp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class QgisApp : public QMainWindow
394394
/** toggles whether the current selected layer is in overview or not */
395395
void isInOverview();
396396
//! Slot to show the map coordinate position of the mouse cursor
397-
void showMouseCoordinate( QgsPoint & );
397+
void showMouseCoordinate( const QgsPoint & );
398398
//! Slot to show current map scale;
399399
void showScale( double theScale );
400400
//! Slot to handle user scale input;

src/gui/qgsmapcanvas.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
285285
signals:
286286
/** Let the owner know how far we are with render operations */
287287
void setProgress( int, int );
288-
/** emits current mouse position */
289-
void xyCoordinates( QgsPoint & p );
288+
289+
/** emits current mouse position
290+
\note changed in 1.3 */
291+
void xyCoordinates( const QgsPoint & p );
290292

291293
//! Emitted when the scale of the map changes
292294
void scaleChanged( double );

src/gui/qgsmaptoolemitpoint.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class GUI_EXPORT QgsMapToolEmitPoint : public QgsMapTool
4747
signals:
4848

4949
//! signal emitted on canvas click
50-
void canvasClicked( QgsPoint& point, Qt::MouseButton button );
50+
// \note changed in 1.3
51+
void canvasClicked( const QgsPoint& point, Qt::MouseButton button );
5152
};
5253

5354
#endif

src/plugins/georeferencer/mapcoordsdialog.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ MapCoordsDialog::MapCoordsDialog( const QgsPoint& pixelCoords, QgsMapCanvas* qgi
4040

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

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

76-
void MapCoordsDialog::maybeSetXY( QgsPoint & xy, Qt::MouseButton button )
76+
void MapCoordsDialog::maybeSetXY( const QgsPoint & xy, Qt::MouseButton button )
7777
{
7878
// Only LeftButton should set point
7979
if ( Qt::LeftButton == button )

src/plugins/georeferencer/mapcoordsdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MapCoordsDialog : public QDialog, private Ui::MapCoordsDialogBase
3535

3636
void on_btnPointFromCanvas_clicked();
3737

38-
void maybeSetXY( QgsPoint &, Qt::MouseButton );
38+
void maybeSetXY( const QgsPoint &, Qt::MouseButton );
3939
void updateOK();
4040

4141
private:

0 commit comments

Comments
 (0)