diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/drawparts/solidshape.cpp | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip |
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/drawparts/solidshape.cpp')
-rw-r--r-- | src/drawparts/solidshape.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/drawparts/solidshape.cpp b/src/drawparts/solidshape.cpp index e60efef..1760db9 100644 --- a/src/drawparts/solidshape.cpp +++ b/src/drawparts/solidshape.cpp @@ -15,7 +15,7 @@ #include <cmath> #include <kiconloader.h> #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> //BEGIN class DPRectangle @@ -27,7 +27,7 @@ Item * DPRectangle::construct( ItemDocument *itemDocument, bool newItem, const c LibraryItem* DPRectangle::libraryItem() { return new LibraryItem( - QString("dp/rectangle"), + TQString("dp/rectangle"), i18n("Rectangle"), i18n("Other"), KGlobal::iconLoader()->loadIcon( "text", KIcon::Small ), @@ -47,12 +47,12 @@ DPRectangle::DPRectangle( ItemDocument *itemDocument, bool newItem, const char * property("background")->setAdvanced(true); createProperty( "background-color", Variant::Type::Color ); - property("background-color")->setValue(Qt::white); + property("background-color")->setValue(TQt::white); property("background-color")->setCaption( i18n("Background Color") ); property("background-color")->setAdvanced(true); createProperty( "line-color", Variant::Type::Color ); - property("line-color")->setValue(Qt::black); + property("line-color")->setValue(TQt::black); property("line-color")->setCaption( i18n("Line Color") ); property("line-color")->setAdvanced(true); @@ -85,11 +85,11 @@ void DPRectangle::setSelected( bool yes ) void DPRectangle::dataChanged() { bool displayBackground = dataBool("background"); - QColor line_color = dataColor("line-color"); + TQColor line_color = dataColor("line-color"); unsigned width = unsigned( dataInt("line-width") ); Qt::PenStyle style = getDataPenStyle("line-style"); - setPen( QPen( line_color, width, style ) ); + setPen( TQPen( line_color, width, style ) ); if (displayBackground) setBrush( dataColor("background-color") ); @@ -101,10 +101,10 @@ void DPRectangle::dataChanged() } -QSize DPRectangle::minimumSize() const +TQSize DPRectangle::tqminimumSize() const { - int side = QMAX(16, pen().width()+2); - return QSize( side, side ); + int side = TQMAX(16, pen().width()+2); + return TQSize( side, side ); } @@ -114,7 +114,7 @@ void DPRectangle::postResize() } -QRect DPRectangle::drawRect() const +TQRect DPRectangle::drawRect() const { int lw = pen().width(); @@ -124,12 +124,12 @@ QRect DPRectangle::drawRect() const if ( lw > m_sizeRect.height() ) lw = m_sizeRect.height(); - return QRect( int(x() + m_sizeRect.x()+lw/2), int(y() + m_sizeRect.y()+lw/2), + return TQRect( int(x() + m_sizeRect.x()+lw/2), int(y() + m_sizeRect.y()+lw/2), m_sizeRect.width()-lw, m_sizeRect.height()-lw ); } -void DPRectangle::drawShape( QPainter & p ) +void DPRectangle::drawShape( TQPainter & p ) { p.drawRect(drawRect()); } @@ -145,7 +145,7 @@ Item * DPEllipse::construct( ItemDocument *itemDocument, bool newItem, const cha LibraryItem* DPEllipse::libraryItem() { return new LibraryItem( - QString("dp/ellipse"), + TQString("dp/ellipse"), i18n("Ellipse"), i18n("Other"), KGlobal::iconLoader()->loadIcon( "text", KIcon::Small ), @@ -166,24 +166,24 @@ DPEllipse::~DPEllipse() void DPEllipse::postResize() { - QRect br = m_sizeRect; + TQRect br = m_sizeRect; // Make octagon that roughly covers ellipse - QPointArray pa(8); - pa[0] = QPoint( br.x() + br.width()/4, br.y() ); - pa[1] = QPoint( br.x() + 3*br.width()/4, br.y() ); - pa[2] = QPoint( br.x() + br.width(), br.y() + br.height()/4 ); - pa[3] = QPoint( br.x() + br.width(), br.y() + 3*br.height()/4 ); - pa[4] = QPoint( br.x() + 3*br.width()/4, br.y() + br.height() ); - pa[5] = QPoint( br.x() + br.width()/4, br.y() + br.height() ); - pa[6] = QPoint( br.x(), br.y() + 3*br.height()/4 ); - pa[7] = QPoint( br.x(), br.y() + br.height()/4 ); + TQPointArray pa(8); + pa[0] = TQPoint( br.x() + br.width()/4, br.y() ); + pa[1] = TQPoint( br.x() + 3*br.width()/4, br.y() ); + pa[2] = TQPoint( br.x() + br.width(), br.y() + br.height()/4 ); + pa[3] = TQPoint( br.x() + br.width(), br.y() + 3*br.height()/4 ); + pa[4] = TQPoint( br.x() + 3*br.width()/4, br.y() + br.height() ); + pa[5] = TQPoint( br.x() + br.width()/4, br.y() + br.height() ); + pa[6] = TQPoint( br.x(), br.y() + 3*br.height()/4 ); + pa[7] = TQPoint( br.x(), br.y() + br.height()/4 ); setItemPoints( pa, false ); } -void DPEllipse::drawShape( QPainter & p ) +void DPEllipse::drawShape( TQPainter & p ) { p.drawEllipse(drawRect()); } |