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/ecsignallamp.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/ecsignallamp.cpp')
-rw-r--r-- | src/electronics/components/ecsignallamp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/electronics/components/ecsignallamp.cpp b/src/electronics/components/ecsignallamp.cpp index c7034f7..0a25c39 100644 --- a/src/electronics/components/ecsignallamp.cpp +++ b/src/electronics/components/ecsignallamp.cpp @@ -16,7 +16,7 @@ #include "pin.h" #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> Item* ECSignalLamp::construct( ItemDocument *itemDocument, bool newItem, const char *id ) { @@ -26,7 +26,7 @@ Item* ECSignalLamp::construct( ItemDocument *itemDocument, bool newItem, const c LibraryItem* ECSignalLamp::libraryItem() { return new LibraryItem( - QString("ec/signal_lamp"), + TQString("ec/signal_lamp"), i18n("Signal Lamp"), i18n("Outputs"), "signal_lamp.png", @@ -58,10 +58,10 @@ ECSignalLamp::~ECSignalLamp() void ECSignalLamp::stepNonLogic() { const double voltage = m_pPNode[0]->pin()->voltage()-m_pNNode[0]->pin()->voltage(); - avgPower = QABS(avgPower*advanceSinceUpdate + (voltage*voltage/100))/++advanceSinceUpdate; + avgPower = TQABS(avgPower*advanceSinceUpdate + (voltage*voltage/100))/++advanceSinceUpdate; } -void ECSignalLamp::drawShape( QPainter &p ) +void ECSignalLamp::drawShape( TQPainter &p ) { initPainter(p); @@ -73,7 +73,7 @@ void ECSignalLamp::drawShape( QPainter &p ) int brightness = (avgPower<0.025) ? 255 : ((avgPower>0.5) ? 0 : (int)(255*(1-((avgPower-0.025)/0.475)))); advanceSinceUpdate = 0; - p.setBrush( QColor( 255, 255, brightness ) ); + p.setBrush( TQColor( 255, 255, brightness ) ); p.drawEllipse( _x-8, _y-8, 16, 16 ); // 2*sqrt(2) = 2.828427125... |