From a794ba9d8418882f88a1aff1968987d7994f3a7a Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 2 Jan 2011 00:09:25 +0000 Subject: [PATCH] Revert changes since revision 1210400 TQt for Qt4 compatibility project is temporarily on hold It appears a separate version of Qt3 (i.e. patches for the unmaintained Qt3 source) may be required to make the interface work properly. This is because tqchildren is needed in Qt3. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/tqtinterface@1210736 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- qtinterface/Makefile.am | 6 +- qtinterface/tqobject.cpp | 39 +------- qtinterface/tqobject.h | 25 +---- qtinterface/tqobjectlist.h | 52 +--------- qtinterface/tqt.h | 195 ++----------------------------------- 5 files changed, 16 insertions(+), 301 deletions(-) diff --git a/qtinterface/Makefile.am b/qtinterface/Makefile.am index ec90129..14bc973 100644 --- a/qtinterface/Makefile.am +++ b/qtinterface/Makefile.am @@ -142,11 +142,11 @@ include ../admin/Doxyfile.am if USE_QT3 QT_VER_REPLACE = s/QT_VER=X/QT_VER=3/g -QT_HVER_REPLACE = 25s/USE_QTX/USE_QT3/g +QT_HVER_REPLACE = s/USE_QTX/USE_QT3/g endif if USE_QT4 QT_VER_REPLACE = s/QT_VER=X/QT_VER=4/g -QT_HVER_REPLACE = 25s/USE_QTX/USE_QT4/g +QT_HVER_REPLACE = s/USE_QTX/USE_QT4/g endif install-exec-local: @@ -164,4 +164,4 @@ install-exec-local: sed -i '$(QT_VER_REPLACE)' "$(DESTDIR)$(bindir)/tqt-replace" sed -i '$(QT_VER_REPLACE)' "$(DESTDIR)$(bindir)/tqt-replace-stream" sed -i '$(QT_HVER_REPLACE)' "$(srcdir)/tqt.h" - cp -Rp "$(srcdir)/tqt4/" "$(DESTDIR)$(includedir)/" + cp -Rp "$(srcdir)/tqt4/" "$(DESTDIR)$(includedir)/" \ No newline at end of file diff --git a/qtinterface/tqobject.cpp b/qtinterface/tqobject.cpp index 6f7b71e..3029a5f 100644 --- a/qtinterface/tqobject.cpp +++ b/qtinterface/tqobject.cpp @@ -22,43 +22,6 @@ Boston, MA 02110-1301, USA. #include #include -#ifdef USE_QT3 -#include -#include "tqobjectlist.h" - -TQObject::~TQObject() { -} - -const TQObjectList TQObject::tqchildren() const -{ -// return *children(); - - QObjectList qlr; - TQObjectList tqt_tqobject_list; - qlr = *(this->children()); - tqt_tqobject_list.clear(); - for (int i = 0; i < qlr.count(); ++i) { - tqt_tqobject_list.append(static_cast(qlr.at(i))); - } - return tqt_tqobject_list; -} - -const TQObjectList TQObject::tqobjectTrees() -{ -// return *objectTrees(); - - QObjectList qlr; - TQObjectList tqt_tqobject_list; - qlr = *objectTrees(); - tqt_tqobject_list.clear(); - for (int i = 0; i < qlr.count(); ++i) { - tqt_tqobject_list.append(static_cast(qlr.at(i))); - } - return tqt_tqobject_list; -} - -#endif // USE_QT3 - #ifdef USE_QT4 const QObjectList *QObject::objectTrees() { @@ -88,4 +51,4 @@ bool QObject::qt_invoke(int slot, QUObject* uo) { return method.invoke(this, Qt::DirectConnection); } -#endif +#endif \ No newline at end of file diff --git a/qtinterface/tqobject.h b/qtinterface/tqobject.h index 192e38a..f19e493 100644 --- a/qtinterface/tqobject.h +++ b/qtinterface/tqobject.h @@ -31,29 +31,6 @@ Boston, MA 02110-1301, USA. #include -class TQObjectList; - -class TQObject : public QObject -{ -// Q_OBJECT - -public: - TQObject( QObject *tqparent=0, const char *name=0 ) : QObject ( tqparent, name ) {} - virtual ~TQObject(); - - const TQObjectList tqchildren() const; - static const TQObjectList tqobjectTrees(); - inline TQObject *tqparent() const { return TQT_TQOBJECT(parent()); } - - // Interoperability - static const TQObject& convertFromQObject( const QObject& qo ); -}; - -// Interoperability -inline static const TQObject& convertFromQObject( const QObject& qo ) { - return (*static_cast(&qo)); -} - #endif // USE_QT3 #ifdef USE_QT4 @@ -65,4 +42,4 @@ inline static const TQObject& convertFromQObject( const QObject& qo ) { #endif // USE_QT4 -#endif /* TQOBJECT_H */ +#endif /* TQOBJECT_H */ \ No newline at end of file diff --git a/qtinterface/tqobjectlist.h b/qtinterface/tqobjectlist.h index 0c519b4..1286100 100644 --- a/qtinterface/tqobjectlist.h +++ b/qtinterface/tqobjectlist.h @@ -29,55 +29,7 @@ Boston, MA 02110-1301, USA. // Reimplement the QObjectList class // For Qt3, no changes are needed -//#include - -//#ifndef TQT_H -#include "tqobject.h" -#include "tqptrlist.h" -//#endif // TQT_H - - -#if defined(TQ_TEMPLATEDLL) -//TQ_TEMPLATE_EXTERN template class Q_EXPORT TQPtrList; -//TQ_TEMPLATE_EXTERN template class Q_EXPORT TQPtrListIterator; -#endif - - -class Q_EXPORT TQObjectList : public TQPtrList -{ -public: - TQObjectList() : TQPtrList() {} - TQObjectList( const TQObjectList &list ) : TQPtrList(list) {} - ~TQObjectList() { clear(); } - TQObjectList &operator=(const TQObjectList &list) - { return (TQObjectList&)TQPtrList::operator=(list); } -}; - -class Q_EXPORT TQObjectListIterator : public TQPtrListIterator -{ -public: - TQObjectListIterator( const TQObjectList &l ) - : TQPtrListIterator( l ) { } - TQObjectListIterator &operator=( const TQObjectListIterator &i ) - { return (TQObjectListIterator&) - TQPtrListIterator::operator=( i ); } -}; - -#if (TQT_VERSION-0 >= 0x040000) -#if defined(TQ_CC_GNU) -#warning "remove the TQObjectListIt class" -#warning "remove the typedef too, maybe" -#endif -typedef TQObjectListIterator TQObjectListIt; -#else -class Q_EXPORT TQObjectListIt : public TQPtrListIterator -{ -public: - TQObjectListIt( const TQObjectList &l ) : TQPtrListIterator(l) {} - TQObjectListIt &operator=(const TQObjectListIt &i) - { return (TQObjectListIt&)TQPtrListIterator::operator=(i); } -}; -#endif +#include #endif // USE_QT3 @@ -90,4 +42,4 @@ public: #endif // USE_QT4 -#endif /* TQOBJECTLIST_H */ +#endif /* TQOBJECTLIST_H */ \ No newline at end of file diff --git a/qtinterface/tqt.h b/qtinterface/tqt.h index ba1fc04..82a3a9d 100644 --- a/qtinterface/tqt.h +++ b/qtinterface/tqt.h @@ -22,11 +22,7 @@ Boston, MA 02110-1301, USA. #ifndef TQT_H #define TQT_H -#define USE_QTX // WARNING: KEEP THIS ON LINE 25 AT ALL TIMES OTHERWISE BUILD FAILURE WILL OCCUR - -#ifdef USE_QTX -#define USE_QT3 // Default to Qt3 -#endif +#define USE_QTX #ifdef USE_QT4 #define QT3_SUPPORT @@ -49,13 +45,13 @@ Boston, MA 02110-1301, USA. #endif // __cplusplus #ifdef USE_QT3 -#define TQ_OBJECT /* UNUSED */ - #define qint64 long #define quint64 unsigned long +#define tqchildren children #define tqaccess access #define tqcolorTable colorTable +#define tqmask mask #define TQSO_Default Default #define tqqt_cast ::qt_cast #define TQ_Horizontal Horizontal @@ -367,7 +363,6 @@ Boston, MA 02110-1301, USA. #define TQCustomMenuItem QCustomMenuItem #define TQMenuData QMenuData #define TQMessageBox QMessageBox -#define TQMetaData QMetaData #define TQMetaProperty QMetaProperty #define TQMetaObject QMetaObject #define TQMetaObjectCleanUp QMetaObjectCleanUp @@ -389,12 +384,12 @@ Boston, MA 02110-1301, USA. #define TQNetworkOperation QNetworkOperation #define TQObjectCleanupHandler QObjectCleanupHandler #define TQObjectDictionary QObjectDictionary -//#define TQObject QObject +#define TQObject QObject #define TQObjectUserData QObjectUserData -//#define TQObject QObject -//#define TQObjectList QObjectList -//#define TQObjectListIterator QObjectListIterator -//#define TQObjectListIt QObjectListIt +#define TQObject QObject +#define TQObjectList QObjectList +#define TQObjectListIterator QObjectListIterator +#define TQObjectListIt QObjectListIt #define TQPaintDevice QPaintDevice #define TQPaintDeviceMetrics QPaintDeviceMetrics #define TQColorGroup QColorGroup @@ -584,179 +579,7 @@ Boston, MA 02110-1301, USA. #define TQXmlLexicalHandler QXmlLexicalHandler #define TQXmlDeclHandler QXmlDeclHandler #define TQXmlDefaultHandler QXmlDefaultHandler - -#define tqRound qRound -#define tqstrlen qstrlen -#define tqstrncmp qstrncmp -#define tqUncompress qUncompress -#define tqCopy qCopy -#define tqEqual qEqual -#define tqFill qFill -#define tqFind qFind -#define tqCount qCount -#define tqSwap qSwap -#define tqSystemWarning qSystemWarning -#define tqSuppressObsoleteWarnings qSuppressObsoleteWarnings - -#define tqmoc moc -#define TQMOC MOC -#define TQRGB_MASK RGB_MASK - -#define TQ_INT8 Q_INT8 -#define TQ_INT16 Q_INT16 -#define TQ_INT32 Q_INT32 -#define TQ_INT64 Q_INT64 -#define TQ_UINT8 Q_UINT8 -#define TQ_UINT16 Q_UINT16 -#define TQ_UINT32 Q_UINT32 -#define TQ_UINT64 Q_UINT64 - -#define TQ_LONG Q_LONG -#define TQ_LLONG Q_LLONG -#define TQ_ULONG Q_ULONG -#define TQ_ULLONG Q_ULLONG - -#define tqRed qRed -#define tqGreen qGreen -#define tqBlue qBlue -#define tqAlpha qAlpha -#define tqRgb qRgb -#define tqRgba qRgba -#define tqGray qGray -#define tqCompress qCompress -#define tqInstallMsgHandler qInstallMsgHandler -#define tqparentWidget parentWidget -#define tqchildAt childAt -#define tqAppName qAppName -#define tqApp qApp - -#define tqCursorShape CursorShape -#define tqshape shape -#define tqStatus Status -#define tqmetaObject metaObject -#define tqfind find -//#define tqchildren children -#define tqsetObjectName setObjectName -#define tqtopLevelWidget topLevelWidget -#define tqparent parent -#define tqmask mask -#define tqfocusWidget focusWidget -#define tqcontains contains -#define tqunicode unicode -#define tqreplace replace -#define tqsignals signals -#define tqslots slots -#define tqworldMatrix worldMatrix -#define tqsizeHint sizeHint -#define tqminimumSize minimumSize -#define tqmaximumSize maximumSize -#define tqgeometry geometry -#define tqspacerItem spacerItem -#define tqlayout layout -#define tqsetAlignment setAlignment -#define tqinvalidate invalidate -#define tqalignment alignment -#define tqdevice device -#define tqfromLatin1 fromLatin1 -#define tqreceivers receivers -#define tqencodedData encodedData -#define tqcurrentDate currentDate -#define tqstyleHint styleHint -#define tqitemRect itemRect -#define tqvisualRect visualRect -#define tqdrawControl drawControl -#define tqsetSizePolicy setSizePolicy -#define tqpixelMetric pixelMetric -#define tqdrawComplexControl drawComplexControl -#define tqrepaint repaint -#define tqcolorGroup colorGroup -#define tqdrawTextItem drawTextItem -#define tqsetLibraryPaths setLibraryPaths -#define tqsetColorGroup setColorGroup -#define tqfindRev findRev -#define tqfindProperty findProperty -#define tqfindSlot findSlot -#define tqcurrentDateTime currentDateTime -#define tqfindItem findItem -#define tqtopLevelWidgets topLevelWidgets -#define tqcontainsRef containsRef -#define tqfindIndex findIndex - -#define TQUObject QUObject - -#define tqt_mo_access access - -// BEGIN BLOCK ONE -// This block of text is taken (mostly) straight from TQt for Qt4 tqtglobaldefines.h -// It will need to be updated now and then as TQt for Qt4 changes - -#define TQT_TQOBJECT(x) (static_cast(static_cast(x))) -#define TQT_TQWIDGET(x) (static_cast(static_cast(x))) -#define TQT_TQSIZEPOLICY(x) (static_cast(static_cast(x))) -#define TQT_TQLAYOUT(x) (static_cast(static_cast(x))) -#define TQT_TQPAINTER(x) (static_cast(static_cast(x))) -#define TQT_TQPAINTDEVICE(x) (static_cast(static_cast(x))) -#define TQT_TQLAYOUTITEM(x) (static_cast(static_cast(x))) -#define TQT_TQIODEVICE(x) (static_cast(static_cast(x))) -#define TQT_TQCOLOR(x) (static_cast(static_cast(x))) -#define TQT_TQCHAR(x) TQChar(x) -#define TQT_TQSTRING(x) TQString(x) -#define TQT_TQBUFFER(x) (static_cast(static_cast(x))) -#define TQT_TQWMATRIX(x) (static_cast(static_cast(x))) -#define TQT_TQFILE(x) (static_cast(static_cast(x))) -#define TQT_TQBYTEARRAY(x) (static_cast(static_cast(x))) -#define TQT_TQMIMESOURCE(x) (static_cast(static_cast(x))) -#define TQT_TQWEXTRA(x) (static_cast(static_cast(x))) -#define TQT_TQPIXMAP(x) (static_cast(static_cast(x))) -#define TQT_TQCLIPBOARD(x) (static_cast(static_cast(x))) -#define TQT_TQPRINTER(x) (static_cast(static_cast(x))) -#define TQT_TQVARIANT(x) (static_cast(static_cast(x))) -#define TQT_TQMETAOBJECT(x) (static_cast(static_cast(x))) -#define TQT_TQSTYLEOPTION(x) (static_cast(static_cast(x))) - -#define TQT_TQOBJECT_OBJECT(x) (convertFromQObject(x)) -#define TQT_TQSIZEPOLICY_OBJECT(x) x -#define TQT_TQLAYOUT_OBJECT(x) x -#define TQT_TQCOLOR_OBJECT(x) x -#define TQT_TQSTRING_OBJECT(x) x -#define TQT_TQSTRLIST_OBJECT(x) x -#define TQT_TQSTRINGLIST_OBJECT(x) x -#define TQT_TQWMATRIX_OBJECT(x) x -#define TQT_TQRECT_OBJECT(x) x -#define TQT_TQBYTEARRAY_OBJECT(x) x -#define TQT_TQPIXMAP_OBJECT(x) x -#define TQT_TQTIME_OBJECT(x) x -#define TQT_TQDATE_OBJECT(x) x -#define TQT_TQDATETIME_OBJECT(x) x -#define TQT_TQBRUSH_OBJECT(x) x -#define TQT_TQPALETTE_OBJECT(x) x -#define TQT_TQPOINT_OBJECT(x) x -#define TQT_TQREGION_OBJECT(x) x -#define TQT_TQIMAGE_OBJECT(x) x -#define TQT_TQPAINTDEVICE_OBJECT(x) x -#define TQT_TQVARIANT_OBJECT(x) x -#define TQT_TQIODEVICE_OBJECT(x) x -#define TQT_TQSTYLEOPTION_OBJECT(x) x - -#define TQT_TQOBJECT_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQWIDGET_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQMIMESOURCE_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQBRUSH_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQPIXMAP_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQCOLOR_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQPRINTER_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQIODEVICE_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQVARIANT_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQMETAOBJECT_CONST(x) (static_cast(static_cast(x))) -#define TQT_TQSTYLEOPTION_CONST(x) (static_cast(static_cast(x))) - -#define TQT_BASE_OBJECT_NAME QObject -#define TQT_BASE_OBJECT(x) (static_cast(x)) -#define TQT_BASE_OBJECT_CONST(x) (static_cast(x)) - -// END BLOCK ONE - -#endif // USE_QT3 +#endif #ifdef USE_QT4