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/flipflop.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/flipflop.cpp')
-rw-r--r-- | src/electronics/components/flipflop.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/electronics/components/flipflop.cpp b/src/electronics/components/flipflop.cpp index 5c55baf..69d983d 100644 --- a/src/electronics/components/flipflop.cpp +++ b/src/electronics/components/flipflop.cpp @@ -17,7 +17,7 @@ #include <kiconloader.h> #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> //BEGIN class ECDFlipFlop @@ -57,17 +57,17 @@ ECDFlipFlop::ECDFlipFlop( ICNDocument *icnDocument, bool newItem, const char *id m_pD = createLogicIn( m_pNNode[0] ); m_pClock = createLogicIn( m_pNNode[1] ); m_pQ = createLogicOut( m_pPNode[0], false ); - m_pQBar = createLogicOut( m_pPNode[1], false ); + m_pTQBar = createLogicOut( m_pPNode[1], false ); setp = createLogicIn( createPin( 0, -32, 90, "set" ) ); rstp = createLogicIn( createPin( 0, 32, 270, "rst" ) ); - addDisplayText( "D", QRect( -32, -16, 20, 16 ), "D" ); - addDisplayText( ">", QRect( -32, 0, 20, 16 ), ">" ); - addDisplayText( "Q", QRect( 12, -16, 20, 16 ), "Q" ); - addDisplayText( "Q'", QRect( 12, 0, 20, 16 ), "Q'" ); - addDisplayText( "Set", QRect( -16, -20, 32, 16 ), "Set" ); - addDisplayText( "Rst", QRect( -16, 4, 32, 16 ), "Rst" ); + addDisplayText( "D", TQRect( -32, -16, 20, 16 ), "D" ); + addDisplayText( ">", TQRect( -32, 0, 20, 16 ), ">" ); + addDisplayText( "Q", TQRect( 12, -16, 20, 16 ), "Q" ); + addDisplayText( "Q'", TQRect( 12, 0, 20, 16 ), "Q'" ); + addDisplayText( "Set", TQRect( -16, -20, 32, 16 ), "Set" ); + addDisplayText( "Rst", TQRect( -16, 4, 32, 16 ), "Rst" ); m_pD->setCallback( this, (CallbackPtr)(&ECDFlipFlop::inputChanged) ); m_pClock->setCallback( this, (CallbackPtr)(&ECDFlipFlop::clockChanged) ); @@ -88,7 +88,7 @@ void ECDFlipFlop::asyncChanged(bool) if(set || rst) { m_pQ->setHigh(set); - m_pQBar->setHigh(rst); + m_pTQBar->setHigh(rst); } } @@ -119,7 +119,7 @@ void ECDFlipFlop::clockChanged( bool newState ) bool d = ( simTime == m_prevDSimTime ) ? m_prevD[1-m_whichPrevD] : m_prevD[m_whichPrevD]; m_pQ->setHigh(d); - m_pQBar->setHigh(!d); + m_pTQBar->setHigh(!d); } } @@ -127,7 +127,7 @@ void ECDFlipFlop::inStateChanged(bool) { // Only called when the flipflop is created. m_pQ->setHigh(false); - m_pQBar->setHigh(true); + m_pTQBar->setHigh(true); } //END class ECDFlipFlop @@ -141,7 +141,7 @@ Item* ECJKFlipFlop::construct( ItemDocument *itemDocument, bool newItem, const c LibraryItem* ECJKFlipFlop::libraryItem() { return new LibraryItem( - QString::QString("ec/jk_flipflop"), + TQString::TQString("ec/jk_flipflop"), i18n("JK Flip-Flop"), i18n("Integrated Circuits"), "ic3.png", @@ -165,18 +165,18 @@ ECJKFlipFlop::ECJKFlipFlop( ICNDocument *icnDocument, bool newItem, const char * m_pK = createLogicIn( m_pNNode[2] ); m_pQ = createLogicOut( m_pPNode[0], false ); - m_pQBar = createLogicOut( m_pPNode[1], false ); + m_pTQBar = createLogicOut( m_pPNode[1], false ); setp = createLogicIn( createPin( 0, -40, 90, "set" ) ); rstp = createLogicIn( createPin( 0, 40, 270, "rst" ) ); - addDisplayText( "J", QRect( -32, -24, 20, 16 ), "J" ); - addDisplayText( ">", QRect( -32, -8, 20, 16 ), ">" ); - addDisplayText( "K", QRect( -32, 8, 20, 16 ), "K" ); - addDisplayText( "Q", QRect( 12, -24, 20, 16 ), "Q" ); - addDisplayText( "Q'", QRect( 12, 8, 20, 16 ), "Q'" ); - addDisplayText( "Set", QRect( -16, -28, 32, 16 ), "Set" ); - addDisplayText( "Rst", QRect( -16, 12, 32, 16 ), "Rst" ); + addDisplayText( "J", TQRect( -32, -24, 20, 16 ), "J" ); + addDisplayText( ">", TQRect( -32, -8, 20, 16 ), ">" ); + addDisplayText( "K", TQRect( -32, 8, 20, 16 ), "K" ); + addDisplayText( "Q", TQRect( 12, -24, 20, 16 ), "Q" ); + addDisplayText( "Q'", TQRect( 12, 8, 20, 16 ), "Q'" ); + addDisplayText( "Set", TQRect( -16, -28, 32, 16 ), "Set" ); + addDisplayText( "Rst", TQRect( -16, 12, 32, 16 ), "Rst" ); m_pClock->setCallback( this, (CallbackPtr)(&ECJKFlipFlop::clockChanged) ); setp->setCallback( this, (CallbackPtr)(&ECJKFlipFlop::asyncChanged) ); @@ -202,12 +202,12 @@ void ECJKFlipFlop::clockChanged(bool newvalue) if (!newvalue && (j || k)) { if ( j && k ) { m_pQ->setHigh(!prev_state); - m_pQBar->setHigh(prev_state); + m_pTQBar->setHigh(prev_state); prev_state = !prev_state; } else { // (J=1 && K=0) || (J=0 && K=1) m_pQ->setHigh(j); - m_pQBar->setHigh(k); + m_pTQBar->setHigh(k); prev_state = j; } } @@ -220,14 +220,14 @@ void ECJKFlipFlop::asyncChanged(bool) if (set || rst) { m_pQ->setHigh(set); - m_pQBar->setHigh(rst); + m_pTQBar->setHigh(rst); prev_state = set; } } void ECJKFlipFlop::inStateChanged(bool) { - m_pQBar->setHigh(true); + m_pTQBar->setHigh(true); m_pQ->setHigh(false); prev_state = false; } @@ -243,7 +243,7 @@ Item* ECSRFlipFlop::construct( ItemDocument *itemDocument, bool newItem, const c LibraryItem* ECSRFlipFlop::libraryItem() { return new LibraryItem( - QString::QString("ec/sr_flipflop"), + TQString::TQString("ec/sr_flipflop"), i18n("SR Flip-Flop"), i18n("Integrated Circuits"), "ic3.png", @@ -265,22 +265,22 @@ ECSRFlipFlop::ECSRFlipFlop( ICNDocument *icnDocument, bool newItem, const char * m_pS = createLogicIn( m_pNNode[0] ); m_pR = createLogicIn( m_pNNode[1] ); m_pQ = createLogicOut( m_pPNode[0], true ); - m_pQBar = createLogicOut( m_pPNode[1], false ); + m_pTQBar = createLogicOut( m_pPNode[1], false ); old_q1 = true; old_q2 = false; m_pQ->setHigh(old_q1); - m_pQBar->setHigh(old_q2); + m_pTQBar->setHigh(old_q2); - addDisplayText( "S", QRect( -24, -16, 20, 16 ), "S" ); - addDisplayText( "R", QRect( -24, 0, 20, 16 ), "R" ); - addDisplayText( "Q", QRect( 4, -16, 20, 16 ), "Q" ); - addDisplayText( "Q'", QRect( 4, 0, 20, 16 ), "Q'" ); + addDisplayText( "S", TQRect( -24, -16, 20, 16 ), "S" ); + addDisplayText( "R", TQRect( -24, 0, 20, 16 ), "R" ); + addDisplayText( "Q", TQRect( 4, -16, 20, 16 ), "Q" ); + addDisplayText( "Q'", TQRect( 4, 0, 20, 16 ), "Q'" ); m_pS->setCallback( this, (CallbackPtr)(&ECSRFlipFlop::inStateChanged) ); m_pR->setCallback( this, (CallbackPtr)(&ECSRFlipFlop::inStateChanged) ); m_pQ->setCallback( this, (CallbackPtr)(&ECSRFlipFlop::inStateChanged) ); - m_pQBar->setCallback( this, (CallbackPtr)(&ECSRFlipFlop::inStateChanged) ); + m_pTQBar->setCallback( this, (CallbackPtr)(&ECSRFlipFlop::inStateChanged) ); } ECSRFlipFlop::~ECSRFlipFlop() @@ -296,7 +296,7 @@ void ECSRFlipFlop::inStateChanged(bool) bool s = m_pS->isHigh(); bool r = m_pR->isHigh(); bool q1 = m_pQ->isHigh(); - bool q2 = m_pQBar->isHigh(); + bool q2 = m_pTQBar->isHigh(); // Easy ones to do :-) if (!q1) new_q2 = true; @@ -342,6 +342,6 @@ void ECSRFlipFlop::inStateChanged(bool) old_q2 = new_q2; m_pQ->setHigh(new_q1); - m_pQBar->setHigh(new_q2); + m_pTQBar->setHigh(new_q2); } //END class ECSRFlipFlop |