summaryrefslogtreecommitdiffstats
path: root/krita/ui/kis_grid_drawer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/ui/kis_grid_drawer.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/ui/kis_grid_drawer.cpp')
-rw-r--r--krita/ui/kis_grid_drawer.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/krita/ui/kis_grid_drawer.cpp b/krita/ui/kis_grid_drawer.cpp
index 3af8a92e..cd0963ab 100644
--- a/krita/ui/kis_grid_drawer.cpp
+++ b/krita/ui/kis_grid_drawer.cpp
@@ -25,7 +25,7 @@
#endif
#ifdef HAVE_GL
-#include <qgl.h>
+#include <tqgl.h>
#endif
#include "kis_config.h"
@@ -33,29 +33,29 @@
#include "kis_perspective_grid.h"
#include "kis_perspective_grid_manager.h"
-Qt::PenStyle GridDrawer::gs2style(Q_UINT32 s)
+Qt::PenStyle GridDrawer::gs2style(TQ_UINT32 s)
{
switch(s)
{
case 1:
- return Qt::DashLine;
+ return TQt::DashLine;
case 2:
- return Qt::DotLine;
+ return TQt::DotLine;
case 3:
- return Qt::DashDotLine;
+ return TQt::DashDotLine;
case 4:
- return Qt::DashDotDotLine;
+ return TQt::DashDotDotLine;
default:
- return Qt::SolidLine;
+ return TQt::SolidLine;
}
}
-void GridDrawer::drawPerspectiveGrid(KisImageSP image, const QRect& /*wr*/, const KisSubPerspectiveGrid* grid)
+void GridDrawer::drawPerspectiveGrid(KisImageSP image, const TQRect& /*wr*/, const KisSubPerspectiveGrid* grid)
{
Q_UNUSED(image);
KisConfig cfg;
- QPen mainPen = QPen ( cfg.getGridMainColor(), 1, gs2style( cfg.getGridMainStyle() ) );
- QPen subdivisionPen = QPen ( cfg.getGridSubdivisionColor(), 1, gs2style( cfg.getGridSubdivisionStyle() ) );
+ TQPen mainPen = TQPen ( cfg.getGridMainColor(), 1, gs2style( cfg.getGridMainStyle() ) );
+ TQPen subdivisionPen = TQPen ( cfg.getGridSubdivisionColor(), 1, gs2style( cfg.getGridSubdivisionStyle() ) );
setPen(subdivisionPen );
// 1 -> top-left corner
// 2 -> top-right corner
@@ -80,12 +80,12 @@ void GridDrawer::drawPerspectiveGrid(KisImageSP image, const QRect& /*wr*/, cons
KisPoint pol1 = *grid->topRight() + i * v12;
KisPerspectiveMath::LineEquation d1 = KisPerspectiveMath::computeLineEquation( &pol1, &vertVanishingPoint );
KisPoint pol1b = KisPerspectiveMath::computeIntersection(d1,d34);
- drawLine( pol1.roundQPoint(), pol1b.roundQPoint() );
+ drawLine( pol1.roundTQPoint(), pol1b.roundTQPoint() );
KisPoint pol2 = *grid->bottomRight() + i * v23;
KisPerspectiveMath::LineEquation d2 = KisPerspectiveMath::computeLineEquation( &pol2, &horizVanishingPoint );
KisPoint pol2b = KisPerspectiveMath::computeIntersection(d2,d41);
- drawLine( pol2.roundQPoint(), pol2b.roundQPoint() );
+ drawLine( pol2.roundTQPoint(), pol2b.roundTQPoint() );
}
setPen(mainPen);
drawLine( grid->topLeft(), grid->topRight() );
@@ -94,26 +94,26 @@ void GridDrawer::drawPerspectiveGrid(KisImageSP image, const QRect& /*wr*/, cons
drawLine( grid->bottomLeft(), grid->topLeft() );
}
-void GridDrawer::drawGrid(KisImageSP image, const QRect& wr)
+void GridDrawer::drawGrid(KisImageSP image, const TQRect& wr)
{
KisConfig cfg;
- Q_UINT32 offsetx = cfg.getGridOffsetX();
- Q_UINT32 offsety = cfg.getGridOffsetY();
- Q_UINT32 hspacing = cfg.getGridHSpacing();
- Q_UINT32 vspacing = cfg.getGridVSpacing();
- Q_UINT32 subdivision = cfg.getGridSubdivisions() - 1;
+ TQ_UINT32 offsetx = cfg.getGridOffsetX();
+ TQ_UINT32 offsety = cfg.getGridOffsetY();
+ TQ_UINT32 hspacing = cfg.getGridHSpacing();
+ TQ_UINT32 vspacing = cfg.getGridVSpacing();
+ TQ_UINT32 subdivision = cfg.getGridSubdivisions() - 1;
//double ihspsub = hspacing / (double)subdivision;
//double ivspsub = hspacing / (double)subdivision;
- Q_INT32 imageWidth = image->width();
- Q_INT32 imageHeight = image->height();
+ TQ_INT32 imageWidth = image->width();
+ TQ_INT32 imageHeight = image->height();
// Draw vertical line
- QPen mainPen = QPen ( cfg.getGridMainColor(), 1, gs2style( cfg.getGridMainStyle() ) );
- QPen subdivisionPen = QPen ( cfg.getGridSubdivisionColor(), 1, gs2style( cfg.getGridSubdivisionStyle() ) );
- Q_UINT32 i = 0;
- for( Q_INT32 x = offsetx; x <= wr.right(); x +=hspacing)
+ TQPen mainPen = TQPen ( cfg.getGridMainColor(), 1, gs2style( cfg.getGridMainStyle() ) );
+ TQPen subdivisionPen = TQPen ( cfg.getGridSubdivisionColor(), 1, gs2style( cfg.getGridSubdivisionStyle() ) );
+ TQ_UINT32 i = 0;
+ for( TQ_INT32 x = offsetx; x <= wr.right(); x +=hspacing)
{
if( i == subdivision )
{
@@ -132,7 +132,7 @@ void GridDrawer::drawGrid(KisImageSP image, const QRect& wr)
}
// Draw horizontal line
i = 0;
- for( Q_INT32 y = offsety; y <= wr.bottom(); y +=vspacing)
+ for( TQ_INT32 y = offsety; y <= wr.bottom(); y +=vspacing)
{
if( i == subdivision )
{
@@ -163,34 +163,34 @@ OpenGLGridDrawer::~OpenGLGridDrawer()
#endif
}
-void OpenGLGridDrawer::setPen(const QPen& pen)
+void OpenGLGridDrawer::setPen(const TQPen& pen)
{
#ifdef HAVE_GL
Qt::PenStyle penStyle = pen.style();
- if (penStyle == Qt::SolidLine) {
+ if (penStyle == TQt::SolidLine) {
glDisable(GL_LINE_STIPPLE);
} else {
GLushort lineStipple;
switch (penStyle) {
- case Qt::NoPen:
+ case TQt::NoPen:
lineStipple = 0;
break;
default:
- case Qt::SolidLine:
+ case TQt::SolidLine:
lineStipple = 0xffff;
break;
- case Qt::DashLine:
+ case TQt::DashLine:
lineStipple = 0x3fff;
break;
- case Qt::DotLine:
+ case TQt::DotLine:
lineStipple = 0x3333;
break;
- case Qt::DashDotLine:
+ case TQt::DashDotLine:
lineStipple = 0x33ff;
break;
- case Qt::DashDotDotLine:
+ case TQt::DashDotDotLine:
lineStipple = 0x333f;
break;
}
@@ -199,7 +199,7 @@ void OpenGLGridDrawer::setPen(const QPen& pen)
glLineStipple(1, lineStipple);
}
- QColor penColor = pen.color();
+ TQColor penColor = pen.color();
glColor3ub(penColor.red(), penColor.green(), penColor.blue());
#else
@@ -207,7 +207,7 @@ void OpenGLGridDrawer::setPen(const QPen& pen)
#endif
}
-void OpenGLGridDrawer::drawLine(Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32 y2)
+void OpenGLGridDrawer::drawLine(TQ_INT32 x1, TQ_INT32 y1, TQ_INT32 x2, TQ_INT32 y2)
{
#ifdef HAVE_GL
glBegin(GL_LINES);