summaryrefslogtreecommitdiffstats
path: root/libkdchart/KDChartTextPiece.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkdchart/KDChartTextPiece.cpp')
-rw-r--r--libkdchart/KDChartTextPiece.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/libkdchart/KDChartTextPiece.cpp b/libkdchart/KDChartTextPiece.cpp
index 2b451c2..b95165f 100644
--- a/libkdchart/KDChartTextPiece.cpp
+++ b/libkdchart/KDChartTextPiece.cpp
@@ -28,33 +28,33 @@
**********************************************************************/
#include "KDChartTextPiece.h"
-#include <qstylesheet.h>
-#include <qsimplerichtext.h>
-#include <qfontmetrics.h>
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qrect.h>
+#include <tqstylesheet.h>
+#include <tqsimplerichtext.h>
+#include <tqfontmetrics.h>
+#include <tqpainter.h>
+#include <tqapplication.h>
+#include <tqrect.h>
KDChartTextPiece::KDChartTextPiece()
- :QObject(0)
+ :TQObject(0)
{
_isRichText = false;
_richText = 0;
- _font = QApplication::font();
+ _font = TQApplication::font();
// These three are needed for both
- _metrics = new QFontMetrics( _font );
+ _metrics = new TQFontMetrics( _font );
_dirtyMetrics = true;
- _text = QString("");
+ _text = TQString("");
}
-KDChartTextPiece::KDChartTextPiece( const QString& text, const QFont& font )
- :QObject(0)
+KDChartTextPiece::KDChartTextPiece( const TQString& text, const TQFont& font )
+ :TQObject(0)
{
- if( QStyleSheet::mightBeRichText( text ) ) {
+ if( TQStyleSheet::mightBeRichText( text ) ) {
_isRichText = true;
- _richText = new QSimpleRichText( text, font );
+ _richText = new TQSimpleRichText( text, font );
_richText->adjustSize();
} else {
_isRichText = false;
@@ -62,25 +62,25 @@ KDChartTextPiece::KDChartTextPiece( const QString& text, const QFont& font )
}
// These three are needed for both
- _metrics = new QFontMetrics( font );
+ _metrics = new TQFontMetrics( font );
_dirtyMetrics = true;
_text = text;
_font = font;
}
-KDChartTextPiece::KDChartTextPiece( QPainter *p, const QString& text, const QFont& font )
- :QObject(0)
+KDChartTextPiece::KDChartTextPiece( TQPainter *p, const TQString& text, const TQFont& font )
+ :TQObject(0)
{
- if( QStyleSheet::mightBeRichText( text ) ) {
+ if( TQStyleSheet::mightBeRichText( text ) ) {
_isRichText = true;
- _richText = new QSimpleRichText( text, font );
- //qDebug( "richtext width %s", QString::number(_richText->width()).latin1());
- //qDebug( "richtext height %s", QString::number(_richText->height()).latin1());
+ _richText = new TQSimpleRichText( text, font );
+ //qDebug( "richtext width %s", TQString::number(_richText->width()).latin1());
+ //qDebug( "richtext height %s", TQString::number(_richText->height()).latin1());
_richText->adjustSize();
- //qDebug( "richtext width %s", QString::number(_richText->width()).latin1());
- //qDebug( "richtext height %s", QString::number(_richText->height()).latin1());
+ //qDebug( "richtext width %s", TQString::number(_richText->width()).latin1());
+ //qDebug( "richtext height %s", TQString::number(_richText->height()).latin1());
} else {
_isRichText = false;
@@ -90,13 +90,13 @@ KDChartTextPiece::KDChartTextPiece( QPainter *p, const QString& text, const QFon
// These three are needed for both
_dirtyMetrics = (p == 0);
if( _dirtyMetrics ) {
- _metrics = new QFontMetrics( font );
+ _metrics = new TQFontMetrics( font );
//qDebug("dirty metrics text: %s", text.latin1());
}
else{
p->save();
p->setFont( font );
- _metrics = new QFontMetrics( p->fontMetrics() );
+ _metrics = new TQFontMetrics( p->fontMetrics() );
//qDebug ( "drawing metrics text: %s", text.latin1() );
//p->drawRect( _metrics->boundingRect( text) );
//p->drawText( _metrics->boundingRect(text).bottomRight(), text);
@@ -115,7 +115,7 @@ void KDChartTextPiece::deepCopy( const KDChartTextPiece* source )
delete _richText;
_isRichText = source->_isRichText;
if( source->_richText ) {
- _richText = new QSimpleRichText( source->_text, source->_font );
+ _richText = new TQSimpleRichText( source->_text, source->_font );
_richText->adjustSize();
}
else
@@ -124,7 +124,7 @@ void KDChartTextPiece::deepCopy( const KDChartTextPiece* source )
// used for both
if( _metrics )
delete _metrics;
- _metrics = new QFontMetrics( *source->_metrics );
+ _metrics = new TQFontMetrics( *source->_metrics );
_dirtyMetrics = source->_dirtyMetrics;
_text = source->_text;
_font = source->_font;
@@ -160,12 +160,12 @@ int KDChartTextPiece::height() const
{
if( _isRichText ) {
- //qDebug ("_richText height %s", QString::number(_richText->height()).latin1());
+ //qDebug ("_richText height %s", TQString::number(_richText->height()).latin1());
return _richText->height();
}
else {
- //qDebug ("_metrics height %s", QString::number(_metrics->height()).latin1());
+ //qDebug ("_metrics height %s", TQString::number(_metrics->height()).latin1());
return _metrics->height();
}
}
@@ -176,16 +176,16 @@ int KDChartTextPiece::fontLeading() const
return _metrics->leading();
}
-QRect KDChartTextPiece::rect( QPainter *p, const QRect& clipRect) const
+TQRect KDChartTextPiece::rect( TQPainter *p, const TQRect& clipRect) const
{
- QRect rect( clipRect );
- QFont font( _font );
+ TQRect rect( clipRect );
+ TQFont font( _font );
if( _isRichText ) {
// Pending Michel make sure the fonts are not too large
if ( _richText->height() > clipRect.height() || _richText->width() > clipRect.width() )
- font.setPixelSize( QMIN( (int)clipRect.width(),(int)clipRect.height() ) );
+ font.setPixelSize( TQMIN( (int)clipRect.width(),(int)clipRect.height() ) );
_richText->setDefaultFont( font );
_richText->setWidth( p, clipRect.width() );
@@ -197,18 +197,18 @@ QRect KDChartTextPiece::rect( QPainter *p, const QRect& clipRect) const
return rect;
}
-void KDChartTextPiece::draw( QPainter *p, int x, int y,
- const QRect& clipRect,
- const QColor& color,
- const QBrush* paper ) const
+void KDChartTextPiece::draw( TQPainter *p, int x, int y,
+ const TQRect& clipRect,
+ const TQColor& color,
+ const TQBrush* paper ) const
{
if( _isRichText ) {
- QColorGroup cg;
+ TQColorGroup cg;
//calculate the text area before drawing
- QRect txtArea = rect( p,clipRect);
- cg.setColor( QColorGroup::Text, color );
+ TQRect txtArea = rect( p,clipRect);
+ cg.setColor( TQColorGroup::Text, color );
_richText->draw( p, txtArea.x(), txtArea.y(),txtArea , cg, paper );
} else {
p->save();
@@ -223,7 +223,7 @@ void KDChartTextPiece::draw( QPainter *p, int x, int y,
delete _metrics;
KDChartTextPiece* meNotConst = const_cast<KDChartTextPiece*>(this);
//KDChartTextPiece* meNotConst(const_cast<KDChartTextPiece*>(this));
- meNotConst->_metrics = new QFontMetrics( p->fontMetrics() );
+ meNotConst->_metrics = new TQFontMetrics( p->fontMetrics() );
meNotConst->_dirtyMetrics = false;
}
@@ -233,14 +233,14 @@ void KDChartTextPiece::draw( QPainter *p, int x, int y,
}
-void KDChartTextPiece::draw( QPainter *p, int x, int y,
- const QRegion& clipRegion,
- const QColor& color,
- const QBrush* paper ) const
+void KDChartTextPiece::draw( TQPainter *p, int x, int y,
+ const TQRegion& clipRegion,
+ const TQColor& color,
+ const TQBrush* paper ) const
{
if( _isRichText ) {
- QColorGroup cg;
- cg.setColor( QColorGroup::Text, color );
+ TQColorGroup cg;
+ cg.setColor( TQColorGroup::Text, color );
_richText->setDefaultFont( _font );
_richText->setWidth( p, clipRegion.boundingRect().width() );
_richText->draw( p, x, y, clipRegion, cg, paper );
@@ -260,7 +260,7 @@ void KDChartTextPiece::draw( QPainter *p, int x, int y,
// KDChartTextPiece* meNotConst( const_cast<KDChartTextPiece*>(this) );
KDChartTextPiece* meNotConst = const_cast<KDChartTextPiece*>(this);
- meNotConst->_metrics = new QFontMetrics( p->fontMetrics() );
+ meNotConst->_metrics = new TQFontMetrics( p->fontMetrics() );
meNotConst->_dirtyMetrics = false;
}
@@ -270,13 +270,13 @@ void KDChartTextPiece::draw( QPainter *p, int x, int y,
}
-QString KDChartTextPiece::text() const
+TQString KDChartTextPiece::text() const
{
return _text;
}
-QFont KDChartTextPiece::font() const
+TQFont KDChartTextPiece::font() const
{
return _font;
}