summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrPolygonObject.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 /kpresenter/KPrPolygonObject.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 'kpresenter/KPrPolygonObject.cpp')
-rw-r--r--kpresenter/KPrPolygonObject.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/kpresenter/KPrPolygonObject.cpp b/kpresenter/KPrPolygonObject.cpp
index 120cd89c..451b1a48 100644
--- a/kpresenter/KPrPolygonObject.cpp
+++ b/kpresenter/KPrPolygonObject.cpp
@@ -23,11 +23,11 @@
#include "KPrGradient.h"
#include <KoTextZoomHandler.h>
#include <kdebug.h>
-#include <qbitmap.h>
-#include <qregion.h>
-#include <qdom.h>
-#include <qpicture.h>
-#include <qpainter.h>
+#include <tqbitmap.h>
+#include <tqregion.h>
+#include <tqdom.h>
+#include <tqpicture.h>
+#include <tqpainter.h>
#include "KPrPolygonObjectIface.h"
#include <KoUnit.h>
#include <KoOasisContext.h>
@@ -43,8 +43,8 @@ KPrPolygonObject::KPrPolygonObject()
}
KPrPolygonObject::KPrPolygonObject( const KoPointArray &_points, const KoSize &_size,
- const KoPen &_pen, const QBrush &_brush,
- FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ const KoPen &_pen, const TQBrush &_brush,
+ FillType _fillType, const TQColor &_gColor1, const TQColor &_gColor2, BCType _gType,
bool _unbalanced, int _xfactor, int _yfactor,
bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue )
: KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
@@ -75,7 +75,7 @@ bool KPrPolygonObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
sc.xmlWriter.addAttribute( "draw:concave", checkConcavePolygon ? "true" : "false" );
if ( checkConcavePolygon )
{
- sc.xmlWriter.addAttribute( "draw:sharpness", QString( "%1%").arg( sharpnessValue ) );
+ sc.xmlWriter.addAttribute( "draw:sharpness", TQString( "%1%").tqarg( sharpnessValue ) );
}
return true;
@@ -87,11 +87,11 @@ const char * KPrPolygonObject::getOasisElementName() const
}
-QDomDocumentFragment KPrPolygonObject::save( QDomDocument& doc, double offset )
+TQDomDocumentFragment KPrPolygonObject::save( TQDomDocument& doc, double offset )
{
- QDomDocumentFragment fragment = KPr2DObject::save( doc, offset );
+ TQDomDocumentFragment fragment = KPr2DObject::save( doc, offset );
- QDomElement elemSettings = doc.createElement( "SETTINGS" );
+ TQDomElement elemSettings = doc.createElement( "SETTINGS" );
elemSettings.setAttribute( "checkConcavePolygon", static_cast<int>( checkConcavePolygon ) );
elemSettings.setAttribute( "cornersValue", cornersValue );
@@ -100,10 +100,10 @@ QDomDocumentFragment KPrPolygonObject::save( QDomDocument& doc, double offset )
fragment.appendChild( elemSettings );
if ( !points.isNull() ) {
- QDomElement elemPoints = doc.createElement( "POINTS" );
+ TQDomElement elemPoints = doc.createElement( "POINTS" );
KoPointArray::ConstIterator it;
for ( it = points.begin(); it != points.end(); ++it ) {
- QDomElement elemPoint = doc.createElement( "Point" );
+ TQDomElement elemPoint = doc.createElement( "Point" );
KoPoint point = (*it);
elemPoint.setAttribute( "point_x", point.x() );
elemPoint.setAttribute( "point_y", point.y() );
@@ -116,25 +116,25 @@ QDomDocumentFragment KPrPolygonObject::save( QDomDocument& doc, double offset )
return fragment;
}
-void KPrPolygonObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info )
+void KPrPolygonObject::loadOasis( const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info )
{
- kdDebug()<<"void KPrPolygonObject::loadOasis( const QDomElement &element )***********\n";
+ kdDebug()<<"void KPrPolygonObject::loadOasis( const TQDomElement &element )***********\n";
KPr2DObject::loadOasis( element,context, info );
- cornersValue = element.attributeNS( KoXmlNS::draw, "corners", QString::null ).toInt();
- checkConcavePolygon = element.attributeNS( KoXmlNS::draw, "concave", QString::null ) == "true";
+ cornersValue = element.attributeNS( KoXmlNS::draw, "corners", TQString() ).toInt();
+ checkConcavePolygon = element.attributeNS( KoXmlNS::draw, "concave", TQString() ) == "true";
sharpnessValue = 0;
if ( checkConcavePolygon )
{
- sharpnessValue = element.attributeNS( KoXmlNS::draw, "sharpness", QString::null ).remove( '%').toInt();
+ sharpnessValue = element.attributeNS( KoXmlNS::draw, "sharpness", TQString() ).remove( '%').toInt();
}
drawPolygon();
}
-double KPrPolygonObject::load( const QDomElement &element )
+double KPrPolygonObject::load( const TQDomElement &element )
{
double offset=KPr2DObject::load( element );
- QDomElement e = element.namedItem( "SETTINGS" ).toElement();
+ TQDomElement e = element.namedItem( "SETTINGS" ).toElement();
if ( !e.isNull() ) {
bool _checkConcavePolygon = false;
int _cornersValue = 3;
@@ -154,7 +154,7 @@ double KPrPolygonObject::load( const QDomElement &element )
e = element.namedItem( "POINTS" ).toElement();
if ( !e.isNull() ) {
- QDomElement elemPoint = e.firstChild().toElement();
+ TQDomElement elemPoint = e.firstChild().toElement();
unsigned int index = 0;
while ( !elemPoint.isNull() ) {
if ( elemPoint.tagName() == "Point" ) {
@@ -201,22 +201,22 @@ void KPrPolygonObject::updatePoints( double _fx, double _fy )
points = tmpPoints;
}
-void KPrPolygonObject::paint( QPainter* _painter,KoTextZoomHandler*_zoomHandler,
+void KPrPolygonObject::paint( TQPainter* _painter,KoTextZoomHandler*_zoomHandler,
int /* pageNum */, bool drawingShadow, bool drawContour )
{
- int _w = ( pen.style() == Qt::NoPen ) ? 1 : pen.width();//pen.width();
+ int _w = ( pen.style() == TQt::NoPen ) ? 1 : pen.width();//pen.width();
if ( drawContour ) {
- QPointArray pointArray2 = points.zoomPointArray( _zoomHandler );
- QPen pen3( Qt::black, 1, Qt::DotLine );
+ TQPointArray pointArray2 = points.zoomPointArray( _zoomHandler );
+ TQPen pen3( TQt::black, 1, TQt::DotLine );
_painter->setPen( pen3 );
- _painter->setRasterOp( Qt::NotXorROP );
+ _painter->setRasterOp( TQt::NotXorROP );
_painter->drawPolygon( pointArray2 );
return;
}
- QPointArray pointArray = points.zoomPointArray( _zoomHandler, _w );
- QPen pen2 = pen.zoomedPen( _zoomHandler );
+ TQPointArray pointArray = points.zoomPointArray( _zoomHandler, _w );
+ TQPen pen2 = pen.zoomedPen( _zoomHandler );
if ( drawingShadow || getFillType() == FT_BRUSH || !gradient ) {
_painter->setPen( pen2 );
@@ -224,16 +224,16 @@ void KPrPolygonObject::paint( QPainter* _painter,KoTextZoomHandler*_zoomHandler,
_painter->drawPolygon( pointArray );
}
else {
- QSize size( _zoomHandler->zoomSize( ext ) );
+ TQSize size( _zoomHandler->zoomSize( ext ) );
if ( m_redrawGradientPix || gradient->size() != size )
{
m_redrawGradientPix = false;
gradient->setSize( size );
- QRegion clipregion( pointArray );
+ TQRegion clipregion( pointArray );
m_gradientPix.resize( size );
- m_gradientPix.fill( Qt::white );
+ m_gradientPix.fill( TQt::white );
- QPainter p;
+ TQPainter p;
p.begin( &m_gradientPix );
p.setClipRegion( clipregion );
p.drawPixmap( 0, 0, gradient->pixmap() );
@@ -242,11 +242,11 @@ void KPrPolygonObject::paint( QPainter* _painter,KoTextZoomHandler*_zoomHandler,
m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
}
- QRect _rect = pointArray.boundingRect();
+ TQRect _rect = pointArray.boundingRect();
_painter->drawPixmap( 0, 0, m_gradientPix, 0, 0, _rect.width(), _rect.height() );
_painter->setPen( pen2 );
- _painter->setBrush( Qt::NoBrush );
+ _painter->setBrush( TQt::NoBrush );
_painter->drawPolygon( pointArray );
}
@@ -257,14 +257,14 @@ void KPrPolygonObject::drawPolygon()
kdDebug()<<"void KPrPolygonObject::drawPolygon()***********\n";
KoRect _rect( 0, 0, ext.width(), ext.height() );
double angle = 2 * M_PI / cornersValue;
- double diameter = static_cast<double>( QMAX( _rect.width(), _rect.height() ) );
+ double diameter = static_cast<double>( TQMAX( _rect.width(), _rect.height() ) );
double radius = diameter * 0.5;
KoPointArray _points( checkConcavePolygon ? cornersValue * 2 : cornersValue );
- _points.setPoint( 0, 0, qRound( -radius ) );
+ _points.setPoint( 0, 0, tqRound( -radius ) );
double xmin = 0;
- double ymin = qRound( -radius );
+ double ymin = tqRound( -radius );
if ( checkConcavePolygon ) {
angle = angle / 2.0;