diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kpresenter/KPrRectObject.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/KPrRectObject.cpp')
-rw-r--r-- | kpresenter/KPrRectObject.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/kpresenter/KPrRectObject.cpp b/kpresenter/KPrRectObject.cpp index b7dc7bcf..b32f6f73 100644 --- a/kpresenter/KPrRectObject.cpp +++ b/kpresenter/KPrRectObject.cpp @@ -29,10 +29,10 @@ #include <KoXmlNS.h> #include <kdebug.h> -#include <qregion.h> -#include <qbitmap.h> -#include <qdom.h> -#include <qpainter.h> +#include <tqregion.h> +#include <tqbitmap.h> +#include <tqdom.h> +#include <tqpainter.h> KPrRectObject::KPrRectObject() : KPr2DObject() @@ -48,8 +48,8 @@ DCOPObject* KPrRectObject::dcopObject() return dcop; } -KPrRectObject::KPrRectObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType, - const QColor &_gColor1, const QColor &_gColor2, +KPrRectObject::KPrRectObject( const KoPen &_pen, const TQBrush &_brush, FillType _fillType, + const TQColor &_gColor1, const TQColor &_gColor2, BCType _gType, int _xRnd, int _yRnd, bool _unbalanced, int _xfactor, int _yfactor) : KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, @@ -64,11 +64,11 @@ KPrRectObject &KPrRectObject::operator=( const KPrRectObject & ) return *this; } -QDomDocumentFragment KPrRectObject::save( QDomDocument& doc, double offset ) +TQDomDocumentFragment KPrRectObject::save( TQDomDocument& doc, double offset ) { - QDomDocumentFragment fragment=KPr2DObject::save(doc, offset); + TQDomDocumentFragment fragment=KPr2DObject::save(doc, offset); if (xRnd!=0 || yRnd!=0) { - QDomElement elem=doc.createElement("RNDS"); + TQDomElement elem=doc.createElement("RNDS"); elem.setAttribute("x", xRnd); elem.setAttribute("y", yRnd); fragment.appendChild(elem); @@ -82,7 +82,7 @@ bool KPrRectObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const { double cornerRadiusX = ext.width() / 200.0 * xRnd; double cornerRadiusY = ext.height() / 200.0 * yRnd; - double cornerRadius = QMIN( cornerRadiusX, cornerRadiusY ); + double cornerRadius = TQMIN( cornerRadiusX, cornerRadiusY ); sc.xmlWriter.addAttributePt( "draw:corner-radius", cornerRadius ); if ( cornerRadiusX != cornerRadiusY ) { @@ -100,33 +100,33 @@ const char * KPrRectObject::getOasisElementName() const } -void KPrRectObject::loadOasis(const QDomElement &element, KoOasisContext&context, KPrLoadingInfo *info) +void KPrRectObject::loadOasis(const TQDomElement &element, KoOasisContext&context, KPrLoadingInfo *info) { KPr2DObject::loadOasis(element, context, info); if ( element.hasAttributeNS( KoXmlNS::koffice, "corner-radius-x" ) && element.hasAttributeNS( KoXmlNS::koffice, "corner-radius-y" ) ) { xRnd = int( KoUnit::parseValue( - element.attributeNS( KoXmlNS::koffice, "corner-radius-x", QString::null ) + element.attributeNS( KoXmlNS::koffice, "corner-radius-x", TQString() ) ) * 200.0 / ext.width() ); yRnd = int( KoUnit::parseValue( - element.attributeNS( KoXmlNS::koffice, "corner-radius-y", QString::null ) + element.attributeNS( KoXmlNS::koffice, "corner-radius-y", TQString() ) ) * 200.0 / ext.height() ); } else if ( element.hasAttributeNS( KoXmlNS::draw, "corner-radius" ) ) { xRnd = int( KoUnit::parseValue( - element.attributeNS( KoXmlNS::draw, "corner-radius", QString::null ) + element.attributeNS( KoXmlNS::draw, "corner-radius", TQString() ) ) * 200.0 / ext.width() ); yRnd = xRnd; } kdDebug(33001) << " KPrRectObject : radius xRnd :" << xRnd << " yRnd :" << yRnd <<endl; } -double KPrRectObject::load(const QDomElement &element) +double KPrRectObject::load(const TQDomElement &element) { double offset=KPr2DObject::load(element); - QDomElement e=element.namedItem("RNDS").toElement(); + TQDomElement e=element.namedItem("RNDS").toElement(); if(!e.isNull()) { int tmp=0; if(e.hasAttribute("x")) @@ -140,7 +140,7 @@ double KPrRectObject::load(const QDomElement &element) return offset; } -QPointArray KPrRectObject::boundingRegion( int x, int y, int w, int h, int _xRnd, int _yRnd) const +TQPointArray KPrRectObject::boundingRegion( int x, int y, int w, int h, int _xRnd, int _yRnd) const { w--; h--; @@ -153,12 +153,12 @@ QPointArray KPrRectObject::boundingRegion( int x, int y, int w, int h, int _xRnd ryy = h/200*_yRnd; int rxx2 = 2*rxx; int ryy2 = 2*ryy; - QPointArray a[4]; + TQPointArray a[4]; a[0].makeArc( x, y, rxx2, ryy2, 1440, 1440); // ..., 1*16*90, 16*90); a[1].makeArc( x, y+h-ryy2, rxx2, ryy2, 2880, 1440); // ..., 2*16*90, 16*90); a[2].makeArc( x+w-rxx2, y+h-ryy2, rxx2, ryy2, 4320, 1440); // ..., 3*16*90, 16*90); a[3].makeArc( x+w-rxx2, y, rxx2, ryy2, 0, 1440); // ..., 0*16*90, 16*90); - QPointArray aa; + TQPointArray aa; aa.resize( a[0].size() + a[1].size() + a[2].size() + a[3].size() ); uint j = 0; for ( int k=0; k<4; k++ ) { @@ -170,23 +170,23 @@ QPointArray KPrRectObject::boundingRegion( int x, int y, int w, int h, int _xRnd return aa; } -void KPrRectObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler, +void KPrRectObject::paint( TQPainter* _painter, KoTextZoomHandler*_zoomHandler, int /* pageNum */, bool drawingShadow, bool drawContour ) { int ow = _zoomHandler->zoomItX( ext.width() ); int oh = _zoomHandler->zoomItY( ext.height() ); if ( drawContour ) { - QPen pen3( Qt::black, 1, Qt::DotLine ); + TQPen pen3( TQt::black, 1, TQt::DotLine ); _painter->setPen( pen3 ); - _painter->setRasterOp( Qt::NotXorROP ); + _painter->setRasterOp( TQt::NotXorROP ); _painter->drawRoundRect( 0, 0, ow, oh, xRnd, yRnd ); return; } - QPen pen2 = pen.zoomedPen( _zoomHandler ); - int pw = ( pen2.style() == Qt::NoPen ) ? 1 : pen2.width(); + TQPen pen2 = pen.zoomedPen( _zoomHandler ); + int pw = ( pen2.style() == TQt::NoPen ) ? 1 : pen2.width(); _painter->setPen( pen2 ); if ( drawingShadow || getFillType() == FT_BRUSH || !gradient ) { //plain fill @@ -194,15 +194,15 @@ void KPrRectObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler, _painter->setBrush( getBrush() ); } else { //gradient - QSize size( _zoomHandler->zoomSize( ext ) ); + TQSize size( _zoomHandler->zoomSize( ext ) ); if ( m_redrawGradientPix || gradient->size() != size ) { m_redrawGradientPix = false; gradient->setSize( size ); - QPointArray arr = boundingRegion( 0, 0, ow - pw + 1, oh - pw + 1, xRnd, yRnd ); - QRegion clipregion(arr); + TQPointArray arr = boundingRegion( 0, 0, ow - pw + 1, oh - pw + 1, xRnd, yRnd ); + TQRegion clipregion(arr); m_gradientPix.resize ( ow, oh ); - m_gradientPix.fill( Qt::white ); - QPainter p; + m_gradientPix.fill( TQt::white ); + TQPainter p; p.begin( &m_gradientPix ); p.setClipRegion( clipregion ); p.drawPixmap( 0, 0, gradient->pixmap() ); @@ -212,7 +212,7 @@ void KPrRectObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler, } _painter->drawPixmap( pw / 2, pw / 2, m_gradientPix, 0, 0, ow - pw + 1, oh - pw + 1 ); - _painter->setBrush( Qt::NoBrush ); + _painter->setBrush( TQt::NoBrush ); } _painter->drawRoundRect( pw / 2, pw / 2, ow - pw + 1, oh - pw + 1, xRnd, yRnd ); |