summaryrefslogtreecommitdiffstats
path: root/src/electronics/components/parallelportcomponent.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/electronics/components/parallelportcomponent.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-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/parallelportcomponent.cpp')
-rw-r--r--src/electronics/components/parallelportcomponent.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/electronics/components/parallelportcomponent.cpp b/src/electronics/components/parallelportcomponent.cpp
index 9bc17b4..577253f 100644
--- a/src/electronics/components/parallelportcomponent.cpp
+++ b/src/electronics/components/parallelportcomponent.cpp
@@ -19,7 +19,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <cmath>
#include <termios.h>
@@ -51,7 +51,7 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
"<ul>"
"<li><b>D<i>[0..7]</i></b></li>"
"</ul><br>"
- "<b>Status Pins</b><br><br>"
+ "<b>tqStatus Pins</b><br><br>"
"The status pins are read-only. They area:"
"<ul>"
"<li><b>ERR</b> - Error</li>"
@@ -70,11 +70,11 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
"The remaining pins are all ground."
);
- QPointArray pa( 4 );
- pa[0] = QPoint( -32, -112 );
- pa[1] = QPoint( 32, -104 );
- pa[2] = QPoint( 32, 104 );
- pa[3] = QPoint( -32, 112 );
+ TQPointArray pa( 4 );
+ pa[0] = TQPoint( -32, -112 );
+ pa[1] = TQPoint( 32, -104 );
+ pa[2] = TQPoint( 32, 104 );
+ pa[3] = TQPoint( -32, 112 );
setItemPoints( pa );
m_pParallelPort = new ParallelPort();
@@ -87,11 +87,11 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
//BEGIN Data register
for ( int i = 0; i < 8; ++i )
{
- QString id = QString("D%1").arg(i);
- QString name = id;
+ TQString id = TQString("D%1").tqarg(i);
+ TQString name = id;
pin = createPin( -40, -80 + 16*i, 0, id );
- addDisplayText( id, QRect( -28, -88 + 16*i, 28, 16 ), name, true, Qt::AlignLeft | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( -28, -88 + 16*i, 28, 16 ), name, true, TQt::AlignLeft | TQt::AlignVCenter );
m_pLogic[i] = createLogicOut( pin, false );
m_pLogic[i]->setCallback( this, (CallbackPtr)(&ParallelPortComponent::dataCallback) );
@@ -99,62 +99,62 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
//END Data register
- //BEGIN Status register
- QString statusNames[] = { "ERR", "ON", "PE", "ACK", "BUSY" };
+ //BEGIN tqStatus register
+ TQString statusNames[] = { "ERR", "ON", "PE", "ACK", "BUSY" };
// The statusIDs are referenced in the save file and must not change
- QString statusIDs[] = { "ERROR", "ONLINE", "PE", "ACK", "BUSY" };
+ TQString statusIDs[] = { "ERROR", "ONLINE", "PE", "ACK", "BUSY" };
- // Bits 0...2 in the Status register are not used
+ // Bits 0...2 in the tqStatus register are not used
for ( int i = 3; i < 8; ++i )
{
- QString id = statusIDs[i-3];
- QString name = statusNames[i-3];
+ TQString id = statusIDs[i-3];
+ TQString name = statusNames[i-3];
// Bit 3 (pin 15) doesn't not follow the same positioning pattern as
- // the other pins in the Status register.
+ // the other pins in the tqStatus register.
if ( i == 3 )
{
pin = createPin( 40, -72, 180, id );
- addDisplayText( id, QRect( 0, -80, 28, 16 ), name, true, Qt::AlignRight | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( 0, -80, 28, 16 ), name, true, TQt::AlignRight | TQt::AlignVCenter );
}
else
{
pin = createPin( -40, -16 + 16*i, 0, id );
- addDisplayText( id, QRect( -28, -24 + 16*i, 28, 16 ), name, true, Qt::AlignLeft | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( -28, -24 + 16*i, 28, 16 ), name, true, TQt::AlignLeft | TQt::AlignVCenter );
}
m_pLogic[i+8] = createLogicOut( pin, false );
}
- //END Status register
+ //END tqStatus register
//BEGIN Control register
- QString controlNames[] = { "STR", "AUT", "INIT", "SEL" };
+ TQString controlNames[] = { "STR", "AUT", "INIT", "SEL" };
// The controlIDs are referenced in the save file and must not change
- QString controlIDs[] = { "STROBE", "AUTO", "INIT", "SELECT" };
+ TQString controlIDs[] = { "STROBE", "AUTO", "INIT", "SELECT" };
// Bits 4..7 are not used (well; bit 5 is, but not as a pin)
for ( int i = 0; i < 4; ++i )
{
- QString id = controlIDs[i];
- QString name = controlNames[i];
+ TQString id = controlIDs[i];
+ TQString name = controlNames[i];
if ( i == 0 )
{
pin = createPin( -40, -96, 0, id );
- addDisplayText( id, QRect( -28, -104, 28, 16 ), name, true, Qt::AlignLeft | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( -28, -104, 28, 16 ), name, true, TQt::AlignLeft | TQt::AlignVCenter );
}
else if ( i == 1 )
{
pin = createPin( 40, -88, 180, id );
- addDisplayText( id, QRect( 0, -96, 28, 16 ), name, true, Qt::AlignRight | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( 0, -96, 28, 16 ), name, true, TQt::AlignRight | TQt::AlignVCenter );
}
else
{
pin = createPin( 40, -88 + i*16, 180, id );
- addDisplayText( id, QRect( 0, -96 + i*16, 28, 16 ), name, true, Qt::AlignRight | Qt::AlignVCenter );
+ addDisplayText( id, TQRect( 0, -96 + i*16, 28, 16 ), name, true, TQt::AlignRight | TQt::AlignVCenter );
}
m_pLogic[i+16] = createLogicOut( pin, false );
@@ -167,7 +167,7 @@ ParallelPortComponent::ParallelPortComponent( ICNDocument *icnDocument, bool new
// And make the rest of the pins ground
for ( int i = 0; i < 8; ++i )
{
- pin = createPin( 40, -24 + i*16, 180, QString("GND%1").arg( i ) );
+ pin = createPin( 40, -24 + i*16, 180, TQString("GND%1").tqarg( i ) );
pin->pin()->setGroundType( Pin::gt_always );
}
#endif
@@ -190,7 +190,7 @@ void ParallelPortComponent::dataChanged()
}
-void ParallelPortComponent::initPort( const QString & port )
+void ParallelPortComponent::initPort( const TQString & port )
{
if ( port.isEmpty() )
{
@@ -200,7 +200,7 @@ void ParallelPortComponent::initPort( const QString & port )
if ( ! m_pParallelPort->openPort( port ) )
{
- p_itemDocument->canvas()->setMessage( i18n("Could not open port %1").arg( port ) );
+ p_itemDocument->canvas()->setMessage( i18n("Could not open port %1").tqarg( port ) );
return;
}
}
@@ -228,14 +228,14 @@ void ParallelPortComponent::controlCallback( bool )
void ParallelPortComponent::stepNonLogic()
{
- uchar status = m_pParallelPort->readFromRegister( ParallelPort::Status );
- // Bits 0...2 in the Status register are not used
+ uchar status = m_pParallelPort->readFromRegister( ParallelPort::tqStatus );
+ // Bits 0...2 in the tqStatus register are not used
for ( int i = 3; i < 8; ++i )
m_pLogic[i + 8]->setHigh( status | (1 << i) );
}
-void ParallelPortComponent::drawShape( QPainter & p )
+void ParallelPortComponent::drawShape( TQPainter & p )
{
drawPortShape( p );
}