summaryrefslogtreecommitdiffstats
path: root/src/kserialview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 20:31:54 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 20:31:54 +0000
commit8f1624dd9a394be19ccf9d63e4de0a0558831ca3 (patch)
tree21ca6a6c0f51a294752e693bb883120ababb6062 /src/kserialview.cpp
parentff1242765ed5cce09ca185f874de5b05b08e109f (diff)
downloadkpicosim-8f1624dd9a394be19ccf9d63e4de0a0558831ca3.tar.gz
kpicosim-8f1624dd9a394be19ccf9d63e4de0a0558831ca3.zip
TQt4 port kpicosim
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpicosim@1238884 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kserialview.cpp')
-rwxr-xr-xsrc/kserialview.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/kserialview.cpp b/src/kserialview.cpp
index 6ce0457..2239c2b 100755
--- a/src/kserialview.cpp
+++ b/src/kserialview.cpp
@@ -18,12 +18,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "kserialview.h"
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qframe.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqframe.h>
-KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent )
+KSerialView::KSerialView( CPicoBlaze *cpu, TQWidget * tqparent ) : TQWidget( tqparent )
{
m_cpu = cpu ;
@@ -37,29 +37,29 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
statusPort->setMode( PortReadable ) ;
view = new KSerialWindow( this ) ;
- QWidget *settings = new QWidget( this ) ;
+ TQWidget *settings = new TQWidget( this ) ;
settings->setMinimumSize( 90, 90 ) ;
- QVBoxLayout *layout = new QVBoxLayout( this ) ;
- layout->addWidget( view ) ;
- layout->addWidget( settings ) ;
+ TQVBoxLayout *tqlayout = new TQVBoxLayout( this ) ;
+ tqlayout->addWidget( view ) ;
+ tqlayout->addWidget( settings ) ;
- QGroupBox *groupBox = new QGroupBox( "Serial Settings", settings ) ;
+ TQGroupBox *groupBox = new TQGroupBox( "Serial Settings", settings ) ;
groupBox->setFixedSize( 200, 80 ) ;
groupBox->move( 10, 0 ) ;
- QLabel *label = new QLabel( groupBox ) ;
+ TQLabel *label = new TQLabel( groupBox ) ;
label->setText( "Transmit" ) ;
label->move( 5, 15 ) ;
label->setFixedSize( 55, 18 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "Receive" ) ;
label->move( 5, 35 ) ;
label->setFixedSize( 55, 18 ) ;
- label = new QLabel( groupBox ) ;
- label->setText( "Status" ) ;
+ label = new TQLabel( groupBox ) ;
+ label->setText( "tqStatus" ) ;
label->move( 5, 55 ) ;
label->setFixedSize( 55, 18 ) ;
@@ -79,56 +79,56 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
statusPortID->setFixedSize( 40, 18 ) ;
statusPort->setReadValue( 0 ) ; // Buffers are empty, nothing received.
- connect( txPort, SIGNAL( write( unsigned char ) ), this, SLOT( transmit( unsigned char ) ) ) ;
- connect( rxPort, SIGNAL( read() ), this, SLOT( receive() ) ) ;
- connect( view, SIGNAL( keyPressed( int ) ), this, SLOT( keyPressed( int ) ) ) ;
+ connect( txPort, TQT_SIGNAL( write( unsigned char ) ), this, TQT_SLOT( transmit( unsigned char ) ) ) ;
+ connect( rxPort, TQT_SIGNAL( read() ), this, TQT_SLOT( receive() ) ) ;
+ connect( view, TQT_SIGNAL( keyPressed( int ) ), this, TQT_SLOT( keyPressed( int ) ) ) ;
- connect( txPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateTxId( const QString & ) ) ) ;
- connect( rxPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateRxId( const QString & ) ) ) ;
- connect( statusPortID, SIGNAL( textChanged( const QString & ) ), this, SLOT( updateStatusId( const QString & ) ) ) ;
+ connect( txPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateTxId( const TQString & ) ) ) ;
+ connect( rxPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateRxId( const TQString & ) ) ) ;
+ connect( statusPortID, TQT_SIGNAL( textChanged( const TQString & ) ), this, TQT_SLOT( updateStatusId( const TQString & ) ) ) ;
- groupBox = new QGroupBox( "Status Register", settings ) ;
+ groupBox = new TQGroupBox( "tqStatus Register", settings ) ;
groupBox->setFixedSize( 200, 80 ) ;
groupBox->move( 250, 0 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "RX" ) ;
label->move( 106, 15 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "TX" ) ;
label->move( 168, 15 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "DR" ) ;
label->move( 80, 30 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "F" ) ;
label->move( 110, 30 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "HF" ) ;
label->move( 130, 30 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "F" ) ;
label->move( 160, 30 ) ;
label->setFixedSize( 20, 20 ) ;
- label = new QLabel( groupBox ) ;
+ label = new TQLabel( groupBox ) ;
label->setText( "HF" ) ;
label->move( 179, 30 ) ;
label->setFixedSize( 20, 20 ) ;
int i ;
for ( i = 0 ; i < 8 ; i++ ) {
- m_statusBits[ i ] = new QCheckBox( groupBox ) ;
+ m_statusBits[ i ] = new TQCheckBox( groupBox ) ;
m_statusBits[ i ]->move( 5 + i * 25, 50 ) ;
m_statusBits[ i ]->setFixedSize( 15, 20 ) ;
}
@@ -137,20 +137,20 @@ KSerialView::KSerialView( CPicoBlaze *cpu, QWidget * parent ) : QWidget( parent
m_statusBits[ i ]->setEnabled( false ) ;
}
- QFrame *frame = new QFrame( groupBox ) ;
- frame->setFrameRect( QRect( 0, 0, 1, 50 ) ) ;
- frame->setFrameShape( QFrame::VLine ) ;
+ TQFrame *frame = new TQFrame( groupBox ) ;
+ frame->setFrameRect( TQRect( 0, 0, 1, 50 ) ) ;
+ frame->setFrameShape( TQFrame::VLine ) ;
frame->move( 73, 20 ) ;
frame->setFixedSize( 1, 50 ) ;
- frame = new QFrame( groupBox ) ;
- frame->setFrameRect( QRect( 0, 0, 1, 50 ) ) ;
- frame->setFrameShape( QFrame::VLine ) ;
+ frame = new TQFrame( groupBox ) ;
+ frame->setFrameRect( TQRect( 0, 0, 1, 50 ) ) ;
+ frame->setFrameShape( TQFrame::VLine ) ;
frame->move( 149, 20 ) ;
frame->setFixedSize( 1, 50 ) ;
- connect( m_statusBits[ 6 ], SIGNAL( toggled( bool ) ), this, SLOT( txFlagsChanged( bool ) ) ) ;
- connect( m_statusBits[ 7 ], SIGNAL( toggled( bool ) ), this, SLOT( txFlagsChanged( bool ) ) ) ;
+ connect( m_statusBits[ 6 ], TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( txFlagsChanged( bool ) ) ) ;
+ connect( m_statusBits[ 7 ], TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( txFlagsChanged( bool ) ) ) ;
fifoPtr = 0 ;
@@ -174,18 +174,18 @@ KSerialView::~KSerialView()
delete view ;
}
-void KSerialView::updateTxId( const QString & str )
+void KSerialView::updateTxId( const TQString & str )
{
bool ok ;
int val ;
- QString s ;
+ TQString s ;
val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) {
txPortID->setBackgroundColor( m_backgroundColor ) ;
txPort->setID( val ) ;
} else {
- txPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ;
+ txPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
}
@@ -196,18 +196,18 @@ void KSerialView::updateTxId( const QString & str )
*/
}
-void KSerialView::updateRxId( const QString & str )
+void KSerialView::updateRxId( const TQString & str )
{
bool ok ;
int val ;
- QString s ;
+ TQString s ;
val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) {
rxPortID->setBackgroundColor( m_backgroundColor ) ;
rxPort->setID( val ) ;
} else {
- rxPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ;
+ rxPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
}
/*else {
@@ -217,18 +217,18 @@ void KSerialView::updateRxId( const QString & str )
*/
}
-void KSerialView::updateStatusId( const QString & str )
+void KSerialView::updateStatusId( const TQString & str )
{
bool ok ;
int val ;
- QString s ;
+ TQString s ;
val = str.toInt( &ok ) ;
if ( ok && val >= 0 && val <= 255 ) {
statusPort->setID( val ) ;
statusPortID->setBackgroundColor( m_backgroundColor ) ;
} else {
- statusPortID->setBackgroundColor( QColor( 255, 128, 128 ) ) ;
+ statusPortID->setBackgroundColor( TQColor( 255, 128, 128 ) ) ;
}
/*else {
s.sprintf( "%u", statusPort->getID() ) ;
@@ -243,9 +243,9 @@ void KSerialView::transmit( unsigned char b )
b = '\n' ;
if ( b == 0x08 ) { // Backspace
- view->doKeyboardAction( QTextEdit::ActionBackspace ) ;
+ view->doKeyboardAction( TQTextEdit::ActionBackspace ) ;
} else {
- QString str ;
+ TQString str ;
view->insert( (str+=b) ) ;
}
}