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/electronics/components/dependentsource.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/electronics/components/dependentsource.cpp')
-rw-r--r-- | src/electronics/components/dependentsource.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/electronics/components/dependentsource.cpp b/src/electronics/components/dependentsource.cpp index 764cc53..1808c86 100644 --- a/src/electronics/components/dependentsource.cpp +++ b/src/electronics/components/dependentsource.cpp @@ -19,7 +19,7 @@ #include "vcvs.h" #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> //BEGIN class DependentSource DependentSource::DependentSource( ICNDocument *icnDocument, bool newItem, const char *id ) @@ -34,7 +34,7 @@ DependentSource::DependentSource( ICNDocument *icnDocument, bool newItem, const property("gain")->setCaption( i18n("Gain") ); property("gain")->setValue(1.0); - addDisplayText( "gain", QRect( -16, -32, 32, 16 ), "" ); + addDisplayText( "gain", TQRect( -16, -32, 32, 16 ), "" ); } @@ -43,7 +43,7 @@ DependentSource::~DependentSource() } -void DependentSource::drawOutline( QPainter & p ) +void DependentSource::drawOutline( TQPainter & p ) { const int _x = (int)x()-16; const int _y = (int)y()-32; @@ -52,67 +52,67 @@ void DependentSource::drawOutline( QPainter & p ) p.drawRect( _x, _y+19, width(), 11 ); p.save(); - bool canSetCol = (p.pen().color() != Qt::color0) && (p.pen().color() != Qt::color1); + bool canSetCol = (p.pen().color() != TQt::color0) && (p.pen().color() != TQt::color1); // Bottom lines if (canSetCol) - p.setPen( m_pNNode[1]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( m_pNNode[1]->isSelected() ? m_selectedCol : TQt::black ); p.drawLine( _x, _y+40, _x+8, _y+40 ); // Left inny if (canSetCol) - p.setPen( m_pPNode[1]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( m_pPNode[1]->isSelected() ? m_selectedCol : TQt::black ); p.drawLine( _x+width(), _y+40, _x+24, _y+40 ); // Right inny p.restore(); // Bottom diamond - QPointArray pa4(4); - pa4[0] = QPoint( _x+6, _y+40 ); - pa4[1] = QPoint( _x+16, _y+32 ); - pa4[2] = QPoint( _x+26, _y+40 ); - pa4[3] = QPoint( _x+16, _y+48 ); + TQPointArray pa4(4); + pa4[0] = TQPoint( _x+6, _y+40 ); + pa4[1] = TQPoint( _x+16, _y+32 ); + pa4[2] = TQPoint( _x+26, _y+40 ); + pa4[3] = TQPoint( _x+16, _y+48 ); p.drawPolygon(pa4); } -void DependentSource::drawTopArrow( QPainter & p ) +void DependentSource::drawTopArrow( TQPainter & p ) { const int _x = (int)x()-16; const int _y = (int)y()-32; if ( p.pen().color() == m_selectedCol ) - p.setPen(Qt::black); + p.setPen(TQt::black); if ( p.brush().color() == m_brushCol ) - p.setBrush(Qt::black); + p.setBrush(TQt::black); p.drawLine( _x+8, _y+24, _x+24, _y+24 ); - QPointArray pa3(3); - pa3[0] = QPoint( _x+24, _y+24 ); - pa3[1] = QPoint( _x+19, _y+21 ); - pa3[2] = QPoint( _x+19, _y+27 ); + TQPointArray pa3(3); + pa3[0] = TQPoint( _x+24, _y+24 ); + pa3[1] = TQPoint( _x+19, _y+21 ); + pa3[2] = TQPoint( _x+19, _y+27 ); p.drawPolygon(pa3); } -void DependentSource::drawBottomArrow( QPainter & p ) +void DependentSource::drawBottomArrow( TQPainter & p ) { const int _x = (int)x()-16; const int _y = (int)y()-32; if ( p.pen().color() == m_selectedCol ) - p.setPen(Qt::black); + p.setPen(TQt::black); if ( p.brush().color() == m_brushCol ) - p.setBrush(Qt::black); + p.setBrush(TQt::black); p.drawLine( _x+11, _y+40, _x+21, _y+40 ); - QPointArray pa3(3); - pa3[0] = QPoint( _x+21, _y+40 ); - pa3[1] = QPoint( _x+16, _y+37 ); - pa3[2] = QPoint( _x+16, _y+43 ); + TQPointArray pa3(3); + pa3[0] = TQPoint( _x+21, _y+40 ); + pa3[1] = TQPoint( _x+16, _y+37 ); + pa3[2] = TQPoint( _x+16, _y+43 ); p.drawPolygon(pa3); } //END class DependentSource @@ -127,7 +127,7 @@ Item* ECCCCS::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECCCCS::libraryItem() { return new LibraryItem( - QString("ec/cccs"), + TQString("ec/cccs"), i18n("CCCS"), i18n("Sources"), "cccs.png", @@ -151,13 +151,13 @@ void ECCCCS::dataChanged() { double gain = dataDouble("gain"); - QString display = QString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + QChar(' '); + TQString display = TQString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + TQChar(' '); setDisplayText( "gain", display ); m_cccs->setGain(gain); } -void ECCCCS::drawShape( QPainter &p ) +void ECCCCS::drawShape( TQPainter &p ) { initPainter(p); drawOutline(p); @@ -177,7 +177,7 @@ Item* ECCCVS::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECCCVS::libraryItem() { return new LibraryItem( - QString("ec/ccvs"), + TQString("ec/ccvs"), i18n("CCVS"), i18n("Sources"), "ccvs.png", @@ -201,13 +201,13 @@ void ECCCVS::dataChanged() { double gain = dataDouble("gain"); - QString display = QString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + QChar(' '); + TQString display = TQString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + TQChar(' '); setDisplayText( "gain", display ); m_ccvs->setGain(gain); } -void ECCCVS::drawShape( QPainter &p ) +void ECCCVS::drawShape( TQPainter &p ) { initPainter(p); drawOutline(p); @@ -226,7 +226,7 @@ Item* ECVCCS::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECVCCS::libraryItem() { return new LibraryItem( - QString("ec/vccs"), + TQString("ec/vccs"), i18n("VCCS"), i18n("Sources"), "vccs.png", @@ -250,13 +250,13 @@ void ECVCCS::dataChanged() { double gain = dataDouble("gain"); - QString display = QString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + QChar(' '); + TQString display = TQString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + TQChar(' '); setDisplayText( "gain", display ); m_vccs->setGain(gain); } -void ECVCCS::drawShape( QPainter &p ) +void ECVCCS::drawShape( TQPainter &p ) { initPainter(p); drawOutline(p); @@ -275,7 +275,7 @@ Item* ECVCVS::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECVCVS::libraryItem() { return new LibraryItem( - QString("ec/vcvs"), + TQString("ec/vcvs"), i18n("VCVS"), i18n("Sources"), "vcvs.png", @@ -299,13 +299,13 @@ void ECVCVS::dataChanged() { double gain = dataDouble("gain"); - QString display = QString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + QChar(' '); + TQString display = TQString::number( gain / getMultiplier(gain), 'g', 3 ) + getNumberMag(gain) + TQChar(' '); setDisplayText( "gain", display ); m_vcvs->setGain(gain); } -void ECVCVS::drawShape( QPainter &p ) +void ECVCVS::drawShape( TQPainter &p ) { initPainter(p); drawOutline(p); |