diff options
Diffstat (limited to 'src/electronics/components/multiinputgate.cpp')
-rw-r--r-- | src/electronics/components/multiinputgate.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/electronics/components/multiinputgate.cpp b/src/electronics/components/multiinputgate.cpp index 7453845..6b76bde 100644 --- a/src/electronics/components/multiinputgate.cpp +++ b/src/electronics/components/multiinputgate.cpp @@ -16,7 +16,7 @@ #include <cmath> #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> //BEGIN class MultiInputGate MultiInputGate::MultiInputGate( ICNDocument *icnDocument, bool newItem, const char *id, int baseWidth ) @@ -58,7 +58,7 @@ MultiInputGate::~MultiInputGate() void MultiInputGate::dataChanged() { - updateInputs( QMIN( maxGateInput, dataInt("numInput") ) ); + updateInputs( TQMIN( maxGateInput, dataInt("numInput") ) ); } @@ -84,7 +84,7 @@ void MultiInputGate::updateInputs( int newNum ) { for ( int i = m_numInputs; i<newNum; ++i ) { - ECNode *node = createPin( 0, 0, 0, "in"+QString::number(i) ); + ECNode *node = createPin( 0, 0, 0, "in"+TQString::number(i) ); inNode[i] = node; inLogic[i] = createLogicIn(node); inLogic[i]->setCallback( this, (CallbackPtr)(&MultiInputGate::inStateChanged) ); @@ -94,7 +94,7 @@ void MultiInputGate::updateInputs( int newNum ) { for ( int i=newNum; i<m_numInputs; ++i ) { - removeNode("in"+QString::number(i)); + removeNode("in"+TQString::number(i)); removeElement( inLogic[i], false ); inNode[i] = 0l; inLogic[i] = 0l; @@ -114,7 +114,7 @@ void MultiInputGate::updateInputs( int newNum ) void MultiInputGate::updateAttachedPositioning() { // Check that our ndoes have been created before we attempt to use them - if ( !m_nodeMap.contains("p1") || !m_nodeMap.contains("in"+QString::number(m_numInputs-1)) ) + if ( !m_nodeMap.tqcontains("p1") || !m_nodeMap.tqcontains("in"+TQString::number(m_numInputs-1)) ) return; int _x = offsetX()+8; @@ -125,8 +125,8 @@ void MultiInputGate::updateAttachedPositioning() for ( int i=0; i< m_numInputs; ++i ) { - m_nodeMap["in"+QString::number(i)].x = _x - 16; - m_nodeMap["in"+QString::number(i)].y = _y + 16*i; + m_nodeMap["in"+TQString::number(i)].x = _x - 16; + m_nodeMap["in"+TQString::number(i)].y = _y + 16*i; } if (b_doneInit) @@ -144,7 +144,7 @@ Item* ECXnor::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECXnor::libraryItem() { return new LibraryItem( - QString::QString("ec/xnor"), + TQString::TQString("ec/xnor"), i18n("XNOR gate"), i18n("Logic"), "xnor.png", @@ -177,14 +177,14 @@ void ECXnor::inStateChanged(bool) m_pOut->setHigh( highCount != 1 ); } -void ECXnor::drawShape( QPainter &p ) +void ECXnor::drawShape( TQPainter &p ) { initPainter(p); int _x = (int)x()+offsetX(); int _y = (int)y()+offsetY(); p.save(); - p.setPen( Qt::NoPen ); + p.setPen( TQt::NoPen ); p.drawChord( _x-width()+22, _y, 2*width()-28, height(), -16*81, 16*162 ); p.restore(); @@ -197,7 +197,7 @@ void ECXnor::drawShape( QPainter &p ) const int n = m_numInputs; for ( int i=0; i<n; ++i ) { - p.setPen( inNode[i]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( inNode[i]->isSelected() ? m_selectedCol : TQt::black ); int pin_x = (int)std::sqrt((double)(64*n*n - (8*n-8-16*i)*(8*n-8-16*i)))/n; p.drawLine( _x, _y+16*i+8, _x+pin_x, _y+16*i+8 ); } @@ -216,7 +216,7 @@ Item* ECXor::construct( ItemDocument *itemDocument, bool newItem, const char *id LibraryItem* ECXor::libraryItem() { return new LibraryItem( - QString::QString("ec/xor"), + TQString::TQString("ec/xor"), i18n("XOR gate"), i18n("Logic"), "xor.png", @@ -249,14 +249,14 @@ void ECXor::inStateChanged(bool) m_pOut->setHigh( highCount == 1 ); } -void ECXor::drawShape( QPainter &p ) +void ECXor::drawShape( TQPainter &p ) { initPainter(p); int _x = (int)x()+offsetX(); int _y = (int)y()+offsetY(); p.save(); - p.setPen( Qt::NoPen ); + p.setPen( TQt::NoPen ); p.drawChord( _x-width()+16, _y, 2*width()-16, height(), -16*81, 16*162 ); p.restore(); @@ -267,7 +267,7 @@ void ECXor::drawShape( QPainter &p ) const int n = m_numInputs; for ( int i=0; i<n; ++i ) { - p.setPen( inNode[i]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( inNode[i]->isSelected() ? m_selectedCol : TQt::black ); int pin_x = (int)std::sqrt((double)(64*n*n - (8*n-8-16*i)*(8*n-8-16*i)))/n; p.drawLine( _x, _y+16*i+8, _x+pin_x, _y+16*i+8 ); } @@ -286,7 +286,7 @@ Item* ECOr::construct( ItemDocument *itemDocument, bool newItem, const char *id LibraryItem* ECOr::libraryItem() { return new LibraryItem( - QString::QString("ec/or"), + TQString::TQString("ec/or"), i18n("OR gate"), i18n("Logic"), "or.png", @@ -319,15 +319,15 @@ void ECOr::inStateChanged(bool) m_pOut->setHigh(!allLow); } -void ECOr::drawShape( QPainter &p ) +void ECOr::drawShape( TQPainter &p ) { initPainter(p); int _x = (int)x()+offsetX(); int _y = (int)y()+offsetY(); p.save(); - p.setPen( Qt::NoPen ); -// p.setBrush( Qt::red ); + p.setPen( TQt::NoPen ); +// p.setBrush( TQt::red ); p.drawChord( _x-width(), _y, 2*width(), height(), -16*81, 16*162 ); // p.drawPie( _x-width()+16, _y, 2*width()-16, height(), -16*100, 16*200 ); p.restore(); @@ -338,7 +338,7 @@ void ECOr::drawShape( QPainter &p ) const int n = m_numInputs; for ( int i=0; i<n; ++i ) { - p.setPen( inNode[i]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( inNode[i]->isSelected() ? m_selectedCol : TQt::black ); int pin_x = (int)std::sqrt((double)(64*n*n - (8*n-8-16*i)*(8*n-8-16*i)))/n; p.drawLine( _x, _y+16*i+8, _x+pin_x, _y+16*i+8 ); } @@ -357,7 +357,7 @@ Item* ECNor::construct( ItemDocument *itemDocument, bool newItem, const char *id LibraryItem* ECNor::libraryItem() { return new LibraryItem( - QString::QString("ec/nor"), + TQString::TQString("ec/nor"), i18n("NOR gate"), i18n("Logic"), "nor.png", @@ -390,14 +390,14 @@ void ECNor::inStateChanged(bool) m_pOut->setHigh(allLow); } -void ECNor::drawShape( QPainter &p ) +void ECNor::drawShape( TQPainter &p ) { initPainter(p); int _x = (int)x()+offsetX(); int _y = (int)y()+offsetY(); p.save(); - p.setPen( Qt::NoPen ); + p.setPen( TQt::NoPen ); p.drawChord( _x-width()+6, _y, 2*width()-12, height(), -16*81, 16*162 ); p.restore(); @@ -409,7 +409,7 @@ void ECNor::drawShape( QPainter &p ) const int n = m_numInputs; for ( int i=0; i<n; ++i ) { - p.setPen( inNode[i]->isSelected() ? m_selectedCol : Qt::black ); + p.setPen( inNode[i]->isSelected() ? m_selectedCol : TQt::black ); int pin_x = (int)std::sqrt((double)(64*n*n - (8*n-8-16*i)*(8*n-8-16*i)))/n; p.drawLine( _x, _y+16*i+8, _x+pin_x, _y+16*i+8 ); } @@ -428,7 +428,7 @@ Item* ECNand::construct( ItemDocument *itemDocument, bool newItem, const char *i LibraryItem* ECNand::libraryItem() { return new LibraryItem( - QString::QString("ec/nand"), + TQString::TQString("ec/nand"), i18n("NAND gate"), i18n("Logic"), "nand.png", @@ -461,7 +461,7 @@ void ECNand::inStateChanged(bool) m_pOut->setHigh(!allHigh); } -void ECNand::drawShape( QPainter &p ) +void ECNand::drawShape( TQPainter &p ) { initPainter(p); int _x = (int)x()+offsetX(); @@ -481,7 +481,7 @@ Item* ECAnd::construct( ItemDocument *itemDocument, bool newItem, const char *id LibraryItem* ECAnd::libraryItem() { - QStringList idList; + TQStringList idList; idList << "ec/and" << "ec/and_2"; return new LibraryItem( idList, @@ -517,7 +517,7 @@ void ECAnd::inStateChanged(bool) m_pOut->setHigh(allHigh); } -void ECAnd::drawShape( QPainter &p ) +void ECAnd::drawShape( TQPainter &p ) { initPainter(p); |