Skip to content
Permalink
Browse files
Final cleanups for gui API
git-svn-id: http://svn.osgeo.org/qgis/trunk@9576 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 7, 2008
1 parent 5501726 commit ddb96eae764e6d0e1614ccd0c3d67a8b41b2ffb1
@@ -38,7 +38,7 @@ class QgsMapCanvasMap : QGraphicsRectItem
//! renders map using QgsMapRender to mPixmap
void render();

void setBgColor(const QColor& color);
void setBackgroundColor(const QColor& color);

void setPanningOffset(const QPoint& point);

@@ -11,7 +11,7 @@ class QgsMapOverviewCanvas : QWidget
~QgsMapOverviewCanvas();

//! used for overview canvas to reflect changed extent in main map canvas
void reflectChangedExtent();
void drawExtentRect();

//! renders overview and updates panning widget
void refresh();
@@ -21,5 +21,5 @@ class QgsMapToolEmitPoint : QgsMapTool
signals:

//! signal emitted on canvas click
void gotPoint(QgsPoint& point, Qt::MouseButton button);
void canvasClicked(QgsPoint& point, Qt::MouseButton button);
};
@@ -463,7 +463,7 @@ void QgsMapCanvas::setExtent( QgsRect const & r )
emit extentsChanged();
updateScale();
if ( mMapOverview )
mMapOverview->reflectChangedExtent();
mMapOverview->drawExtentRect();
mLastExtent = current;

// notify canvas items of change
@@ -1000,7 +1000,7 @@ void QgsMapCanvas::unsetMapTool( QgsMapTool* tool )
void QgsMapCanvas::setCanvasColor( const QColor & theColor )
{
// background of map's pixmap
mMap->setBgColor( theColor );
mMap->setBackgroundColor( theColor );

// background of the QGraphicsView
QBrush bgBrush( theColor );
@@ -226,6 +226,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
// currently used by pan map tool
//! Ends pan action and redraws the canvas.
void panActionEnd( QPoint releasePoint );

//! Called when mouse is moving and pan is activated
void panAction( QMouseEvent * event );

@@ -44,7 +44,7 @@ class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem
//! renders map using QgsMapRenderer to mPixmap
void render();

void setBgColor( const QColor& color ) { mBgColor = color; }
void setBackgroundColor( const QColor& color ) { mBgColor = color; }

void setPanningOffset( const QPoint& point );

@@ -90,7 +90,7 @@ void QgsMapOverviewCanvas::resizeEvent( QResizeEvent* e )
}


void QgsMapOverviewCanvas::reflectChangedExtent()
void QgsMapOverviewCanvas::drawExtentRect()
{
const QgsRect& extent = mMapCanvas->extent();

@@ -247,7 +247,7 @@ void QgsMapOverviewCanvas::refresh()
update();

// update panning widget
reflectChangedExtent();
drawExtentRect();
}


@@ -269,7 +269,7 @@ void QgsMapOverviewCanvas::setLayerSet( const QStringList& layerSet )
void QgsMapOverviewCanvas::updateFullExtent( const QgsRect& rect )
{
mMapRenderer->setExtent( rect );
reflectChangedExtent();
drawExtentRect();
}

void QgsMapOverviewCanvas::hasCrsTransformEnabled( bool flag )
@@ -45,7 +45,7 @@ class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
~QgsMapOverviewCanvas();

//! used for overview canvas to reflect changed extent in main map canvas
void reflectChangedExtent();
void drawExtentRect();

//! renders overview and updates panning widget
void refresh();
@@ -32,7 +32,7 @@ void QgsMapToolEmitPoint::canvasMoveEvent( QMouseEvent * e )
void QgsMapToolEmitPoint::canvasPressEvent( QMouseEvent * e )
{
QgsPoint pnt = toMapCoordinates( e->pos() );
emit gotPoint( pnt, e->button() );
emit canvasClicked( pnt, e->button() );
}

void QgsMapToolEmitPoint::canvasReleaseEvent( QMouseEvent * e )
@@ -23,8 +23,8 @@ class QgsMapCanvas;


/** \ingroup gui
* A map tool that simple emits a point when clicking on the map.
* Connecting a slot to its gotPoint() signal will
* A map tool that simply emits a point when clicking on the map.
* Connecting a slot to its canvasClicked() signal will
* let you implement custom behaviour for the passed in point.
*/
class GUI_EXPORT QgsMapToolEmitPoint : public QgsMapTool
@@ -47,7 +47,7 @@ class GUI_EXPORT QgsMapToolEmitPoint : public QgsMapTool
signals:

//! signal emitted on canvas click
void gotPoint( QgsPoint& point, Qt::MouseButton button );
void canvasClicked( QgsPoint& point, Qt::MouseButton button );
};

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

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

connect( leXCoord, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateOK() ) );

0 comments on commit ddb96ea

Please sign in to comment.