From 8f1624dd9a394be19ccf9d63e4de0a0558831ca3 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 20:31:54 +0000 Subject: 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 --- src/kprocessorview.cpp | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/kprocessorview.cpp') diff --git a/src/kprocessorview.cpp b/src/kprocessorview.cpp index f54469a..717bfa2 100755 --- a/src/kprocessorview.cpp +++ b/src/kprocessorview.cpp @@ -1,32 +1,32 @@ #include "kprocessorview.h" -#include -#include -#include -#include -#include -#include -#include - -MyListView::MyListView(QWidget *parent) : KListView(parent) +#include +#include +#include +#include +#include +#include +#include + +MyListView::MyListView(TQWidget *tqparent) : KListView(tqparent) { - connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), - SLOT( slotContextMenu( KListView *, QListViewItem *, const QPoint & ) ) ); + connect( this, TQT_SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), + TQT_SLOT( slotContextMenu( KListView *, TQListViewItem *, const TQPoint & ) ) ); } MyListView::~MyListView() { } -void MyListView::slotContextMenu( KListView *, QListViewItem *, const QPoint & ) +void MyListView::slotContextMenu( KListView *, TQListViewItem *, const TQPoint & ) { // mousePressEvent( NULL ) ; emit showPopupMenu() ; } /* -void MyListView::mousePressEvent( QMouseEvent * event ) +void MyListView::mousePressEvent( TQMouseEvent * event ) { - //QMessageBox::information( this, "information", "mouse pressed" ) ; + //TQMessageBox::information( this, "information", "mouse pressed" ) ; // if ( event->button() == RightButton ) emit showPopupMenu() ; @@ -35,15 +35,15 @@ void MyListView::mousePressEvent( QMouseEvent * event ) } */ -KProcessorView::KProcessorView(QWidget *parent, const char *name) - : KToolBar(parent) +KProcessorView::KProcessorView(TQWidget *tqparent, const char *name) + : KToolBar(tqparent) { name = name ; // avoid compiler warning view = new MyListView( this ) ; - connect( view, SIGNAL( itemRenamed( QListViewItem*) ), this, SLOT( slotItemRenamed(QListViewItem*) ) ) ; - connect( view, SIGNAL( showPopupMenu() ), this, SLOT( showPopupMenu() ) ) ; + connect( view, TQT_SIGNAL( itemRenamed( TQListViewItem*) ), this, TQT_SLOT( slotItemRenamed(TQListViewItem*) ) ) ; + connect( view, TQT_SIGNAL( showPopupMenu() ), this, TQT_SLOT( showPopupMenu() ) ) ; view->addColumn( "Register" ) ; view->addColumn( "Value" ) ; @@ -57,29 +57,29 @@ KProcessorView::KProcessorView(QWidget *parent, const char *name) int i ; char str[ 128 ] ; - QListViewItem *cpu = new QListViewItem( view ) ; + TQListViewItem *cpu = new TQListViewItem( view ) ; cpu->setText( 0, "CPU" ) ; - QListViewItem *flags = new QListViewItem( cpu ) ; + TQListViewItem *flags = new TQListViewItem( cpu ) ; flags->setText( 0, "Flags" ) ; - zeroFlag = new QListViewItem( flags ) ; + zeroFlag = new TQListViewItem( flags ) ; zeroFlag->setText( 0, "Zero" ) ; zeroFlag->setText( 1, "0" ) ; - carryFlag = new QListViewItem( flags ) ; + carryFlag = new TQListViewItem( flags ) ; carryFlag->setText( 0, "Carry" ) ; carryFlag->setText( 1, "0" ) ; - ieFlag = new QListViewItem( flags ) ; + ieFlag = new TQListViewItem( flags ) ; ieFlag->setText( 0, "IE" ) ; ieFlag->setText( 1, "0" ) ; - QListViewItem *reg = new QListViewItem( cpu ) ; + TQListViewItem *reg = new TQListViewItem( cpu ) ; reg->setText( 0, "Registers" ) ; for ( i = 0 ; i < 16 ; i++ ) { - regs[ i ] = new QListViewItem( reg ) ; + regs[ i ] = new TQListViewItem( reg ) ; sprintf( str, "s%X", i ) ; regs[ i ]->setText( 0, str ) ; regs[ i ]->setText( 1, "0" ) ; @@ -103,13 +103,13 @@ void KProcessorView::slotHexMode() void KProcessorView::showPopupMenu() { - QPopupMenu *menu = new QPopupMenu( this ) ; - menu->insertItem( "Hexadecimal", this, SLOT( slotHexMode() ), 0, 1 ) ; + TQPopupMenu *menu = new TQPopupMenu( this ) ; + menu->insertItem( "Hexadecimal", this, TQT_SLOT( slotHexMode() ), 0, 1 ) ; menu->setItemChecked( 1, m_bHexMode ) ; - menu->exec( QCursor::pos() ); + menu->exec( TQCursor::pos() ); } -void KProcessorView::slotItemRenamed( QListViewItem * item ) +void KProcessorView::slotItemRenamed( TQListViewItem * item ) { int i, value, base ; bool ok ; @@ -125,7 +125,7 @@ void KProcessorView::slotItemRenamed( QListViewItem * item ) value = item->text(1).toInt( &ok, base ) ; if ( !ok || value < 0 || value > 255 ) { - QMessageBox::warning( parentWidget(), "Modify register", "Value should be between 0-255" ) ; + TQMessageBox::warning( tqparentWidget(), "Modify register", "Value should be between 0-255" ) ; view->rename( item, 1 ) ; } else { emit processorRegsChanged() ; @@ -137,13 +137,13 @@ void KProcessorView::slotItemRenamed( QListViewItem * item ) if ( zeroFlag == item || carryFlag == item || ieFlag == item ) { value = item->text(1).toInt( &ok ) ; if ( !ok || value < 0 || value > 1 ) { - QMessageBox::warning( parentWidget(), "Modify flag", "Value should be between 0-1" ) ; + TQMessageBox::warning( tqparentWidget(), "Modify flag", "Value should be between 0-1" ) ; } else emit processorFlagsChanged() ; } } -void KProcessorView::resizeEvent( QResizeEvent *event ) +void KProcessorView::resizeEvent( TQResizeEvent *event ) { event = event ; // view->resize( width() - 10, height() - 10 ) ; @@ -169,7 +169,7 @@ void KProcessorView::setRegisterValues( unsigned char *values ) if ( m_bHexMode ) base = 16 ; else base = 10 ; - QString str; + TQString str; for ( i = 0 ; i < 16 ; i++ ) { str.setNum( values[ i ], base ) ; regs[ i ]->setText( 1, str ) ; -- cgit v1.2.1