[QGIS Commit] r11540 - in trunk/qgis: python/gui src/app src/gui src/plugins/georeferencer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Sep 2 18:41:44 EDT 2009


Author: jef
Date: 2009-09-02 18:41:43 -0400 (Wed, 02 Sep 2009)
New Revision: 11540

Modified:
   trunk/qgis/python/gui/qgsmapcanvas.sip
   trunk/qgis/python/gui/qgsmaptoolemitpoint.sip
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgisapp.h
   trunk/qgis/src/gui/qgsmapcanvas.h
   trunk/qgis/src/gui/qgsmaptoolemitpoint.h
   trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.cpp
   trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.h
Log:
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



Modified: trunk/qgis/python/gui/qgsmapcanvas.sip
===================================================================
--- trunk/qgis/python/gui/qgsmapcanvas.sip	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/python/gui/qgsmapcanvas.sip	2009-09-02 22:41:43 UTC (rev 11540)
@@ -224,9 +224,11 @@
   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);
 

Modified: trunk/qgis/python/gui/qgsmaptoolemitpoint.sip
===================================================================
--- trunk/qgis/python/gui/qgsmaptoolemitpoint.sip	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/python/gui/qgsmaptoolemitpoint.sip	2009-09-02 22:41:43 UTC (rev 11540)
@@ -19,7 +19,7 @@
     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);
 };

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-09-02 22:41:43 UTC (rev 11540)
@@ -1680,7 +1680,7 @@
            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 @@
   vlayer->triggerRepaint();
 }
 
-void QgisApp::showMouseCoordinate( QgsPoint & p )
+void QgisApp::showMouseCoordinate( const QgsPoint & p )
 {
   if ( mMapTipsVisible )
   {

Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/app/qgisapp.h	2009-09-02 22:41:43 UTC (rev 11540)
@@ -394,7 +394,7 @@
     /** 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;

Modified: trunk/qgis/src/gui/qgsmapcanvas.h
===================================================================
--- trunk/qgis/src/gui/qgsmapcanvas.h	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/gui/qgsmapcanvas.h	2009-09-02 22:41:43 UTC (rev 11540)
@@ -285,9 +285,11 @@
   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 );
 

Modified: trunk/qgis/src/gui/qgsmaptoolemitpoint.h
===================================================================
--- trunk/qgis/src/gui/qgsmaptoolemitpoint.h	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/gui/qgsmaptoolemitpoint.h	2009-09-02 22:41:43 UTC (rev 11540)
@@ -47,7 +47,8 @@
   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

Modified: trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.cpp	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.cpp	2009-09-02 22:41:43 UTC (rev 11540)
@@ -40,8 +40,8 @@
 
   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 @@
   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 )

Modified: trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.h
===================================================================
--- trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.h	2009-09-02 19:52:16 UTC (rev 11539)
+++ trunk/qgis/src/plugins/georeferencer/mapcoordsdialog.h	2009-09-02 22:41:43 UTC (rev 11540)
@@ -35,7 +35,7 @@
 
     void on_btnPointFromCanvas_clicked();
 
-    void maybeSetXY( QgsPoint &, Qt::MouseButton );
+    void maybeSetXY( const QgsPoint &, Qt::MouseButton );
     void updateOK();
 
   private:



More information about the QGIS-commit mailing list