Skip to content

Commit

Permalink
Final cleanups for gui API
Browse files Browse the repository at this point in the history
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 ddb96ea
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgsmapcanvasmap.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmapoverviewcanvas.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptoolemitpoint.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
4 changes: 2 additions & 2 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvasmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsmapoverviewcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void QgsMapOverviewCanvas::resizeEvent( QResizeEvent* e )
}


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

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

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


Expand All @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapoverviewcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptoolemitpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsmaptoolemitpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/mapcoordsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) );
Expand Down

0 comments on commit ddb96ea

Please sign in to comment.