From f7e71d47719ab6094cf4a9fafffa5ea351973522 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 13 Jan 2011 08:32:36 +0000 Subject: Initial conversion for TQt for Qt4 3.4.0 TP2 This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdecore/kgenericfactory.tcc | 110 ++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'kdecore/kgenericfactory.tcc') diff --git a/kdecore/kgenericfactory.tcc b/kdecore/kgenericfactory.tcc index 41cd77824..22fbd7371 100644 --- a/kdecore/kgenericfactory.tcc +++ b/kdecore/kgenericfactory.tcc @@ -37,7 +37,7 @@ #ifndef KGENERICFACTORY_TCC #define KGENERICFACTORY_TCC -#include +#include #include namespace KParts @@ -69,11 +69,11 @@ namespace KDEPrivate */ template - struct QWidgetInheritanceTest + struct TQWidgetInheritanceTest { typedef Derived * DerivedPtr; - enum { Result = sizeof( InheritanceDetector::test( DerivedPtr() ) ) == - sizeof( InheritanceDetector::ConversionExists ) }; + enum { Result = sizeof( InheritanceDetector::test( DerivedPtr() ) ) == + sizeof( InheritanceDetector::ConversionExists ) }; }; template @@ -112,43 +112,43 @@ namespace KDEPrivate // but not least the standard default constructor of parent/name . // the choice of the right constructor is done using an ordered inheritance // test. - template + template class ConcreteFactory { public: typedef typename If< PartInheritanceTest< Product >::Result, KParts::Part, - typename If< QWidgetInheritanceTest< Product >::Result, - QWidget, QObject >::Result >::Result BaseType; + typename If< TQWidgetInheritanceTest< Product >::Result, + TQWidget, TQObject >::Result >::Result BaseType; - static inline Product *create( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, const QStringList &args ) + static inline Product *create( TQWidget *tqparentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, const TQStringList &args ) { - QMetaObject *metaObject = Product::staticMetaObject(); - while ( metaObject ) + TQMetaObject *tqmetaObject = Product::tqstaticMetaObject(); + while ( tqmetaObject ) { - if ( !qstrcmp( className, metaObject->className() ) ) - return create( parentWidget, widgetName, + if ( !qstrcmp( className, tqmetaObject->className() ) ) + return create( tqparentWidget, widgetName, parent, name, args, Type2Type() ); - metaObject = metaObject->superClass(); + tqmetaObject = tqmetaObject->tqsuperClass(); } return 0; } private: - typedef typename If< QWidgetInheritanceTest::Result, - ParentType, QWidget >::Result WidgetParentType; + typedef typename If< TQWidgetInheritanceTest::Result, + ParentType, TQWidget >::Result WidgetParentType; - static inline Product *create( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const QStringList &args, Type2Type ) + static inline Product *create( TQWidget *tqparentWidget, const char *widgetName, + TQObject *parent, const char *name, + const TQStringList &args, Type2Type ) { - return new Product( parentWidget, widgetName, parent, name, args ); + return new Product( tqparentWidget, widgetName, parent, name, args ); } - static inline Product *create( QWidget* /*parentWidget*/, const char* /*widgetName*/, - QObject *parent, const char *name, - const QStringList &args, Type2Type ) + static inline Product *create( TQWidget* /*tqparentWidget*/, const char* /*widgetName*/, + TQObject *parent, const char *name, + const TQStringList &args, Type2Type ) { WidgetParentType *p = dynamic_cast( parent ); @@ -157,9 +157,9 @@ namespace KDEPrivate return new Product( p, name, args ); } - static inline Product *create( QWidget* /*parentWidget*/, const char* /*widgetName*/, - QObject *parent, const char *name, - const QStringList &args, Type2Type ) + static inline Product *create( TQWidget* /*tqparentWidget*/, const char* /*widgetName*/, + TQObject *parent, const char *name, + const TQStringList &args, Type2Type ) { ParentType *p = dynamic_cast( parent ); if ( parent && !p ) @@ -171,16 +171,16 @@ namespace KDEPrivate // this template is used to iterate through the typelist and call the // concrete factory for each type. the specializations of this template // are the ones actually being responsible for iterating, in fact. - template + template class MultiFactory { public: - inline static QObject *create( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, - const QStringList &args ) + inline static TQObject *create( TQWidget *tqparentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, + const TQStringList &args ) { - return ConcreteFactory::create( parentWidget, widgetName, + return ConcreteFactory::create( tqparentWidget, widgetName, parent, name, className, args ); } @@ -193,9 +193,9 @@ namespace KDEPrivate class MultiFactory { public: - inline static QObject *create( QWidget *, const char *, QObject *, - const char *, const char *, - const QStringList & ) + inline static TQObject *create( TQWidget *, const char *, TQObject *, + const char *, const char *, + const TQStringList & ) { return 0; } }; @@ -205,29 +205,29 @@ namespace KDEPrivate class MultiFactory { public: - inline static QObject *create( QWidget *, const char *, QObject *, - const char *, const char *, - const QStringList & ) + inline static TQObject *create( TQWidget *, const char *, TQObject *, + const char *, const char *, + const TQStringList & ) { return 0; } }; template - class MultiFactory< KTypeList, QObject > + class MultiFactory< KTypeList, TQObject > { public: - inline static QObject *create( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, - const QStringList &args ) + inline static TQObject *create( TQWidget *tqparentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, + const TQStringList &args ) { // try with the head of the typelist first. the head is always // a concrete type. - QObject *object = MultiFactory::create( parentWidget, widgetName, - parent, name, className, - args ); + TQObject *object = MultiFactory::create( tqparentWidget, widgetName, + parent, name, className, + args ); if ( !object ) - object = MultiFactory::create( parentWidget, widgetName, + object = MultiFactory::create( tqparentWidget, widgetName, parent, name, className, args ); @@ -241,15 +241,15 @@ namespace KDEPrivate KTypeList > { public: - inline static QObject *create( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, - const QStringList &args ) + inline static TQObject *create( TQWidget *tqparentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, + const TQStringList &args ) { // try with the head of the typelist first. the head is always // a concrete type. - QObject *object = MultiFactory - ::create( parentWidget, widgetName, + TQObject *object = MultiFactory + ::create( tqparentWidget, widgetName, parent, name, className, args ); // if that failed continue by advancing the typelist, calling this @@ -257,7 +257,7 @@ namespace KDEPrivate // at the end we reach the nulltype specialization. if ( !object ) object = MultiFactory - ::create( parentWidget, widgetName, + ::create( tqparentWidget, widgetName, parent, name, className, args ); return object; -- cgit v1.2.1