Skip to content
Permalink
Browse files
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 a255677795b306c679b25890a0616c0a5e6c0565
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/plugins/scale_bar/plugin.cpp
@@ -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
@@ -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
@@ -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,
@@ -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,
@@ -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,
@@ -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,

0 comments on commit a255677

Please sign in to comment.