Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Complete the migration of the scale bar plugin from Qt3 to Qt4
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4965 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Mar 4, 2006
1 parent e5b9eb3 commit a255677
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/plugins/scale_bar/plugin.cpp
Expand Up @@ -34,11 +34,10 @@ email : sbr00pwb@users.sourceforge.net
#include <QPainter>
#include <QAction>
#include <QPen>
#include <q3pointarray.h>
#include <QPolygon>
#include <QString>
#include <QFontMetrics>
#include <QFont>
#include <q3paintdevicemetrics.h>
#include <QColor>

//non qt includes
Expand Down Expand Up @@ -184,9 +183,8 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
int myBufferSize=1; //softcode this later

//Get canvas dimensions
Q3PaintDeviceMetrics myMetrics( theQPainter->device() );
int myCanvasHeight = myMetrics.height();
int myCanvasWidth = myMetrics.width();
int myCanvasHeight = theQPainter->device()->height();
int myCanvasWidth = theQPainter->device()->width();

//Get map units per pixel. This can be negative at times (to do with
//projections) and that just confuses the rest of the code in this
Expand Down Expand Up @@ -330,7 +328,7 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
//Create array of vertices for scale bar depending on style
if (mStyle==tr("Tick Down"))
{
Q3PointArray myTickDownArray(4);
QPolygon myTickDownArray(4);
//draw a buffer first so bar shows up on dark images
theQPainter->setPen( myBackgroundPen );
myTickDownArray.putPoints(0,4,
Expand All @@ -352,7 +350,7 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
}
else if (mStyle==tr("Tick Up"))
{
Q3PointArray myTickUpArray(4);
QPolygon myTickUpArray(4);
//draw a buffer first so bar shows up on dark images
theQPainter->setPen( myBackgroundPen );
myTickUpArray.putPoints(0,4,
Expand All @@ -374,7 +372,7 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
}
else if (mStyle==tr("Bar"))
{
Q3PointArray myBarArray(2);
QPolygon myBarArray(2);
//draw a buffer first so bar shows up on dark images
theQPainter->setPen( myBackgroundPen );
myBarArray.putPoints(0,2,
Expand All @@ -392,7 +390,7 @@ void QgsScaleBarPlugin::renderScaleBar(QPainter * theQPainter)
}
else if (mStyle==tr("Box"))
{
Q3PointArray myBoxArray(5);
QPolygon myBoxArray(5);
//draw a buffer first so bar shows up on dark images
theQPainter->setPen( myBackgroundPen );
myBoxArray.putPoints(0,5,
Expand Down

0 comments on commit a255677

Please sign in to comment.