diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /parts/valgrind/valgrind_widget.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/valgrind/valgrind_widget.cpp')
-rw-r--r-- | parts/valgrind/valgrind_widget.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/parts/valgrind/valgrind_widget.cpp b/parts/valgrind/valgrind_widget.cpp index 356d97bf..39c51094 100644 --- a/parts/valgrind/valgrind_widget.cpp +++ b/parts/valgrind/valgrind_widget.cpp @@ -1,6 +1,6 @@ -#include <qlayout.h> -#include <qpainter.h> -#include <qpopupmenu.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpopupmenu.h> #include <kparts/part.h> #include <klibloader.h> @@ -24,16 +24,16 @@ class ValListViewItem: public QListViewItem { public: - ValListViewItem( QListView* parent, int key, int pid, const QString& message ): - QListViewItem( parent, QString::number( key ), QString::number( pid ), message ), + ValListViewItem( TQListView* parent, int key, int pid, const TQString& message ): + TQListViewItem( parent, TQString::number( key ), TQString::number( pid ), message ), _key( key ), _pid ( pid ), backtrace( false ), _line( -1 ), _active( false ) {} - ValListViewItem( ValListViewItem* parent, int key, int pid, const QString& message, const QString& filename, int line, bool active ): - QListViewItem( parent, QString::number( key ), QString::null, message ), + ValListViewItem( ValListViewItem* parent, int key, int pid, const TQString& message, const TQString& filename, int line, bool active ): + TQListViewItem( parent, TQString::number( key ), TQString::null, message ), _key( key ), _pid( pid ), backtrace( true ), _filename( filename ), _line( line ), _active( active ) { if ( parent->_pid != _pid && _pid > 0 ) - setText( 1, QString::number( _pid ) ); + setText( 1, TQString::number( _pid ) ); } virtual ~ValListViewItem(); @@ -48,39 +48,39 @@ public: return 0; } - int compare( QListViewItem* i, int col, bool ascending ) const + int compare( TQListViewItem* i, int col, bool ascending ) const { if ( !i || i->rtti() != VALLISTVIEWITEMRTTI ) - return QListViewItem::compare( i, col, ascending ); + return TQListViewItem::compare( i, col, ascending ); switch ( col ) { case 0 : return intCompare( ((ValListViewItem*)i)->_key, _key ); case 1 : return intCompare( ((ValListViewItem*)i)->_pid, _pid ); - default: return QListViewItem::compare( i, col, ascending ); + default: return TQListViewItem::compare( i, col, ascending ); } } - void paintCell( QPainter* p, const QColorGroup& cg, int column, int width, int align ) + void paintCell( TQPainter* p, const TQColorGroup& cg, int column, int width, int align ) { if ( _active ) { - QFont fnt = p->font(); + TQFont fnt = p->font(); fnt.setBold( true ); p->setFont( fnt ); } - QListViewItem::paintCell( p, cg, column, width, align ); + TQListViewItem::paintCell( p, cg, column, width, align ); } int rtti() const { return VALLISTVIEWITEMRTTI; } - QString fileName() const { return _filename; } + TQString fileName() const { return _filename; } int line() const { return _line; } - QString message() const { return text( 2 ); } + TQString message() const { return text( 2 ); } bool isHighlighted() const { return _active; } private: int _key; int _pid; bool backtrace; - QString _filename; + TQString _filename; int _line; bool _active; }; @@ -88,9 +88,9 @@ private: ValListViewItem::~ValListViewItem() {} ValgrindWidget::ValgrindWidget( ValgrindPart *part ) - : QWidget(0, "valgrind widget"), _part( part ) + : TQWidget(0, "valgrind widget"), _part( part ) { - QVBoxLayout* vbl = new QVBoxLayout( this ); + TQVBoxLayout* vbl = new TQVBoxLayout( this ); lv = new KListView( this ); lv->addColumn( i18n( "No." ) ); lv->addColumn( i18n( "Thread" ) ); @@ -100,18 +100,18 @@ ValgrindWidget::ValgrindWidget( ValgrindPart *part ) lv->setAllColumnsShowFocus( true ); vbl->addWidget( lv ); - popup = new QPopupMenu( lv, "valPopup" ); - popup->insertItem( i18n( "&Open Valgrind Output..." ), _part, SLOT(loadOutput()), 0, 0 ); + popup = new TQPopupMenu( lv, "valPopup" ); + popup->insertItem( i18n( "&Open Valgrind Output..." ), _part, TQT_SLOT(loadOutput()), 0, 0 ); popup->insertSeparator(); - popup->insertItem( i18n( "Expand All Items" ), this, SLOT(expandAll()), 0, 2 ); - popup->insertItem( i18n( "Collapse All Items" ), this, SLOT(collapseAll()), 0, 3 ); - - connect( popup, SIGNAL(aboutToShow()), - this, SLOT(aboutToShowPopup()) ); - connect( lv, SIGNAL(executed(QListViewItem*)), - this, SLOT(executed(QListViewItem*)) ); - connect( lv, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) ); + popup->insertItem( i18n( "Expand All Items" ), this, TQT_SLOT(expandAll()), 0, 2 ); + popup->insertItem( i18n( "Collapse All Items" ), this, TQT_SLOT(collapseAll()), 0, 3 ); + + connect( popup, TQT_SIGNAL(aboutToShow()), + this, TQT_SLOT(aboutToShowPopup()) ); + connect( lv, TQT_SIGNAL(executed(TQListViewItem*)), + this, TQT_SLOT(executed(TQListViewItem*)) ); + connect( lv, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)) ); } @@ -127,8 +127,8 @@ void ValgrindWidget::clear() void ValgrindWidget::addMessage( const ValgrindItem& vi ) { - QStringList projectFiles; - QString projectDirectory; + TQStringList projectFiles; + TQString projectDirectory; ValListViewItem* lvi = new ValListViewItem( lv, msgNumber++, vi.pid(), vi.message() ); lvi->setMultiLinesEnabled( true ); @@ -142,7 +142,7 @@ void ValgrindWidget::addMessage( const ValgrindItem& vi ) } } -void ValgrindWidget::executed( QListViewItem* lvi ) +void ValgrindWidget::executed( TQListViewItem* lvi ) { Q_ASSERT( _part ); Q_ASSERT( _part->partController() ); @@ -155,7 +155,7 @@ void ValgrindWidget::executed( QListViewItem* lvi ) vli = (ValListViewItem*)lvi; } else if ( lvi->isExpandable() ) { // find the memleak position - QListViewItemIterator it( lv ); + TQListViewItemIterator it( lv ); while ( vli == 0 && it.current() ) { if ( it.current()->rtti() == VALLISTVIEWITEMRTTI && ((ValListViewItem*)it.current())->isHighlighted() ) vli = (ValListViewItem*)it.current(); @@ -171,7 +171,7 @@ void ValgrindWidget::executed( QListViewItem* lvi ) void ValgrindWidget::expandAll() { - QListViewItem* child = lv->firstChild(); + TQListViewItem* child = lv->firstChild(); while ( child ) { child->setOpen( true ); child = child->nextSibling(); @@ -180,7 +180,7 @@ void ValgrindWidget::expandAll() void ValgrindWidget::collapseAll() { - QListViewItem* child = lv->firstChild(); + TQListViewItem* child = lv->firstChild(); while ( child ) { child->setOpen( false ); child = child->nextSibling(); @@ -194,7 +194,7 @@ void ValgrindWidget::aboutToShowPopup() popup->setItemEnabled( 3, en ); } -void ValgrindWidget::slotContextMenu( KListView* l, QListViewItem* /*i*/, const QPoint& p ) +void ValgrindWidget::slotContextMenu( KListView* l, TQListViewItem* /*i*/, const TQPoint& p ) { if ( l != lv ) return; |