summaryrefslogtreecommitdiffstats
path: root/kugar/kudesigner_lib/kugartemplate.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/kugartemplate.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/kugartemplate.cpp')
-rw-r--r--kugar/kudesigner_lib/kugartemplate.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kugar/kudesigner_lib/kugartemplate.cpp b/kugar/kudesigner_lib/kugartemplate.cpp
index 500bc419..deffdcc6 100644
--- a/kugar/kudesigner_lib/kugartemplate.cpp
+++ b/kugar/kudesigner_lib/kugartemplate.cpp
@@ -20,10 +20,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#include <klocale.h>
-#include <qcanvas.h>
-#include <qpainter.h>
-#include <qprinter.h>
-#include <qpaintdevicemetrics.h>
+#include <tqcanvas.h>
+#include <tqpainter.h>
+#include <tqprinter.h>
+#include <tqpaintdevicemetrics.h>
#include <koproperty/property.h>
@@ -60,7 +60,7 @@ KugarTemplate::KugarTemplate( int x, int y, int width, int height, Canvas *canva
props.setGroupDescription( "DocumentSettings", i18n( "Document Settings" ) );
- QMap<QString, QString> m;
+ TQMap<TQString, TQString> m;
m[ "A4" ] = "0";
m[ "B5" ] = "1";
m[ "Letter" ] = "2";
@@ -97,7 +97,7 @@ KugarTemplate::KugarTemplate( int x, int y, int width, int height, Canvas *canva
m[ i18n( "Portrait" ) ] = "0";
m[ i18n( "Landscape" ) ] = "1";
- props.addProperty( new Property( "PageOrientation", m.values(), m.keys(), "0", i18n( "Page Orientation" ), i18n( "Page Orientation" ) ), "DocumentSettings" );
+ props.addProperty( new Property( "PageQt::Orientation", m.values(), m.keys(), "0", i18n( "Page Qt::Orientation" ), i18n( "Page Qt::Orientation" ) ), "DocumentSettings" );
m.clear();
props.addProperty( new Property( "TopMargin", 0, i18n( "Top Margin" ), i18n( "Top Margin" ), KoProperty::Integer ), "DocumentSettings" );
@@ -129,17 +129,17 @@ KugarTemplate::~KugarTemplate()
delete reportFooter;
}
-void KugarTemplate::draw( QPainter &painter )
+void KugarTemplate::draw( TQPainter &painter )
{
updatePaperProps();
- painter.setPen( QPen( QColor( 160, 160, 160 ), 0, Qt::SolidLine ) );
- QPoint p1( ( int ) ( x() + props[ "LeftMargin" ].value().toInt() ),
+ painter.setPen( TQPen( TQColor( 160, 160, 160 ), 0, TQt::SolidLine ) );
+ TQPoint p1( ( int ) ( x() + props[ "LeftMargin" ].value().toInt() ),
( int ) ( y() + props[ "TopMargin" ].value().toInt() ) );
- QPoint p2( ( int ) ( x() + props[ "LeftMargin" ].value().toInt() ),
+ TQPoint p2( ( int ) ( x() + props[ "LeftMargin" ].value().toInt() ),
( int ) y() + height() - props[ "BottomMargin" ].value().toInt() );
- QPoint p3( ( int ) x() + width() - props[ "RightMargin" ].value().toInt(),
+ TQPoint p3( ( int ) x() + width() - props[ "RightMargin" ].value().toInt(),
( int ) y() + height() - props[ "BottomMargin" ].value().toInt() );
- QPoint p4( ( int ) x() + width() - props[ "RightMargin" ].value().toInt(),
+ TQPoint p4( ( int ) x() + width() - props[ "RightMargin" ].value().toInt(),
( int ) ( y() + props[ "TopMargin" ].value().toInt() ) );
painter.moveTo( p1 );
painter.lineTo( p2 );
@@ -171,16 +171,16 @@ void KugarTemplate::draw( QPainter &painter )
void KugarTemplate::updatePaperProps()
{
- QPrinter * printer;
+ TQPrinter * printer;
// Set the page size
- printer = new QPrinter();
+ printer = new TQPrinter();
printer->setFullPage( true );
- printer->setPageSize( ( QPrinter::PageSize ) props[ "PageSize" ].value().toInt() );
- printer->setOrientation( ( QPrinter::Orientation ) props[ "PageOrientation" ].value().toInt() );
+ printer->setPageSize( ( TQPrinter::PageSize ) props[ "PageSize" ].value().toInt() );
+ printer->setOrientation( ( TQPrinter::Orientation ) props[ "PageQt::Orientation" ].value().toInt() );
// Get the page metrics and set appropriate wigth and height
- QPaintDeviceMetrics pdm( printer );
+ TQPaintDeviceMetrics pdm( printer );
canvas() ->resize( pdm.width(), pdm.height() );
setSize( pdm.width(), pdm.height() );
@@ -249,23 +249,23 @@ void KugarTemplate::arrangeSections( bool destructive )
}
}
-QString KugarTemplate::getXml()
+TQString KugarTemplate::getXml()
{
- QString result = "";
+ TQString result = "";
result += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n";
result += "<!DOCTYPE KugarTemplate SYSTEM \"kugartemplate.dtd\">\n\n";
result += "<KugarTemplate";
for ( Set::Iterator it( props ); it.current(); ++it )
{
- QString attribute = it.currentKey();
- QString value = PropertySerializer::toString( it.current() );
+ TQString attribute = it.currentKey();
+ TQString value = PropertySerializer::toString( it.current() );
if ( !attribute.isEmpty() && !value.isEmpty() )
result += " " + attribute + "=" + "\"" + value + "\"";
}
- result += " PageWidth=\"" + QString::number( width() )
- + "\" PageHeight=\"" + QString::number( height() ) + "\"";
+ result += " PageWidth=\"" + TQString::number( width() )
+ + "\" PageHeight=\"" + TQString::number( height() ) + "\"";
result += ">\n";
@@ -297,7 +297,7 @@ QString KugarTemplate::getXml()
return result;
}
-bool KugarTemplate::removeReportItem( QCanvasItem *item )
+bool KugarTemplate::removeReportItem( TQCanvasItem *item )
{
if ( item->rtti() > 2000 )
{