From 99a2774ca6f1cab334de5d43fe36fc44ae889a4c Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 12 Jun 2011 01:36:19 +0000 Subject: TQt4 convert kdesdk This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kspy/classinfoview.cpp | 8 +++---- kspy/classinfoview.h | 3 ++- kspy/kspy.h | 2 +- kspy/navview.cpp | 12 +++++----- kspy/navview.h | 3 ++- kspy/navviewitem.cpp | 8 +++---- kspy/navviewitem.h | 4 ++-- kspy/propsview.cpp | 59 +++++++++++++++++++++++++++----------------------- kspy/propsview.h | 3 ++- kspy/receiversview.cpp | 14 ++++++------ kspy/receiversview.h | 5 +++-- kspy/sigslotview.cpp | 4 ++-- kspy/sigslotview.h | 3 ++- kspy/spy.cpp | 28 ++++++++++++------------ kspy/spy.h | 7 +++--- 15 files changed, 87 insertions(+), 76 deletions(-) (limited to 'kspy') diff --git a/kspy/classinfoview.cpp b/kspy/classinfoview.cpp index b8b12167..02de2773 100644 --- a/kspy/classinfoview.cpp +++ b/kspy/classinfoview.cpp @@ -25,7 +25,7 @@ #include "classinfoview.h" -ClassInfoView::ClassInfoView(TQWidget *parent, const char *name ) : KListView(parent,name) +ClassInfoView::ClassInfoView(TQWidget *tqparent, const char *name ) : KListView(tqparent,name) { addColumn( i18n( "Name" ) ); addColumn( i18n( "Value" ) ); @@ -41,11 +41,11 @@ ClassInfoView::~ClassInfoView() void ClassInfoView::buildList( TQObject *o ) { - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); for (int index = 0; index < mo->numClassInfo(true); index++) { - const QClassInfo * classInfo = mo->classInfo(index, true); - new KListViewItem( this, classInfo->name, classInfo->value ); + const TQClassInfo * classInfo = mo->classInfo(index, true); + new KListViewItem( this, classInfo->tqt_mo_ci_name, classInfo->tqt_mo_ci_value ); } } diff --git a/kspy/classinfoview.h b/kspy/classinfoview.h index eca9e719..0526cc35 100644 --- a/kspy/classinfoview.h +++ b/kspy/classinfoview.h @@ -27,8 +27,9 @@ class ClassInfoView : public KListView { Q_OBJECT + TQ_OBJECT public: - ClassInfoView(TQWidget *parent=0, const char *name=0); + ClassInfoView(TQWidget *tqparent=0, const char *name=0); ~ClassInfoView(); void buildList( TQObject *o ); diff --git a/kspy/kspy.h b/kspy/kspy.h index 007c0d10..e6b79618 100644 --- a/kspy/kspy.h +++ b/kspy/kspy.h @@ -8,7 +8,7 @@ /** * Loader for the TQObject debugging tool. The usage is simple, just call * KSpy::invoke(), then use the spy window to examine the state of your - * QObjects. + * TQObjects. * * @author Richard Moore, rich@kde.org * @version $Id$ diff --git a/kspy/navview.cpp b/kspy/navview.cpp index 338922d5..388e6bb5 100644 --- a/kspy/navview.cpp +++ b/kspy/navview.cpp @@ -23,7 +23,7 @@ #include "navview.h" #include "navviewitem.h" -NavView::NavView(TQWidget *parent, const char *name ) : KListView(parent,name) +NavView::NavView(TQWidget *tqparent, const char *name ) : KListView(tqparent,name) { addColumn( i18n( "Name" ) ); addColumn( i18n( "Type" ) ); @@ -70,17 +70,17 @@ void NavView::selectItem( TQListViewItem *item ) emit selected( navItem->data ); } -void NavView::createSubTree( NavViewItem *parent ) +void NavView::createSubTree( NavViewItem *tqparent ) { - const TQObjectList *kids = parent->data->children(); - if ( !kids ) + const TQObjectList kids = tqparent->data->childrenListObject(); + if ( kids.isEmpty() ) return; TQObject * obj; - TQObjectListIt it( *kids ); + TQObjectListIt it( kids ); while ( (obj=it.current()) != 0 ) { ++it; - NavViewItem *item = new NavViewItem( parent, obj ); + NavViewItem *item = new NavViewItem( tqparent, obj ); createSubTree( item ); } } diff --git a/kspy/navview.h b/kspy/navview.h index 947c3572..29ebf842 100644 --- a/kspy/navview.h +++ b/kspy/navview.h @@ -29,9 +29,10 @@ class NavViewItem; class NavView : public KListView { Q_OBJECT + TQ_OBJECT public: - NavView( TQWidget *parent = 0, const char *name = 0 ); + NavView( TQWidget *tqparent = 0, const char *name = 0 ); ~NavView(); /** diff --git a/kspy/navviewitem.cpp b/kspy/navviewitem.cpp index 641332ac..596ba7ed 100644 --- a/kspy/navviewitem.cpp +++ b/kspy/navviewitem.cpp @@ -20,15 +20,15 @@ #include "navview.h" #include "navviewitem.h" -NavViewItem::NavViewItem(NavView *parent, TQObject *obj ) - : KListViewItem(parent, obj->name(), obj->className() ) +NavViewItem::NavViewItem(NavView *tqparent, TQObject *obj ) + : KListViewItem(tqparent, obj->name(), obj->className() ) { data = obj; setExpandable( true ); } -NavViewItem::NavViewItem(NavViewItem *parent, TQObject *obj ) - : KListViewItem(parent, obj->name(), obj->className() ) +NavViewItem::NavViewItem(NavViewItem *tqparent, TQObject *obj ) + : KListViewItem(tqparent, obj->name(), obj->className() ) { data = obj; setExpandable( true ); diff --git a/kspy/navviewitem.h b/kspy/navviewitem.h index d9b7ba23..a6c0e888 100644 --- a/kspy/navviewitem.h +++ b/kspy/navviewitem.h @@ -28,8 +28,8 @@ class NavView; class NavViewItem : public KListViewItem { public: - NavViewItem(NavView *parent, TQObject *item ); - NavViewItem(NavViewItem *parent, TQObject *item ); + NavViewItem(NavView *tqparent, TQObject *item ); + NavViewItem(NavViewItem *tqparent, TQObject *item ); ~NavViewItem(); TQObject *data; diff --git a/kspy/propsview.cpp b/kspy/propsview.cpp index 50f60bed..a59903d5 100644 --- a/kspy/propsview.cpp +++ b/kspy/propsview.cpp @@ -29,26 +29,26 @@ class KSpyItem : KListViewItem { public: - KSpyItem( TQListView * parent, TQString label1, TQString label2 = TQString::null, TQString label3 = TQString::null, TQString label4 = TQString::null, TQString label5 = TQString::null, TQString label6 = TQString::null ) - : KListViewItem(parent, label1, label2, label3, label4, label5, label6) + KSpyItem( TQListView * tqparent, TQString label1, TQString label2 = TQString(), TQString label3 = TQString(), TQString label4 = TQString(), TQString label5 = TQString(), TQString label6 = TQString() ) + : KListViewItem(tqparent, label1, label2, label3, label4, label5, label6) { } protected: void paintCell( TQPainter * p, const TQColorGroup & cg, - int column, int width, int alignment ) + int column, int width, int tqalignment ) { if (column == 1 && text(2) == "TQColor") { TQColorGroup color_cg( cg.foreground(), cg.background(), cg.light(), cg.dark(), cg.mid(), TQColor(text(1)), TQColor(text(1)) ); - TQListViewItem::paintCell(p, color_cg, column, width, alignment); + TQListViewItem::paintCell(p, color_cg, column, width, tqalignment); } else { - KListViewItem::paintCell(p, cg, column, width, alignment); + KListViewItem::paintCell(p, cg, column, width, tqalignment); } } }; -PropsView::PropsView(TQWidget *parent, const char *name ) : KListView(parent,name) +PropsView::PropsView(TQWidget *tqparent, const char *name ) : KListView(tqparent,name) { addColumn( i18n( "Name" ) ); addColumn( i18n( "Value" ) ); @@ -69,13 +69,13 @@ PropsView::~PropsView() void PropsView::buildList( TQObject *o ) { - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); TQStrList names = mo->propertyNames( true ); for ( uint i = 0; i < names.count(); i++ ) { char *prop = names.at( i ); TQVariant v = o->property( prop ); - const TQMetaProperty *mp = mo->property( mo->findProperty(prop, true), true ); + const TQMetaProperty *mp = mo->property( mo->tqfindProperty(prop, true), true ); TQString val( "????" ); switch( v.type() ) { @@ -95,55 +95,60 @@ void PropsView::buildList( TQObject *o ) case TQVariant::Cursor: { TQCursor c = v.toCursor(); - val = TQString("shape=%1").arg(c.shape()); + val = TQString("tqshape=%1").tqarg(c.tqshape()); break; } case TQVariant::Font: { TQFont f = v.toFont(); val = TQString("family=%1, pointSize=%2, weight=%3, italic=%4, bold=%5, underline=%6, strikeOut=%7") - .arg(f.family()) - .arg(f.pointSize()) - .arg(f.weight()) - .arg(f.italic()) - .arg(f.bold()) - .arg(f.underline()) - .arg(f.strikeOut()); + .tqarg(f.family()) + .tqarg(f.pointSize()) + .tqarg(f.weight()) + .tqarg(f.italic()) + .tqarg(f.bold()) + .tqarg(f.underline()) + .tqarg(f.strikeOut()); break; } case TQVariant::Int: val.setNum( v.toInt() ); if (mp->isEnumType()) { - TQMetaObject * metaObject = *(mp->meta); - val = TQString("%1::%2").arg(metaObject->className()).arg(mp->valueToKey(val.toInt())); +#ifdef USE_QT4 +// TQMetaObject * tqmetaObject = *(mp->meta); // FIXME + val = TQString("%1::%2").tqarg("QT4_CANNOT_FIND_TQMETAOBJECT_FOR_TQMETAPROPERTY").tqarg(mp->valueToKey(val.toInt())); // FIXME +#else // USE_QT4 + TQMetaObject * tqmetaObject = *(mp->meta); + val = TQString("%1::%2").tqarg(tqmetaObject->className()).tqarg(mp->valueToKey(val.toInt())); +#endif // USE_QT4 } break; case TQVariant::Point: { TQPoint p = v.toPoint(); - val = TQString("x=%1, y=%2").arg(p.x()).arg(p.y()); + val = TQString("x=%1, y=%2").tqarg(p.x()).tqarg(p.y()); break; } case TQVariant::Rect: { TQRect r = v.toRect(); val = TQString("left=%1, right=%2, top=%3, bottom=%4") - .arg(r.left()) - .arg(r.right()) - .arg(r.top()) - .arg(r.bottom()); + .tqarg(r.left()) + .tqarg(r.right()) + .tqarg(r.top()) + .tqarg(r.bottom()); break; } case TQVariant::Size: { TQSize s = v.toSize(); - val = TQString("width=%1, height=%2").arg(s.width()).arg(s.height()); + val = TQString("width=%1, height=%2").tqarg(s.width()).tqarg(s.height()); break; } case TQVariant::SizePolicy: { TQSizePolicy s = v.toSizePolicy(); - val = TQString("horData=%1, verData=%2").arg(s.horData()).arg(s.verData()); + val = TQString("horData=%1, verData=%2").tqarg(s.horData()).tqarg(s.verData()); break; } case TQVariant::Double: @@ -161,8 +166,8 @@ void PropsView::buildList( TQObject *o ) TQString no("No"); TQString writable = ( mp->writable() ? rw : ro ); - TQString setType = ( mp->isSetType() ? st : TQString::null ); - TQString enumType = ( mp->isEnumType() ? et : TQString::null ); + TQString setType = ( mp->isSetType() ? st : TQString() ); + TQString enumType = ( mp->isEnumType() ? et : TQString() ); TQString designable = ( mp->designable(o) ? yes : no ); TQString flags; diff --git a/kspy/propsview.h b/kspy/propsview.h index 3d0afe80..6cc1285d 100644 --- a/kspy/propsview.h +++ b/kspy/propsview.h @@ -27,8 +27,9 @@ class PropsView : public KListView { Q_OBJECT + TQ_OBJECT public: - PropsView(TQWidget *parent=0, const char *name=0); + PropsView(TQWidget *tqparent=0, const char *name=0); ~PropsView(); void buildList( TQObject *o ); diff --git a/kspy/receiversview.cpp b/kspy/receiversview.cpp index 36582640..2b04303a 100644 --- a/kspy/receiversview.cpp +++ b/kspy/receiversview.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - receiversview.cpp - description + tqreceiversview.cpp - description ------------------- begin : Tue Jan 11 2005 copyright : (C) 2005 by Richard Dale @@ -26,12 +26,12 @@ #include "receiversview.h" -class UnencapsulatedQObject : public TQObject { +class UnencapsulatedTQObject : public TQObject { public: - TQConnectionList *public_receivers(int signal) const { return receivers(signal); } + TQConnectionList *public_tqreceivers(int signal) const { return tqreceivers(signal); } }; -ReceiversView::ReceiversView(TQWidget *parent, const char *name ) : KListView(parent,name) +ReceiversView::ReceiversView(TQWidget *tqparent, const char *name ) : KListView(tqparent,name) { addColumn( i18n( "Object" ) ); addColumn( i18n( "Type" ) ); @@ -48,13 +48,13 @@ ReceiversView::~ReceiversView() void ReceiversView::buildList( TQObject *o ) { - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); - UnencapsulatedQObject * qobject = (UnencapsulatedQObject *) o; + UnencapsulatedTQObject * qobject = (UnencapsulatedTQObject *) o; TQStrList signalNames = mo->signalNames(true); for (int sig = 0; sig < mo->numSignals(true); sig++) { - TQConnectionList * clist = qobject->public_receivers(sig); + TQConnectionList * clist = qobject->public_tqreceivers(sig); if (clist != 0) { KListViewItem *conn = new KListViewItem( this, signalNames.at(sig) ); diff --git a/kspy/receiversview.h b/kspy/receiversview.h index b654687a..07a18188 100644 --- a/kspy/receiversview.h +++ b/kspy/receiversview.h @@ -1,5 +1,5 @@ /*************************************************************************** - receiversview.h - description + tqreceiversview.h - description ------------------- begin : Tue Jan 11 2005 copyright : (C) 2005 by Richard Dale @@ -27,8 +27,9 @@ class ReceiversView : public KListView { Q_OBJECT + TQ_OBJECT public: - ReceiversView(TQWidget *parent=0, const char *name=0); + ReceiversView(TQWidget *tqparent=0, const char *name=0); ~ReceiversView(); void buildList( TQObject *o ); diff --git a/kspy/sigslotview.cpp b/kspy/sigslotview.cpp index d6fdba24..98400ed7 100644 --- a/kspy/sigslotview.cpp +++ b/kspy/sigslotview.cpp @@ -25,7 +25,7 @@ #include "sigslotview.h" -SigSlotView::SigSlotView(TQWidget *parent, const char *name ) : KListView(parent,name) +SigSlotView::SigSlotView(TQWidget *tqparent, const char *name ) : KListView(tqparent,name) { addColumn( i18n( "Signals/Slots" ) ); @@ -40,7 +40,7 @@ SigSlotView::~SigSlotView() void SigSlotView::buildList( TQObject *o ) { - TQMetaObject *mo = o->metaObject(); + TQMetaObject *mo = o->tqmetaObject(); KListViewItem *sigs = new KListViewItem( this, "Signals" ); TQStrList sigList = mo->signalNames( true ); diff --git a/kspy/sigslotview.h b/kspy/sigslotview.h index 723069cc..a1184771 100644 --- a/kspy/sigslotview.h +++ b/kspy/sigslotview.h @@ -27,8 +27,9 @@ class SigSlotView : public KListView { Q_OBJECT + TQ_OBJECT public: - SigSlotView(TQWidget *parent=0, const char *name=0); + SigSlotView(TQWidget *tqparent=0, const char *name=0); ~SigSlotView(); void buildList( TQObject *o ); diff --git a/kspy/spy.cpp b/kspy/spy.cpp index 3aa18be4..6607e484 100644 --- a/kspy/spy.cpp +++ b/kspy/spy.cpp @@ -44,13 +44,13 @@ extern "C" } } -Spy::Spy( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +Spy::Spy( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { - TQVBoxLayout *layout = new TQVBoxLayout( this, 11, 6 ); + TQVBoxLayout *tqlayout = new TQVBoxLayout( this, 11, 6 ); TQSplitter *div = new TQSplitter( this ); - layout->addWidget( div ); + tqlayout->addWidget( div ); TQVBox *leftPane = new TQVBox( div ); @@ -66,7 +66,7 @@ Spy::Spy( TQWidget *parent, const char *name ) mSigSlotView = new SigSlotView( tabs, "signals and slots view" ); tabs->addTab( mSigSlotView, i18n( "Signals && Slots" ) ); - mReceiversView = new ReceiversView( tabs, "receivers view" ); + mReceiversView = new ReceiversView( tabs, "tqreceivers view" ); tabs->addTab( mReceiversView, i18n( "Receivers" ) ); mClassInfoView = new ClassInfoView( tabs, "class info view" ); @@ -92,21 +92,21 @@ Spy::~Spy() void Spy::setTarget( TQWidget *target ) { mTarget = target; - mPropsView->buildList( mTarget ); - mSigSlotView->buildList( mTarget ); - mReceiversView->buildList( mTarget ); - mClassInfoView->buildList( mTarget ); + mPropsView->buildList( TQT_TQOBJECT(mTarget) ); + mSigSlotView->buildList( TQT_TQOBJECT(mTarget) ); + mReceiversView->buildList( TQT_TQOBJECT(mTarget) ); + mClassInfoView->buildList( TQT_TQOBJECT(mTarget) ); } void Spy::keyPressEvent( TQKeyEvent *event ) { - if ( event->key() == Qt::Key_Up ) { + if ( event->key() == TQt::Key_Up ) { event->accept(); - TQApplication::postEvent( mNavView, new TQKeyEvent( TQEvent::KeyPress, Qt::Key_Up, 0, 0 ) ); - } else if ( event->key() == Qt::Key_Down ) { + TQApplication::postEvent( mNavView, new TQKeyEvent( TQEvent::KeyPress, TQt::Key_Up, 0, 0 ) ); + } else if ( event->key() == TQt::Key_Down ) { event->accept(); - TQApplication::postEvent( mNavView, new TQKeyEvent( TQEvent::KeyPress, Qt::Key_Down, 0, 0 ) ); - } else if ( event->key() == Qt::Key_Return ) { + TQApplication::postEvent( mNavView, new TQKeyEvent( TQEvent::KeyPress, TQt::Key_Down, 0, 0 ) ); + } else if ( event->key() == TQt::Key_Return ) { event->accept(); mNavView->expandVisibleTree(); } diff --git a/kspy/spy.h b/kspy/spy.h index 09f68ac4..f3f313b9 100644 --- a/kspy/spy.h +++ b/kspy/spy.h @@ -34,12 +34,13 @@ class ClassInfoView; /** Spy is the main window class of the project. */ -class Spy : public QWidget +class Spy : public TQWidget { - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: - Spy( TQWidget *parent = 0, const char *name = 0 ); + Spy( TQWidget *tqparent = 0, const char *name = 0 ); ~Spy(); void setTarget( TQWidget *target ); -- cgit v1.2.1