summaryrefslogtreecommitdiffstats
path: root/kugar/kudesigner_lib/reportitem.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 /kugar/kudesigner_lib/reportitem.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 'kugar/kudesigner_lib/reportitem.cpp')
-rw-r--r--kugar/kudesigner_lib/reportitem.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/kugar/kudesigner_lib/reportitem.cpp b/kugar/kudesigner_lib/reportitem.cpp
index 077bc1fe..c986c970 100644
--- a/kugar/kudesigner_lib/reportitem.cpp
+++ b/kugar/kudesigner_lib/reportitem.cpp
@@ -21,9 +21,9 @@
#include <klocale.h>
#include <kglobalsettings.h>
-#include <qrect.h>
-#include <qpainter.h>
-#include <qregexp.h>
+#include <tqrect.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
#include <koproperty/property.h>
@@ -36,44 +36,44 @@
namespace Kudesigner
{
-QRect ReportItem::topLeftResizableRect()
+TQRect ReportItem::topLeftResizableRect()
{
- return QRect( ( int ) x(), ( int ) y(), HolderSize, HolderSize );
+ return TQRect( ( int ) x(), ( int ) y(), HolderSize, HolderSize );
}
-QRect ReportItem::bottomLeftResizableRect()
+TQRect ReportItem::bottomLeftResizableRect()
{
- return QRect( ( int ) x(), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
+ return TQRect( ( int ) x(), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
}
-QRect ReportItem::topRightResizableRect()
+TQRect ReportItem::topRightResizableRect()
{
- return QRect( ( int ) ( x() + width() - HolderSize ), ( int ) y(), HolderSize, HolderSize );
+ return TQRect( ( int ) ( x() + width() - HolderSize ), ( int ) y(), HolderSize, HolderSize );
}
-QRect ReportItem::bottomRightResizableRect()
+TQRect ReportItem::bottomRightResizableRect()
{
- return QRect( ( int ) ( x() + width() - HolderSize ), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
+ return TQRect( ( int ) ( x() + width() - HolderSize ), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
}
-QRect ReportItem::topMiddleResizableRect()
+TQRect ReportItem::topMiddleResizableRect()
{
- return QRect( ( int ) ( x() + width() / 2 - HolderSize / 2. ), ( int ) y(), HolderSize, HolderSize );
+ return TQRect( ( int ) ( x() + width() / 2 - HolderSize / 2. ), ( int ) y(), HolderSize, HolderSize );
}
-QRect ReportItem::bottomMiddleResizableRect()
+TQRect ReportItem::bottomMiddleResizableRect()
{
- return QRect( ( int ) ( x() + width() / 2 - HolderSize / 2. ), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
+ return TQRect( ( int ) ( x() + width() / 2 - HolderSize / 2. ), ( int ) ( y() + height() - HolderSize ), HolderSize, HolderSize );
}
-QRect ReportItem::leftMiddleResizableRect()
+TQRect ReportItem::leftMiddleResizableRect()
{
- return QRect( ( int ) x(), ( int ) ( y() + height() / 2 - HolderSize / 2. ), HolderSize, HolderSize );
+ return TQRect( ( int ) x(), ( int ) ( y() + height() / 2 - HolderSize / 2. ), HolderSize, HolderSize );
}
-QRect ReportItem::rightMiddleResizableRect()
+TQRect ReportItem::rightMiddleResizableRect()
{
- return QRect( ( int ) ( x() + width() - HolderSize ), ( int ) ( y() + height() / 2 - HolderSize / 2. ), HolderSize, HolderSize );
+ return TQRect( ( int ) ( x() + width() - HolderSize ), ( int ) ( y() + height() / 2 - HolderSize / 2. ), HolderSize, HolderSize );
}
void ReportItem::updateGeomProps()
@@ -88,67 +88,67 @@ void ReportItem::updateGeomProps()
Band *ReportItem::section()
{
- return parentSection;
+ return tqparentSection;
}
void ReportItem::setSection( Band *section )
{
props[ "X" ].setValue( ( int ) ( x() - section->x() ) );
props[ "Y" ].setValue( ( int ) ( y() - section->y() ) );
- parentSection = section;
+ tqparentSection = section;
}
void ReportItem::setSectionUndestructive( Band *section )
{
- parentSection = section;
+ tqparentSection = section;
}
-QString ReportItem::getXml()
+TQString ReportItem::getXml()
{
- QString result = "";
+ TQString result = "";
int i = 1;
for ( Set::Iterator it( props ); it.current(); ++it )
{
if ( !( i % 3 ) )
result += "\n\t\t ";
- result += " " + QString(it.currentKey()) + "=" + "\"" + escape( PropertySerializer::toString( it.current() ) ) + "\"";
+ result += " " + TQString(it.currentKey()) + "=" + "\"" + escape( PropertySerializer::toString( it.current() ) ) + "\"";
i++;
}
return result;
}
-int ReportItem::isInHolder( const QPoint p )
+int ReportItem::isInHolder( const TQPoint p )
{
- if ( topLeftResizableRect().contains( p ) )
+ if ( topLeftResizableRect().tqcontains( p ) )
return ( ResizeTop | ResizeLeft );
- if ( bottomLeftResizableRect().contains( p ) )
+ if ( bottomLeftResizableRect().tqcontains( p ) )
return ( ResizeBottom | ResizeLeft );
- if ( leftMiddleResizableRect().contains( p ) )
+ if ( leftMiddleResizableRect().tqcontains( p ) )
return ( ResizeLeft );
- if ( bottomMiddleResizableRect().contains( p ) )
+ if ( bottomMiddleResizableRect().tqcontains( p ) )
return ( ResizeBottom );
- if ( topMiddleResizableRect().contains( p ) )
+ if ( topMiddleResizableRect().tqcontains( p ) )
return ( ResizeTop );
- if ( topRightResizableRect().contains( p ) )
+ if ( topRightResizableRect().tqcontains( p ) )
return ( ResizeTop | ResizeRight );
- if ( bottomRightResizableRect().contains( p ) )
+ if ( bottomRightResizableRect().tqcontains( p ) )
return ( ResizeBottom | ResizeRight );
- if ( rightMiddleResizableRect().contains( p ) )
+ if ( rightMiddleResizableRect().tqcontains( p ) )
return ( ResizeRight );
return ResizeNothing;
}
-void ReportItem::drawHolders( QPainter &painter )
+void ReportItem::drawHolders( TQPainter &painter )
{
- painter.setPen( QColor( 0, 0, 0 ) );
+ painter.setPen( TQColor( 0, 0, 0 ) );
painter.setBrush( KGlobalSettings::highlightColor() );
- QCanvasItemList list = collisions( false );
- QCanvasItemList::iterator it = list.begin();
+ TQCanvasItemList list = collisions( false );
+ TQCanvasItemList::iterator it = list.begin();
for ( ; it != list.end(); ++it )
{
switch ( ( *it )->rtti() )
@@ -163,7 +163,7 @@ void ReportItem::drawHolders( QPainter &painter )
if ( section() != item->section() )
continue;
if ( intersects( item ) )
- painter.setBrush( Qt::red );
+ painter.setBrush( TQt::red );
break;
}
default:
@@ -172,7 +172,7 @@ void ReportItem::drawHolders( QPainter &painter )
}
if ( props["Height"].value().toInt() > section()->props["Height"].value().toInt() )
- painter.setBrush( Qt::red );
+ painter.setBrush( TQt::red );
painter.drawRect( topLeftResizableRect() );
painter.drawRect( topRightResizableRect() );
@@ -186,8 +186,8 @@ void ReportItem::drawHolders( QPainter &painter )
bool ReportItem::intersects( ReportItem *item )
{
- QRect r1;
- QRect r2;
+ TQRect r1;
+ TQRect r2;
if ( rtti() == Rtti_Line /*line*/ )
{
@@ -199,12 +199,12 @@ bool ReportItem::intersects( ReportItem *item )
//TODO I'm not sure of a good fix for this, but for now I'm assuming lines
// in reports are either horizontal or vertical.
if ( x1 == x2 )
- r1 = QRect( x1, y1, x2 + width, y2 );
+ r1 = TQRect( x1, y1, x2 + width, y2 );
else if ( y1 == y2 )
- r1 = QRect( x1, y1, x2, y2 + width );
+ r1 = TQRect( x1, y1, x2, y2 + width );
}
else
- r1 = QRect( props["X"].value().toInt(), props["Y"].value().toInt(),
+ r1 = TQRect( props["X"].value().toInt(), props["Y"].value().toInt(),
props["Width"].value().toInt(), props["Height"].value().toInt() );
if ( item->rtti() == Rtti_Line /*line*/ )
@@ -217,12 +217,12 @@ bool ReportItem::intersects( ReportItem *item )
//TODO I'm not sure of a good fix for this, but for now I'm assuming lines
// in reports are either horizontal or vertical.
if ( x1 == x2 )
- r2 = QRect( x1, y1, x2 + width, y2 );
+ r2 = TQRect( x1, y1, x2 + width, y2 );
else if ( y1 == y2 )
- r2 = QRect( x1, y1, x2, y2 + width );
+ r2 = TQRect( x1, y1, x2, y2 + width );
}
else
- r2 = QRect( item->props["X"].value().toInt(), item->props["Y"].value().toInt(),
+ r2 = TQRect( item->props["X"].value().toInt(), item->props["Y"].value().toInt(),
item->props["Width"].value().toInt(), item->props["Height"].value().toInt() );
bool intersects = r1.intersects( r2 );
@@ -236,11 +236,11 @@ bool ReportItem::intersects( ReportItem *item )
return intersects;
}
-QString ReportItem::escape( QString string )
+TQString ReportItem::escape( TQString string )
{
- string.replace( QRegExp( "&" ), "&amp;" );
- string.replace( QRegExp( "<" ), "&lt;" );
- string.replace( QRegExp( ">" ), "&gt;" );
+ string.tqreplace( TQRegExp( "&" ), "&amp;" );
+ string.tqreplace( TQRegExp( "<" ), "&lt;" );
+ string.tqreplace( TQRegExp( ">" ), "&gt;" );
return string;
}