From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdevdesigner/shared/domtool.cpp | 166 ++++++++-------- kdevdesigner/shared/domtool.h | 26 +-- kdevdesigner/shared/globaldefs.h | 24 +-- kdevdesigner/shared/parser.cpp | 26 +-- kdevdesigner/shared/parser.h | 4 +- kdevdesigner/shared/ui2uib.cpp | 352 ++++++++++++++++----------------- kdevdesigner/shared/ui2uib.h | 2 +- kdevdesigner/shared/uib.cpp | 2 +- kdevdesigner/shared/uib.h | 34 ++-- kdevdesigner/shared/widgetdatabase.cpp | 210 ++++++++++---------- kdevdesigner/shared/widgetdatabase.h | 38 ++-- 11 files changed, 442 insertions(+), 442 deletions(-) (limited to 'kdevdesigner/shared') diff --git a/kdevdesigner/shared/domtool.cpp b/kdevdesigner/shared/domtool.cpp index 492ce88e..1696aa52 100644 --- a/kdevdesigner/shared/domtool.cpp +++ b/kdevdesigner/shared/domtool.cpp @@ -26,14 +26,14 @@ #include "domtool.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include /*! \class DomTool domtool.h @@ -51,9 +51,9 @@ \sa hasProperty() */ -QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { if ( n.attribute( "name" ) != name ) @@ -68,9 +68,9 @@ QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const /*! \overload */ -QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - QString comment; + TQString comment; return readProperty( e, name, defValue, comment ); } @@ -79,9 +79,9 @@ QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const \sa readProperty() */ -bool DomTool::hasProperty( const QDomElement& e, const QString& name ) +bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { if ( n.attribute( "name" ) != name ) @@ -92,13 +92,13 @@ bool DomTool::hasProperty( const QDomElement& e, const QString& name ) return FALSE; } -QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type ) +TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) { - QStringList result; - QDomElement n; + TQStringList result; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == type ) result += n.attribute( "name" ); } @@ -107,20 +107,20 @@ QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type } -QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue ) { - QString dummy; + TQString dummy; return elementToVariant( e, defValue, dummy ); } /*! Interprets element \a e as variant and returns the result of the interpretation. */ -QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ) { - QVariant v; + TQVariant v; if ( e.tagName() == "rect" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0, w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -133,9 +133,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QRect( x, y, w, h ) ); + v = TQVariant( TQRect( x, y, w, h ) ); } else if ( e.tagName() == "point" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -144,9 +144,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal y = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QPoint( x, y ) ); + v = TQVariant( TQPoint( x, y ) ); } else if ( e.tagName() == "size" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) @@ -155,12 +155,12 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QSize( w, h ) ); + v = TQVariant( TQSize( w, h ) ); } else if ( e.tagName() == "color" ) { - v = QVariant( readColor( e ) ); + v = TQVariant( readColor( e ) ); } else if ( e.tagName() == "font" ) { - QDomElement n3 = e.firstChild().toElement(); - QFont f( defValue.toFont() ); + TQDomElement n3 = e.firstChild().toElement(); + TQFont f( defValue.toFont() ); while ( !n3.isNull() ) { if ( n3.tagName() == "family" ) f.setFamily( n3.firstChild().toText().data() ); @@ -176,58 +176,58 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal f.setStrikeOut( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - v = QVariant( f ); + v = TQVariant( f ); } else if ( e.tagName() == "string" ) { - v = QVariant( e.firstChild().toText().data() ); - QDomElement n = e; + v = TQVariant( e.firstChild().toText().data() ); + TQDomElement n = e; n = n.nextSibling().toElement(); if ( n.tagName() == "comment" ) comment = n.firstChild().toText().data(); } else if ( e.tagName() == "cstring" ) { - v = QVariant( QCString( e.firstChild().toText().data() ) ); + v = TQVariant( TQCString( e.firstChild().toText().data() ) ); } else if ( e.tagName() == "number" ) { bool ok = TRUE; - v = QVariant( e.firstChild().toText().data().toInt( &ok ) ); + v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); if ( !ok ) - v = QVariant( e.firstChild().toText().data().toDouble() ); + v = TQVariant( e.firstChild().toText().data().toDouble() ); } else if ( e.tagName() == "bool" ) { - QString t = e.firstChild().toText().data(); - v = QVariant( t == "true" || t == "1", 0 ); + TQString t = e.firstChild().toText().data(); + v = TQVariant( t == "true" || t == "1", 0 ); } else if ( e.tagName() == "pixmap" ) { - v = QVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "iconset" ) { - v = QVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "image" ) { - v = QVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "enum" ) { - v = QVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "set" ) { - v = QVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "sizepolicy" ) { - QDomElement n3 = e.firstChild().toElement(); - QSizePolicy sp; + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; while ( !n3.isNull() ) { if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "horstretch" ) sp.setHorStretch( n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "verstretch" ) sp.setVerStretch( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - v = QVariant( sp ); + v = TQVariant( sp ); } else if ( e.tagName() == "cursor" ) { - v = QVariant( QCursor( e.firstChild().toText().data().toInt() ) ); + v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) ); } else if ( e.tagName() == "stringlist" ) { - QStringList lst; - QDomElement n; + TQStringList lst; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) lst << n.firstChild().toText().data(); - v = QVariant( lst ); + v = TQVariant( lst ); } else if ( e.tagName() == "date" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int y, m, d; y = m = d = 0; while ( !n3.isNull() ) { @@ -239,9 +239,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QDate( y, m, d ) ); + v = TQVariant( TQDate( y, m, d ) ); } else if ( e.tagName() == "time" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, m, s; h = m = s = 0; while ( !n3.isNull() ) { @@ -253,9 +253,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal s = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QTime( h, m, s ) ); + v = TQVariant( TQTime( h, m, s ) ); } else if ( e.tagName() == "datetime" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, mi, s, y, mo, d ; h = mi = s = y = mo = d = 0; while ( !n3.isNull() ) { @@ -273,7 +273,7 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = QVariant( QDateTime( QDate( y, mo, d ), QTime( h, mi, s ) ) ); + v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) ); } return v; } @@ -282,9 +282,9 @@ QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defVal /*! Returns the color which is returned in the dom element \a e. */ -QColor DomTool::readColor( const QDomElement &e ) +TQColor DomTool::readColor( const TQDomElement &e ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); int r= 0, g = 0, b = 0; while ( !n.isNull() ) { if ( n.tagName() == "red" ) @@ -296,7 +296,7 @@ QColor DomTool::readColor( const QDomElement &e ) n = n.nextSibling().toElement(); } - return QColor( r, g, b ); + return TQColor( r, g, b ); } /*! @@ -306,9 +306,9 @@ QColor DomTool::readColor( const QDomElement &e ) \sa hasAttribute() */ -QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "attribute" ) { if ( n.attribute( "name" ) != name ) @@ -322,9 +322,9 @@ QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, cons /*! \overload */ -QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - QString comment; + TQString comment; return readAttribute( e, name, defValue, comment ); } @@ -333,9 +333,9 @@ QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, cons \sa readAttribute() */ -bool DomTool::hasAttribute( const QDomElement& e, const QString& name ) +bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "attribute" ) { if ( n.attribute( "name" ) != name ) @@ -346,7 +346,7 @@ bool DomTool::hasAttribute( const QDomElement& e, const QString& name ) return FALSE; } -static bool toBool( const QString& s ) +static bool toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } @@ -354,11 +354,11 @@ static bool toBool( const QString& s ) /*! Convert Qt 2.x format to Qt 3.0 format if necessary */ -void DomTool::fixDocument( QDomDocument& doc ) +void DomTool::fixDocument( TQDomDocument& doc ) { - QDomElement e; - QDomNode n; - QDomNodeList nl; + TQDomElement e; + TQDomNode n; + TQDomNodeList nl; int i = 0; e = doc.firstChild().toElement(); @@ -374,8 +374,8 @@ void DomTool::fixDocument( QDomDocument& doc ) // in 3.0, we need to fix a spelling error if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) { for ( i = 0; i < (int) nl.length(); i++ ) { - QDomElement el = nl.item(i).toElement(); - QString s = el.attribute( "name" ); + TQDomElement el = nl.item(i).toElement(); + TQString s = el.attribute( "name" ); if ( s == "resizeable" ) { el.removeAttribute( "name" ); el.setAttribute( "name", "resizable" ); @@ -391,8 +391,8 @@ void DomTool::fixDocument( QDomDocument& doc ) e.setAttribute("stdsetdef", 1 ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - QString name; - QDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); if ( name == "resizeable" ) @@ -416,8 +416,8 @@ void DomTool::fixDocument( QDomDocument& doc ) nl = doc.elementsByTagName( "attribute" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - QString name; - QDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); e.setAttribute( "name", name ); @@ -428,8 +428,8 @@ void DomTool::fixDocument( QDomDocument& doc ) nl = doc.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - QString name; - QDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); e.setAttribute( "name", name ); @@ -440,8 +440,8 @@ void DomTool::fixDocument( QDomDocument& doc ) nl = doc.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - QString name; - QDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "class" ) { name = n2.firstChild().toText().data(); e.setAttribute( "class", name ); diff --git a/kdevdesigner/shared/domtool.h b/kdevdesigner/shared/domtool.h index 61b4269a..e83e106b 100644 --- a/kdevdesigner/shared/domtool.h +++ b/kdevdesigner/shared/domtool.h @@ -27,8 +27,8 @@ #ifndef DOMTOOL_H #define DOMTOOL_H -#include -#include +#include +#include class QDomElement; class QDomDocument; @@ -36,17 +36,17 @@ class QDomDocument; class DomTool : public Qt { public: - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ); - static bool hasProperty( const QDomElement& e, const QString& name ); - static QStringList propertiesOfType( const QDomElement& e, const QString& type ); - static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue ); - static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ); - static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ); - static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ); - static bool hasAttribute( const QDomElement& e, const QString& name ); - static QColor readColor( const QDomElement &e ); - static void fixDocument( QDomDocument& ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasProperty( const TQDomElement& e, const TQString& name ); + static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasAttribute( const TQDomElement& e, const TQString& name ); + static TQColor readColor( const TQDomElement &e ); + static void fixDocument( TQDomDocument& ); }; diff --git a/kdevdesigner/shared/globaldefs.h b/kdevdesigner/shared/globaldefs.h index 653c4fa5..ce70cae2 100644 --- a/kdevdesigner/shared/globaldefs.h +++ b/kdevdesigner/shared/globaldefs.h @@ -27,16 +27,16 @@ #ifndef GLOBALDEFS_H #define GLOBALDEFS_H -#include -#include +#include +#include #define BOXLAYOUT_DEFAULT_MARGIN 11 #define BOXLAYOUT_DEFAULT_SPACING 6 #ifndef NO_STATIC_COLORS -static QColor *backColor1 = 0; -static QColor *backColor2 = 0; -static QColor *selectedBack = 0; +static TQColor *backColor1 = 0; +static TQColor *backColor2 = 0; +static TQColor *selectedBack = 0; static void init_colors() { @@ -44,17 +44,17 @@ static void init_colors() return; #if 0 // a calculated alternative for backColor1 - QColorGroup myCg = qApp->palette().active(); + TQColorGroup myCg = qApp->palette().active(); int h1, s1, v1; int h2, s2, v2; - myCg.color( QColorGroup::Base ).hsv( &h1, &s1, &v1 ); - myCg.color( QColorGroup::Background ).hsv( &h2, &s2, &v2 ); - QColor c( h1, s1, ( v1 + v2 ) / 2, QColor::Hsv ); + myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 ); + myCg.color( TQColorGroup::Background ).hsv( &h2, &s2, &v2 ); + TQColor c( h1, s1, ( v1 + v2 ) / 2, TQColor::Hsv ); #endif - backColor1 = new QColor( 250, 248, 235 ); - backColor2 = new QColor( 255, 255, 255 ); - selectedBack = new QColor( 230, 230, 230 ); + backColor1 = new TQColor( 250, 248, 235 ); + backColor2 = new TQColor( 255, 255, 255 ); + selectedBack = new TQColor( 230, 230, 230 ); } #endif diff --git a/kdevdesigner/shared/parser.cpp b/kdevdesigner/shared/parser.cpp index e1b54ca1..0affb9d0 100644 --- a/kdevdesigner/shared/parser.cpp +++ b/kdevdesigner/shared/parser.cpp @@ -25,28 +25,28 @@ **********************************************************************/ #include "parser.h" -#include -#include +#include +#include class NormalizeObject : public QObject { public: - NormalizeObject() : QObject() {} - static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); } + NormalizeObject() : TQObject() {} + static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } }; -QString Parser::cleanArgs( const QString &func ) +TQString Parser::cleanArgs( const TQString &func ) { - QString slot( func ); + TQString slot( func ); int begin = slot.find( "(" ) + 1; - QString args = slot.mid( begin ); + TQString args = slot.mid( begin ); args = args.left( args.find( ")" ) ); - QStringList lst = QStringList::split( ',', args ); - QString res = slot.left( begin ); - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + TQStringList lst = TQStringList::split( ',', args ); + TQString res = slot.left( begin ); + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { if ( it != lst.begin() ) res += ","; - QString arg = *it; + TQString arg = *it; int pos = 0; if ( ( pos = arg.find( "&" ) ) != -1 ) { arg = arg.left( pos + 1 ); @@ -56,7 +56,7 @@ QString Parser::cleanArgs( const QString &func ) arg = arg.simplifyWhiteSpace(); if ( ( pos = arg.find( ':' ) ) != -1 ) arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); - QStringList l = QStringList::split( ' ', arg ); + TQStringList l = TQStringList::split( ' ', arg ); if ( l.count() == 2 ) { if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" ) arg = l[ 0 ]; @@ -68,5 +68,5 @@ QString Parser::cleanArgs( const QString &func ) } res += ")"; - return QString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) ); + return TQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) ); } diff --git a/kdevdesigner/shared/parser.h b/kdevdesigner/shared/parser.h index 10d83027..c50fed89 100644 --- a/kdevdesigner/shared/parser.h +++ b/kdevdesigner/shared/parser.h @@ -27,12 +27,12 @@ #ifndef PARSER_H #define PARSER_H -#include +#include class Parser { public: - static QString cleanArgs( const QString &func ); + static TQString cleanArgs( const TQString &func ); }; diff --git a/kdevdesigner/shared/ui2uib.cpp b/kdevdesigner/shared/ui2uib.cpp index 72c09320..b1e1c6ac 100644 --- a/kdevdesigner/shared/ui2uib.cpp +++ b/kdevdesigner/shared/ui2uib.cpp @@ -29,15 +29,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* The .uib file format is the binary counterpart of the .ui file @@ -49,22 +49,22 @@ The .uib format, unlike the .ui format, is internal to Trolltech and is not officially documented; it is assumed that anybody who needs to understand the file format can read the ui2uib and - QWidgetFactory source code, with some guidance. And here's some + TQWidgetFactory source code, with some guidance. And here's some guidance. A .uib file starts with a 32-bit magic number that allows - QWidgetFactory to determine the file type. The magic number is + TQWidgetFactory to determine the file type. The magic number is followed by '\n' (0x0a) and '\r' (0x0d), which ensure that the file wasn't corrupted during transfer between different platforms. For example, transferring a .ui file from Windows to Unix using FTP with type ASCII will produce a file with '\r\n\r' - in place of '\n\r'. This is followed by the QDataStream format + in place of '\n\r'. This is followed by the TQDataStream format version number used. The rest of the file is made up of blocks, each of which starts with a block type (Block_XXX) and a block length. Block_Intro and Block_Widget are mandatory; the others are optional. - QWidgetFactory makes certain assumptions about the order of the + TQWidgetFactory makes certain assumptions about the order of the blocks; for example, it expects Block_String before any other block that refers to a string and Block_Images before Block_Widget. The order generated by ui2uib is one of the orders @@ -91,10 +91,10 @@ 2. QObjects are referred to by index in a table rather than by name. The table itself is not stored in the .uib file; it is - rather build dynamically by ui2uib and QWidgetFactory as new + rather build dynamically by ui2uib and TQWidgetFactory as new objects are specified. In ui2uib, the table is represented by - a UibIndexMap object; in QWidgetFactory, a plain array of - QObject pointers suffices. + a UibIndexMap object; in TQWidgetFactory, a plain array of + TQObject pointers suffices. 3. The data is packed to take as little place as possible, without slowing down QLayoutFactory too much. For example, an @@ -105,11 +105,11 @@ 48 bits. 4. The name of a signal or slot and its signature are saved - separately. That way, if a signal 'foo(const QString&)' is - connected to a slot 'bar(const QString&)', the string-table - will only contain 'foo', 'bar', and '(const QString&)', - instead of the longer 'foo(const QString&)' and 'bar(const - QString&)'. The signatures are normalized beforehand to + separately. That way, if a signal 'foo(const TQString&)' is + connected to a slot 'bar(const TQString&)', the string-table + will only contain 'foo', 'bar', and '(const TQString&)', + instead of the longer 'foo(const TQString&)' and 'bar(const + TQString&)'. The signatures are normalized beforehand to ensure that trivial spacing problems don't result in multiple string-table entries. @@ -134,24 +134,24 @@ use UibMagic + 1 for version 2, UibMagic + 2 for version 3, etc. */ -static QCString layoutForTag( const QString& tag ) +static TQCString layoutForTag( const TQString& tag ) { if ( tag == "grid" ) { - return "QGridLayout"; + return "TQGridLayout"; } else if ( tag == "hbox" ) { - return "QHBoxLayout"; + return "TQHBoxLayout"; } else if ( tag == "vbox" ) { - return "QVBoxLayout"; + return "TQVBoxLayout"; } else { - return "QLayout"; + return "TQLayout"; } } class UibHack : public QObject { public: - static QString normalize( const QString& member ) { - return QString::fromUtf8( QObject::normalizeSignalSlot(member.utf8()) ); + static TQString normalize( const TQString& member ) { + return TQString::fromUtf8( TQObject::normalizeSignalSlot(member.utf8()) ); } }; @@ -160,20 +160,20 @@ class UibIndexMap public: UibIndexMap() : next( 0 ) { } - void insert( const QString& name ) { setName( insert(), name ); } + void insert( const TQString& name ) { setName( insert(), name ); } int insert() { return next++; } - void setName( int no, const QString& name ); + void setName( int no, const TQString& name ); - int find( const QString& name, int deflt = -1 ) const; + int find( const TQString& name, int deflt = -1 ) const; int count() const { return next; } private: - QMap nameMap; - QMap conflicts; + TQMap nameMap; + TQMap conflicts; int next; }; -void UibIndexMap::setName( int no, const QString& name ) +void UibIndexMap::setName( int no, const TQString& name ) { if ( !name.isEmpty() ) { if ( *nameMap.insert(name, no, FALSE) != no ) @@ -181,9 +181,9 @@ void UibIndexMap::setName( int no, const QString& name ) } } -int UibIndexMap::find( const QString& name, int deflt ) const +int UibIndexMap::find( const TQString& name, int deflt ) const { - QMap::ConstIterator no = nameMap.find( name ); + TQMap::ConstIterator no = nameMap.find( name ); if ( no == nameMap.end() || conflicts.contains(name) ) { return deflt; } else { @@ -191,7 +191,7 @@ int UibIndexMap::find( const QString& name, int deflt ) const } } -static void packUInt16( QDataStream& out, Q_UINT16 n ) +static void packUInt16( TQDataStream& out, Q_UINT16 n ) { if ( n < 255 ) { out << (Q_UINT8) n; @@ -201,7 +201,7 @@ static void packUInt16( QDataStream& out, Q_UINT16 n ) } } -static void packUInt32( QDataStream& out, Q_UINT32 n ) +static void packUInt32( TQDataStream& out, Q_UINT32 n ) { if ( n < 65535 ) { out << (Q_UINT16) n; @@ -211,26 +211,26 @@ static void packUInt32( QDataStream& out, Q_UINT32 n ) } } -static void packByteArray( QDataStream& out, const QByteArray& array ) +static void packByteArray( TQDataStream& out, const TQByteArray& array ) { packUInt32( out, array.size() ); out.writeRawBytes( array.data(), array.size() ); } -static void packCString( UibStrTable& strings, QDataStream& out, +static void packCString( UibStrTable& strings, TQDataStream& out, const char *cstr ) { packUInt32( out, strings.insertCString(cstr) ); } -static void packString( UibStrTable& strings, QDataStream& out, - const QString& str ) +static void packString( UibStrTable& strings, TQDataStream& out, + const TQString& str ) { packUInt32( out, strings.insertString(str) ); } -static void packStringSplit( UibStrTable& strings, QDataStream& out, - const QString& str, QChar sep ) +static void packStringSplit( UibStrTable& strings, TQDataStream& out, + const TQString& str, TQChar sep ) { int pos = str.find( sep ); if ( pos == -1 ) @@ -239,29 +239,29 @@ static void packStringSplit( UibStrTable& strings, QDataStream& out, packString( strings, out, str.mid(pos) ); } -static void packVariant( UibStrTable& strings, QDataStream& out, - QVariant value, QString tag = "" ) +static void packVariant( UibStrTable& strings, TQDataStream& out, + TQVariant value, TQString tag = "" ) { - QStringList::ConstIterator s; + TQStringList::ConstIterator s; Q_UINT8 type = value.type(); if ( tag == "pixmap" ) { - type = QVariant::Pixmap; + type = TQVariant::Pixmap; } else if ( tag == "image" ) { - type = QVariant::Image; + type = TQVariant::Image; } else if ( tag == "iconset" ) { - type = QVariant::IconSet; + type = TQVariant::IconSet; } out << type; switch ( type ) { - case QVariant::String: - case QVariant::Pixmap: - case QVariant::Image: - case QVariant::IconSet: + case TQVariant::String: + case TQVariant::Pixmap: + case TQVariant::Image: + case TQVariant::IconSet: packString( strings, out, value.asString() ); break; - case QVariant::StringList: + case TQVariant::StringList: packUInt16( out, value.asStringList().count() ); s = value.asStringList().begin(); while ( s != value.asStringList().end() ) { @@ -269,48 +269,48 @@ static void packVariant( UibStrTable& strings, QDataStream& out, ++s; } break; - case QVariant::Font: + case TQVariant::Font: out << value.asFont(); break; - case QVariant::Rect: + case TQVariant::Rect: packUInt16( out, value.asRect().x() ); packUInt16( out, value.asRect().y() ); packUInt16( out, value.asRect().width() ); packUInt16( out, value.asRect().height() ); break; - case QVariant::Size: + case TQVariant::Size: packUInt16( out, value.asSize().width() ); packUInt16( out, value.asSize().height() ); break; - case QVariant::Color: + case TQVariant::Color: out << value.asColor(); break; - case QVariant::Point: + case TQVariant::Point: packUInt16( out, value.asPoint().x() ); packUInt16( out, value.asPoint().y() ); break; - case QVariant::Int: + case TQVariant::Int: packUInt32( out, value.asInt() ); break; - case QVariant::Bool: + case TQVariant::Bool: out << (Q_UINT8) value.asBool(); break; - case QVariant::Double: + case TQVariant::Double: out << value.asDouble(); break; - case QVariant::CString: + case TQVariant::CString: packCString( strings, out, value.asCString() ); break; - case QVariant::Cursor: + case TQVariant::Cursor: out << value.asCursor(); break; - case QVariant::Date: + case TQVariant::Date: out << value.asDate(); break; - case QVariant::Time: + case TQVariant::Time: out << value.asTime(); break; - case QVariant::DateTime: + case TQVariant::DateTime: out << value.asDateTime(); break; default: @@ -318,27 +318,27 @@ static void packVariant( UibStrTable& strings, QDataStream& out, } } -static void outputProperty( QMap& buddies, int objectNo, - UibStrTable& strings, QDataStream& out, - QDomElement elem ) +static void outputProperty( TQMap& buddies, int objectNo, + UibStrTable& strings, TQDataStream& out, + TQDomElement elem ) { - QCString name = elem.attribute( "name" ).latin1(); - QDomElement f = elem.firstChild().toElement(); - QString tag = f.tagName(); - QString comment; - QVariant value; + TQCString name = elem.attribute( "name" ).latin1(); + TQDomElement f = elem.firstChild().toElement(); + TQString tag = f.tagName(); + TQString comment; + TQVariant value; if ( name == "resizeable" ) name = "resizable"; if ( tag == "font" ) { - QString family; + TQString family; Q_UINT16 pointSize = 65535; Q_UINT8 fontFlags = 0; - QDomElement g = f.firstChild().toElement(); + TQDomElement g = f.firstChild().toElement(); while ( !g.isNull() ) { - QString text = g.firstChild().toText().data(); + TQString text = g.firstChild().toText().data(); if ( g.tagName() == "family" ) { fontFlags |= Font_Family; family = text; @@ -372,9 +372,9 @@ static void outputProperty( QMap& buddies, int objectNo, out << (Q_UINT8) Object_PaletteProperty; packCString( strings, out, name ); - QDomElement g = f.firstChild().toElement(); + TQDomElement g = f.firstChild().toElement(); while ( !g.isNull() ) { - QDomElement h = g.firstChild().toElement(); + TQDomElement h = g.firstChild().toElement(); while ( !h.isNull() ) { value = DomTool::elementToVariant( h, Qt::gray ); if ( h.tagName() == "color" ) { @@ -418,7 +418,7 @@ static void outputProperty( QMap& buddies, int objectNo, } } -static void outputGridCell( QDataStream& out, QDomElement elem ) +static void outputGridCell( TQDataStream& out, TQDomElement elem ) { int column = elem.attribute( "column", "0" ).toInt(); int row = elem.attribute( "row", "0" ).toInt(); @@ -438,23 +438,23 @@ static void outputGridCell( QDataStream& out, QDomElement elem ) } } -static int outputObject( QMap& buddies, +static int outputObject( TQMap& buddies, UibIndexMap& objects, UibStrTable& strings, - QDataStream& out, QDomElement elem, - QCString className = "" ); + TQDataStream& out, TQDomElement elem, + TQCString className = "" ); -static void outputLayoutWidgetsSubLayout( QMap& buddies, +static void outputLayoutWidgetsSubLayout( TQMap& buddies, UibIndexMap& objects, UibStrTable& strings, - QDataStream& out, QDomElement elem ) + TQDataStream& out, TQDomElement elem ) { int subLayoutNo = -1; - QCString name; - QDomElement nameElem; + TQCString name; + TQDomElement nameElem; - QDomElement f = elem.firstChild().toElement(); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { - QString tag = f.tagName(); + TQString tag = f.tagName(); if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) { out << (Q_UINT8) Object_SubLayout; subLayoutNo = outputObject( buddies, objects, strings, out, f, @@ -483,16 +483,16 @@ static void outputLayoutWidgetsSubLayout( QMap& buddies, } } -static int outputObject( QMap& buddies, +static int outputObject( TQMap& buddies, UibIndexMap& objects, UibStrTable& strings, - QDataStream& out, QDomElement elem, - QCString className ) + TQDataStream& out, TQDomElement elem, + TQCString className ) { bool isQObject = !className.isEmpty(); - if ( className == "QToolBar" ) + if ( className == "TQToolBar" ) out << (Q_UINT8) elem.attribute( "dock", "0" ).toInt(); - if ( className == "QWidget" ) + if ( className == "TQWidget" ) className = elem.attribute( "class", className ).latin1(); int objectNo = -1; @@ -504,18 +504,18 @@ static int outputObject( QMap& buddies, outputGridCell( out, elem ); // optimization: insert '&Foo' into string-table before 'Foo' - if ( className == "QAction" || className == "QActionGroup" ) { - QVariant value = DomTool::readProperty( elem, "menuText", QVariant() ); + if ( className == "TQAction" || className == "TQActionGroup" ) { + TQVariant value = DomTool::readProperty( elem, "menuText", TQVariant() ); if ( value.asString().startsWith("&") ) strings.insertString( value.asString() ); } - QDomElement f = elem.firstChild().toElement(); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { - QString tag = f.tagName(); + TQString tag = f.tagName(); if ( tag == "action" ) { if ( elem.tagName() == "item" || elem.tagName() == "toolbar" ) { - QString actionName = f.attribute( "name" ); + TQString actionName = f.attribute( "name" ); int no = objects.find( actionName ); if ( no != -1 ) { out << (Q_UINT8) Object_ActionRef; @@ -523,11 +523,11 @@ static int outputObject( QMap& buddies, } } else { out << (Q_UINT8) Object_SubAction; - outputObject( buddies, objects, strings, out, f, "QAction" ); + outputObject( buddies, objects, strings, out, f, "TQAction" ); } } else if ( tag == "actiongroup" ) { out << (Q_UINT8) Object_SubAction; - outputObject( buddies, objects, strings, out, f, "QActionGroup" ); + outputObject( buddies, objects, strings, out, f, "TQActionGroup" ); } else if ( tag == "attribute" ) { out << (Q_UINT8) Object_Attribute; outputProperty( buddies, objectNo, strings, out, f ); @@ -538,7 +538,7 @@ static int outputObject( QMap& buddies, out << (Q_UINT8) Object_Event; packCString( strings, out, f.attribute("name").latin1() ); packVariant( strings, out, - QStringList::split(',', f.attribute("functions")) ); + TQStringList::split(',', f.attribute("functions")) ); } else if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) { out << (Q_UINT8) Object_SubLayout; outputObject( buddies, objects, strings, out, f, @@ -570,7 +570,7 @@ static int outputObject( QMap& buddies, f ); } else { out << (Q_UINT8) Object_SubWidget; - outputObject( buddies, objects, strings, out, f, "QWidget" ); + outputObject( buddies, objects, strings, out, f, "TQWidget" ); } } f = f.nextSibling().toElement(); @@ -582,8 +582,8 @@ static int outputObject( QMap& buddies, return objectNo; } -static void outputBlock( QDataStream& out, BlockTag tag, - const QByteArray& data ) +static void outputBlock( TQDataStream& out, BlockTag tag, + const TQByteArray& data ) { if ( !data.isEmpty() ) { out << (Q_UINT8) tag; @@ -591,41 +591,41 @@ static void outputBlock( QDataStream& out, BlockTag tag, } } -void convertUiToUib( QDomDocument& doc, QDataStream& out ) +void convertUiToUib( TQDomDocument& doc, TQDataStream& out ) { - QByteArray introBlock; - QByteArray actionsBlock; - QByteArray buddiesBlock; - QByteArray connectionsBlock; - QByteArray functionsBlock; - QByteArray imagesBlock; - QByteArray menubarBlock; - QByteArray slotsBlock; - QByteArray tabstopsBlock; - QByteArray toolbarsBlock; - QByteArray variablesBlock; - QByteArray widgetBlock; - - QDomElement actionsElem; - QDomElement connectionsElem; - QDomElement imagesElem; - QDomElement menubarElem; - QDomElement tabstopsElem; - QDomElement toolbarsElem; - QDomElement widgetElem; - - QMap buddies; + TQByteArray introBlock; + TQByteArray actionsBlock; + TQByteArray buddiesBlock; + TQByteArray connectionsBlock; + TQByteArray functionsBlock; + TQByteArray imagesBlock; + TQByteArray menubarBlock; + TQByteArray slotsBlock; + TQByteArray tabstopsBlock; + TQByteArray toolbarsBlock; + TQByteArray variablesBlock; + TQByteArray widgetBlock; + + TQDomElement actionsElem; + TQDomElement connectionsElem; + TQDomElement imagesElem; + TQDomElement menubarElem; + TQDomElement tabstopsElem; + TQDomElement toolbarsElem; + TQDomElement widgetElem; + + TQMap buddies; UibStrTable strings; UibIndexMap objects; int widgetNo = -1; - QCString className; + TQCString className; Q_INT16 defaultMargin = -32768; Q_INT16 defaultSpacing = -32768; Q_UINT8 introFlags = 0; - QDomElement elem = doc.firstChild().toElement().firstChild().toElement(); + TQDomElement elem = doc.firstChild().toElement().firstChild().toElement(); while ( !elem.isNull() ) { - QString tag = elem.tagName(); + TQString tag = elem.tagName(); switch ( tag[0].latin1() ) { case 'a': @@ -641,8 +641,8 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) break; case 'f': if ( tag == "functions" ) { - QDataStream out2( functionsBlock, IO_WriteOnly ); - QDomElement f = elem.firstChild().toElement(); + TQDataStream out2( functionsBlock, IO_WriteOnly ); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "function" ) { packStringSplit( strings, out2, @@ -656,17 +656,17 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) break; case 'i': if ( tag == "images" ) { - QDataStream out2( imagesBlock, IO_WriteOnly ); - QDomElement f = elem.firstChild().toElement(); + TQDataStream out2( imagesBlock, IO_WriteOnly ); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "image" ) { - QString name = f.attribute( "name" ); - QDomElement g = f.firstChild().toElement(); + TQString name = f.attribute( "name" ); + TQDomElement g = f.firstChild().toElement(); if ( g.tagName() == "data" ) { - QString format = g.attribute( "format", "PNG" ); - QString hex = g.firstChild().toText().data(); + TQString format = g.attribute( "format", "PNG" ); + TQString hex = g.firstChild().toText().data(); int n = hex.length() / 2; - QByteArray data( n ); + TQByteArray data( n ); for ( int i = 0; i < n; i++ ) data[i] = (char) hex.mid( 2 * i, 2 ) .toUInt( 0, 16 ); @@ -683,10 +683,10 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) break; case 'l': if ( tag == "layoutdefaults" ) { - QString margin = elem.attribute( "margin" ); + TQString margin = elem.attribute( "margin" ); if ( !margin.isEmpty() ) defaultMargin = margin.toInt(); - QString spacing = elem.attribute( "spacing" ); + TQString spacing = elem.attribute( "spacing" ); if ( !spacing.isEmpty() ) defaultSpacing = spacing.toInt(); } @@ -701,12 +701,12 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) break; case 's': if ( tag == "slots" ) { - QDataStream out2( slotsBlock, IO_WriteOnly ); - QDomElement f = elem.firstChild().toElement(); + TQDataStream out2( slotsBlock, IO_WriteOnly ); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "slot" ) { - QString language = f.attribute( "language", "C++" ); - QString slot = UibHack::normalize( + TQString language = f.attribute( "language", "C++" ); + TQString slot = UibHack::normalize( f.firstChild().toText().data() ); packString( strings, out2, language ); packStringSplit( strings, out2, slot, '(' ); @@ -724,11 +724,11 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) break; case 'v': if ( tag == "variable" ) { - QDataStream out2( variablesBlock, IO_WriteOnly | IO_Append ); + TQDataStream out2( variablesBlock, IO_WriteOnly | IO_Append ); packString( strings, out2, elem.firstChild().toText().data() ); } else if ( tag == "variables" ) { - QDataStream out2( variablesBlock, IO_WriteOnly ); - QDomElement f = elem.firstChild().toElement(); + TQDataStream out2( variablesBlock, IO_WriteOnly ); + TQDomElement f = elem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "variable" ) packString( strings, out2, @@ -745,17 +745,17 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) } { - QDataStream out2( widgetBlock, IO_WriteOnly ); + TQDataStream out2( widgetBlock, IO_WriteOnly ); widgetNo = outputObject( buddies, objects, strings, out2, widgetElem, - "QWidget" ); + "TQWidget" ); } if ( !tabstopsElem.isNull() ) { - QDataStream out2( tabstopsBlock, IO_WriteOnly ); - QDomElement f = tabstopsElem.firstChild().toElement(); + TQDataStream out2( tabstopsBlock, IO_WriteOnly ); + TQDomElement f = tabstopsElem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "tabstop" ) { - QString widgetName = f.firstChild().toText().data(); + TQString widgetName = f.firstChild().toText().data(); int no = objects.find( widgetName ); if ( no != -1 ) packUInt16( out2, no ); @@ -765,31 +765,31 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) } if ( !actionsElem.isNull() ) { - QDataStream out2( actionsBlock, IO_WriteOnly ); + TQDataStream out2( actionsBlock, IO_WriteOnly ); outputObject( buddies, objects, strings, out2, actionsElem ); } if ( !menubarElem.isNull() ) { - QDataStream out2( menubarBlock, IO_WriteOnly ); + TQDataStream out2( menubarBlock, IO_WriteOnly ); outputObject( buddies, objects, strings, out2, menubarElem, - "QMenuBar" ); + "TQMenuBar" ); } if ( !toolbarsElem.isNull() ) { - QDataStream out2( toolbarsBlock, IO_WriteOnly ); - QDomElement f = toolbarsElem.firstChild().toElement(); + TQDataStream out2( toolbarsBlock, IO_WriteOnly ); + TQDomElement f = toolbarsElem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "toolbar" ) - outputObject( buddies, objects, strings, out2, f, "QToolBar" ); + outputObject( buddies, objects, strings, out2, f, "TQToolBar" ); f = f.nextSibling().toElement(); } } if ( !buddies.isEmpty() ) { - QDataStream out2( buddiesBlock, IO_WriteOnly ); - QMap::ConstIterator a = buddies.begin(); + TQDataStream out2( buddiesBlock, IO_WriteOnly ); + TQMap::ConstIterator a = buddies.begin(); while ( a != buddies.end() ) { - QStringList::ConstIterator b = (*a).begin(); + TQStringList::ConstIterator b = (*a).begin(); while ( b != (*a).end() ) { int no = objects.find( *b ); if ( no != -1 ) { @@ -803,29 +803,29 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) } if ( !connectionsElem.isNull() ) { - QString prevLanguage = "C++"; + TQString prevLanguage = "C++"; int prevSenderNo = 0; - QString prevSignal = "clicked()"; + TQString prevSignal = "clicked()"; int prevReceiverNo = 0; - QString prevSlot = "accept()"; + TQString prevSlot = "accept()"; - QDataStream out2( connectionsBlock, IO_WriteOnly ); - QDomElement f = connectionsElem.firstChild().toElement(); + TQDataStream out2( connectionsBlock, IO_WriteOnly ); + TQDomElement f = connectionsElem.firstChild().toElement(); while ( !f.isNull() ) { if ( f.tagName() == "connection" ) { - QMap argMap; + TQMap argMap; - QDomElement g = f.firstChild().toElement(); + TQDomElement g = f.firstChild().toElement(); while ( !g.isNull() ) { argMap[g.tagName()] = g.firstChild().toText().data(); g = g.nextSibling().toElement(); } - QString language = f.attribute( "language", "C++" ); + TQString language = f.attribute( "language", "C++" ); int senderNo = objects.find( argMap["sender"], widgetNo ); int receiverNo = objects.find( argMap["receiver"], widgetNo ); - QString signal = UibHack::normalize( argMap["signal"] ); - QString slot = UibHack::normalize( argMap["slot"] ); + TQString signal = UibHack::normalize( argMap["signal"] ); + TQString slot = UibHack::normalize( argMap["slot"] ); Q_UINT8 connectionFlags = 0; if ( language != prevLanguage ) @@ -864,7 +864,7 @@ void convertUiToUib( QDomDocument& doc, QDataStream& out ) } { - QDataStream out2( introBlock, IO_WriteOnly ); + TQDataStream out2( introBlock, IO_WriteOnly ); out2 << introFlags; out2 << defaultMargin; out2 << defaultSpacing; diff --git a/kdevdesigner/shared/ui2uib.h b/kdevdesigner/shared/ui2uib.h index 674fd589..6bbc02bc 100644 --- a/kdevdesigner/shared/ui2uib.h +++ b/kdevdesigner/shared/ui2uib.h @@ -30,6 +30,6 @@ class QDataStream; class QDomDocument; -void convertUiToUib( QDomDocument& doc, QDataStream& out ); +void convertUiToUib( TQDomDocument& doc, TQDataStream& out ); #endif diff --git a/kdevdesigner/shared/uib.cpp b/kdevdesigner/shared/uib.cpp index 72d73b45..ca48b4e4 100644 --- a/kdevdesigner/shared/uib.cpp +++ b/kdevdesigner/shared/uib.cpp @@ -27,7 +27,7 @@ #include "uib.h" static const char commonStrings[] = - "\0()\0(bool)\0(const QString&)\0(int)\0C++\0Layout1\0PNG\0QCheckBox\0" + "\0()\0(bool)\0(const TQString&)\0(int)\0C++\0Layout1\0PNG\0QCheckBox\0" "QComboBox\0QDialog\0QFrame\0QGridLayout\0QGroupBox\0QHBoxLayout\0QLabel\0" "QLineEdit\0QListView\0QPushButton\0QRadioButton\0QVBoxLayout\0QWidget\0" "TextLabel1\0XPM.GZ\0accept\0autoDefault\0buddy\0caption\0clicked\0" diff --git a/kdevdesigner/shared/uib.h b/kdevdesigner/shared/uib.h index 00adac13..0a7063a4 100644 --- a/kdevdesigner/shared/uib.h +++ b/kdevdesigner/shared/uib.h @@ -27,7 +27,7 @@ #ifndef UIB_H #define UIB_H -#include +#include const Q_UINT32 UibMagic = 0xb77c61d8; @@ -68,22 +68,22 @@ public: UibStrTable(); inline int insertCString( const char *cstr ); - inline int insertString( const QString& str ); - inline void readBlock( QDataStream& in, int size ); + inline int insertString( const TQString& str ); + inline void readBlock( TQDataStream& in, int size ); inline const char *asCString( int offset ) const; - inline QString asString( int offset ) const; - inline QByteArray block() const; + inline TQString asString( int offset ) const; + inline TQByteArray block() const; private: - QCString table; - QDataStream out; + TQCString table; + TQDataStream out; int start; }; /* uic uses insertCString(), insertString(), and block(); - QWidgetFactory uses readBlock(), asCString(), and asString(). By + TQWidgetFactory uses readBlock(), asCString(), and asString(). By implementing these functions inline, we ensure that the binaries don't contain needless code. */ @@ -106,9 +106,9 @@ inline int UibStrTable::insertCString( const char *cstr ) } } -inline int UibStrTable::insertString( const QString& str ) +inline int UibStrTable::insertString( const TQString& str ) { - if ( str.contains('\0') || str[0] == QChar(0x7f) ) { + if ( str.contains('\0') || str[0] == TQChar(0x7f) ) { int nextPos = table.size(); out << (Q_UINT8) 0x7f; out << str; @@ -118,22 +118,22 @@ inline int UibStrTable::insertString( const QString& str ) } } -inline void UibStrTable::readBlock( QDataStream& in, int size ) +inline void UibStrTable::readBlock( TQDataStream& in, int size ) { table.resize( start + size ); in.readRawBytes( table.data() + start, size ); } -inline QString UibStrTable::asString( int offset ) const +inline TQString UibStrTable::asString( int offset ) const { if ( table[offset] == 0x7f ) { - QDataStream in( table, IO_ReadOnly ); + TQDataStream in( table, IO_ReadOnly ); in.device()->at( offset + 1 ); - QString str; + TQString str; in >> str; return str; } else { - return QString::fromUtf8( asCString(offset) ); + return TQString::fromUtf8( asCString(offset) ); } } @@ -142,9 +142,9 @@ inline const char *UibStrTable::asCString( int offset ) const return table.data() + offset; } -inline QByteArray UibStrTable::block() const +inline TQByteArray UibStrTable::block() const { - QByteArray block; + TQByteArray block; block.duplicate( table.data() + start, table.size() - start ); return block; } diff --git a/kdevdesigner/shared/widgetdatabase.cpp b/kdevdesigner/shared/widgetdatabase.cpp index 8b80b03f..902cd697 100644 --- a/kdevdesigner/shared/widgetdatabase.cpp +++ b/kdevdesigner/shared/widgetdatabase.cpp @@ -32,15 +32,15 @@ #include #include -#include +#include #define NO_STATIC_COLORS #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -50,17 +50,17 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static QDict *className2Id = 0; +static TQDict *className2Id = 0; static int dbcount = 0; static int dbcustomcount = 200; -static QStrList *wGroups; -static QStrList *invisibleGroups; +static TQStrList *wGroups; +static TQStrList *invisibleGroups; static bool whatsThisLoaded = FALSE; static QPluginManager *widgetPluginManager = 0; static bool plugins_set_up = FALSE; static bool was_in_setup = FALSE; -QCleanupHandler > cleanup_manager; +TQCleanupHandler > cleanup_manager; WidgetDatabaseRecord::WidgetDatabaseRecord() { @@ -128,14 +128,14 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups = new QStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new QDict( dbdictsize ); + className2Id = new TQDict( dbdictsize ); className2Id->setAutoDelete( TRUE ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "designer_pushbutton.png"; - r->name = "QPushButton"; + r->name = "TQPushButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Push Button"; r->isCommon = TRUE; @@ -144,7 +144,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_toolbutton.png"; - r->name = "QToolButton"; + r->name = "TQToolButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Tool Button"; @@ -152,7 +152,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_radiobutton.png"; - r->name = "QRadioButton"; + r->name = "TQRadioButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Radio Button"; r->isCommon = TRUE; @@ -161,7 +161,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_checkbox.png"; - r->name = "QCheckBox"; + r->name = "TQCheckBox"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Check Box"; r->isCommon = TRUE; @@ -170,7 +170,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_groupbox.png"; - r->name = "QGroupBox"; + r->name = "TQGroupBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Group Box"; r->isContainer = TRUE; @@ -179,7 +179,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_buttongroup.png"; - r->name = "QButtonGroup"; + r->name = "TQButtonGroup"; r->group = widgetGroup( "Containers" ); r->toolTip = "Button Group"; r->isContainer = TRUE; @@ -189,7 +189,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_frame.png"; - r->name = "QFrame"; + r->name = "TQFrame"; r->group = widgetGroup( "Containers" ); r->toolTip = "Frame"; r->isContainer = TRUE; @@ -198,7 +198,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_tabwidget.png"; - r->name = "QTabWidget"; + r->name = "TQTabWidget"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tabwidget"; r->isContainer = TRUE; @@ -207,7 +207,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_widgetstack.png"; - r->name = "QWidgetStack"; + r->name = "TQWidgetStack"; r->group = widgetGroup( "Containers" ); r->toolTip = "Widget Stack"; r->isContainer = TRUE; @@ -216,7 +216,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_toolbox.png"; - r->name = "QToolBox"; + r->name = "TQToolBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tool Box"; r->isContainer = TRUE; @@ -225,7 +225,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_listbox.png"; - r->name = "QListBox"; + r->name = "TQListBox"; r->group = widgetGroup( "Views" ); r->toolTip = "List Box"; r->isCommon = TRUE; @@ -234,7 +234,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_listview.png"; - r->name = "QListView"; + r->name = "TQListView"; r->group = widgetGroup( "Views" ); r->toolTip = "List View"; @@ -243,7 +243,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_ICONVIEW) || defined(UIC) r = new WidgetDatabaseRecord; r->iconSet = "designer_iconview.png"; - r->name = "QIconView"; + r->name = "TQIconView"; r->group = widgetGroup( "Views" ); r->toolTip = "Icon View"; @@ -253,7 +253,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "designer_table.png"; - r->name = "QTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -263,8 +263,8 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_SQL) r = new WidgetDatabaseRecord; r->iconSet = "designer_datatable.png"; - r->includeFile = "qdatatable.h"; - r->name = "QDataTable"; + r->includeFile = "tqdatatable.h"; + r->name = "TQDataTable"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Table"; @@ -273,7 +273,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_lineedit.png"; - r->name = "QLineEdit"; + r->name = "TQLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Line Edit"; r->isCommon = TRUE; @@ -282,7 +282,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_spinbox.png"; - r->name = "QSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; r->isCommon = TRUE; @@ -294,7 +294,7 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QDateEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Date Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); @@ -303,7 +303,7 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QTimeEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Time Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); @@ -312,13 +312,13 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "QDateTimeEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Date-Time Edit"; - r->includeFile = "qdatetimeedit.h"; + r->includeFile = "tqdatetimeedit.h"; append( r ); r = new WidgetDatabaseRecord; r->iconSet = "designer_multilineedit.png"; - r->name = "QMultiLineEdit"; + r->name = "TQMultiLineEdit"; r->group = widgetGroup( "Temp" ); r->toolTip = "Multi Line Edit"; @@ -326,7 +326,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_richtextedit.png"; - r->name = "QTextEdit"; + r->name = "TQTextEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Rich Text Edit"; r->isCommon = TRUE; @@ -335,7 +335,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_combobox.png"; - r->name = "QComboBox"; + r->name = "TQComboBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Combo Box"; r->isCommon = TRUE; @@ -344,7 +344,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_slider.png"; - r->name = "QSlider"; + r->name = "TQSlider"; r->group = widgetGroup( "Input" ); r->toolTip = "Slider"; @@ -352,7 +352,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_scrollbar.png"; - r->name = "QScrollBar"; + r->name = "TQScrollBar"; r->group = widgetGroup( "Input" ); r->toolTip = "Scrollbar"; @@ -360,7 +360,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_dial.png"; - r->name = "QDial"; + r->name = "TQDial"; r->group = widgetGroup( "Input" ); r->toolTip = "Dial"; @@ -368,7 +368,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_label.png"; - r->name = "QLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -395,7 +395,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_lcdnumber.png"; - r->name = "QLCDNumber"; + r->name = "TQLCDNumber"; r->group = widgetGroup( "Display" ); r->toolTip = "LCD Number"; @@ -406,14 +406,14 @@ void WidgetDatabase::setupDataBase( int id ) r->name = "Line"; r->group = widgetGroup( "Display" ); r->toolTip = "Line"; - r->includeFile = "qframe.h"; + r->includeFile = "tqframe.h"; r->whatsThis = "The Line widget provides horizontal and vertical lines."; append( r ); r = new WidgetDatabaseRecord; r->iconSet = "designer_progress.png"; - r->name = "QProgressBar"; + r->name = "TQProgressBar"; r->group = widgetGroup( "Display" ); r->toolTip = "Progress Bar"; @@ -421,7 +421,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_textview.png"; - r->name = "QTextView"; + r->name = "TQTextView"; r->group = widgetGroup( "Temp" ); r->toolTip = "Text View"; @@ -429,7 +429,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "designer_textbrowser.png"; - r->name = "QTextBrowser"; + r->name = "TQTextBrowser"; r->group = widgetGroup( "Display" ); r->toolTip = "Text Browser"; @@ -445,21 +445,21 @@ void WidgetDatabase::setupDataBase( int id ) append( r ); r = new WidgetDatabaseRecord; - r->name = "QWidget"; + r->name = "TQWidget"; r->isForm = TRUE; r->group = widgetGroup( "Forms" ); append( r ); r = new WidgetDatabaseRecord; - r->name = "QDialog"; + r->name = "TQDialog"; r->group = widgetGroup( "Forms" ); r->isForm = TRUE; append( r ); r = new WidgetDatabaseRecord; - r->name = "QWizard"; + r->name = "TQWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = TRUE; @@ -481,9 +481,9 @@ void WidgetDatabase::setupDataBase( int id ) append( r ); r = new WidgetDatabaseRecord; - r->name = "QSplitter"; + r->name = "TQSplitter"; r->group = widgetGroup( "Temp" ); - r->includeFile = "qsplitter.h"; + r->includeFile = "tqsplitter.h"; r->isContainer = TRUE; append( r ); @@ -514,8 +514,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QMainWindow"; - r->includeFile = "qmainwindow.h"; + r->name = "TQMainWindow"; + r->includeFile = "tqmainwindow.h"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -524,7 +524,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; r->name = "QDesignerAction"; - r->includeFile = "qaction.h"; + r->includeFile = "tqaction.h"; r->group = widgetGroup( "Temp" ); r->isContainer = FALSE; @@ -533,7 +533,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; r->name = "QDesignerActionGroup"; - r->includeFile = "qaction.h"; + r->includeFile = "tqaction.h"; r->group = widgetGroup( "Temp" ); r->isContainer = FALSE; @@ -541,8 +541,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QScrollView"; - r->includeFile = "qscrollview.h"; + r->name = "TQScrollView"; + r->includeFile = "tqscrollview.h"; r->group = widgetGroup( "Temp" ); r->isContainer = TRUE; @@ -551,8 +551,8 @@ void WidgetDatabase::setupDataBase( int id ) #ifndef QT_NO_SQL r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QDataBrowser"; - r->includeFile = "qdatabrowser.h"; + r->name = "TQDataBrowser"; + r->includeFile = "tqdatabrowser.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Browser"; r->iconSet = "designer_databrowser.png"; @@ -562,8 +562,8 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "QDataView"; - r->includeFile = "qdataview.h"; + r->name = "TQDataView"; + r->includeFile = "tqdataview.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data View"; r->iconSet = "designer_dataview.png"; @@ -582,8 +582,8 @@ void WidgetDatabase::setupPlugins() if ( plugins_set_up ) return; plugins_set_up = TRUE; - QStringList widgets = widgetManager()->featureList(); - for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { + TQStringList widgets = widgetManager()->featureList(); + for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { if ( hasWidget( *it ) ) continue; WidgetDatabaseRecord *r = new WidgetDatabaseRecord; @@ -593,11 +593,11 @@ void WidgetDatabase::setupPlugins() continue; #ifndef UIC - QIconSet icon = iface->iconSet( *it ); + TQIconSet icon = iface->iconSet( *it ); if ( !icon.pixmap().isNull() ) - r->icon = new QIconSet( icon ); + r->icon = new TQIconSet( icon ); #endif - QString grp = iface->group( *it ); + TQString grp = iface->group( *it ); if ( grp.isEmpty() ) grp = "3rd party widgets"; r->group = widgetGroup( grp ); @@ -636,24 +636,24 @@ int WidgetDatabase::startCustom() Returns the iconset which represents the class registered as \a id. */ -QIconSet WidgetDatabase::iconSet( int id ) +TQIconSet WidgetDatabase::iconSet( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QIconSet(); + return TQIconSet(); #if !defined(UIC) && !defined(RESOURCE) if ( !r->icon ) { if ( r->iconSet.isEmpty() ) - return QIconSet(); - QPixmap pix = BarIcon( r->iconSet, KDevDesignerPartFactory::instance() ); + return TQIconSet(); + TQPixmap pix = BarIcon( r->iconSet, KDevDesignerPartFactory::instance() ); if ( pix.isNull() ) - pix = QPixmap( r->iconSet ); - r->icon = new QIconSet( pix ); + pix = TQPixmap( r->iconSet ); + r->icon = new TQIconSet( pix ); } return *r->icon; #else - return QIconSet(); + return TQIconSet(); #endif } @@ -661,12 +661,12 @@ QIconSet WidgetDatabase::iconSet( int id ) Returns the classname of the widget which is registered as \a id. */ -QString WidgetDatabase::className( int id ) +TQString WidgetDatabase::className( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->name; } @@ -674,12 +674,12 @@ QString WidgetDatabase::className( int id ) Returns the group the widget registered as \a id belongs to. */ -QString WidgetDatabase::group( int id ) +TQString WidgetDatabase::group( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->group; } @@ -687,12 +687,12 @@ QString WidgetDatabase::group( int id ) Returns the tooltip text of the widget which is registered as \a id. */ -QString WidgetDatabase::toolTip( int id ) +TQString WidgetDatabase::toolTip( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->toolTip; } @@ -700,12 +700,12 @@ QString WidgetDatabase::toolTip( int id ) Returns the what's this? text of the widget which is registered as \a id. */ -QString WidgetDatabase::whatsThis( int id ) +TQString WidgetDatabase::whatsThis( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; return r->whatsThis; } @@ -713,12 +713,12 @@ QString WidgetDatabase::whatsThis( int id ) Returns the include file if the widget which is registered as \a id. */ -QString WidgetDatabase::includeFile( int id ) +TQString WidgetDatabase::includeFile( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return QString::null; + return TQString::null; if ( r->includeFile.isNull() ) return r->name.lower() + ".h"; return r->includeFile; @@ -756,10 +756,10 @@ bool WidgetDatabase::isCommon( int id ) return r->isCommon; } -QString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase( id ); - QString n = className( id ); + TQString n = className( id ); if ( n == "QLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] ) @@ -771,14 +771,14 @@ QString WidgetDatabase::createWidgetName( int id ) WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += QString::number( ++r->nameCounter ); + n += TQString::number( ++r->nameCounter ); n[0] = n[0].lower(); return n; } /*! Returns the id for \a name or -1 if \a name is unknown. */ -int WidgetDatabase::idFromClassName( const QString &name ) +int WidgetDatabase::idFromClassName( const TQString &name ) { setupDataBase( -1 ); if ( name.isEmpty() ) @@ -797,7 +797,7 @@ int WidgetDatabase::idFromClassName( const QString &name ) return -1; } -bool WidgetDatabase::hasWidget( const QString &name ) +bool WidgetDatabase::hasWidget( const TQString &name ) { return className2Id->find( name ) != 0; } @@ -830,14 +830,14 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r ) insert( dbcount++, r ); } -QString WidgetDatabase::widgetGroup( const QString &g ) +TQString WidgetDatabase::widgetGroup( const TQString &g ) { if ( wGroups->find( g ) == -1 ) wGroups->append( g ); return g; } -bool WidgetDatabase::isGroupEmpty( const QString &grp ) +bool WidgetDatabase::isGroupEmpty( const TQString &grp ) { WidgetDatabaseRecord *r = 0; for ( int i = 0; i < dbcount; ++i ) { @@ -849,12 +849,12 @@ bool WidgetDatabase::isGroupEmpty( const QString &grp ) return TRUE; } -QString WidgetDatabase::widgetGroup( int i ) +TQString WidgetDatabase::widgetGroup( int i ) { setupDataBase( -1 ); if ( i >= 0 && i < (int)wGroups->count() ) return wGroups->at( i ); - return QString::null; + return TQString::null; } int WidgetDatabase::numWidgetGroups() @@ -863,7 +863,7 @@ int WidgetDatabase::numWidgetGroups() return wGroups->count(); } -bool WidgetDatabase::isGroupVisible( const QString &g ) +bool WidgetDatabase::isGroupVisible( const TQString &g ) { setupDataBase( -1 ); return invisibleGroups->find( g ) == -1; @@ -875,8 +875,8 @@ int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r ) return dbcustomcount - 1; } -void WidgetDatabase::customWidgetClassNameChanged( const QString &oldName, - const QString &newName ) +void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName, + const TQString &newName ) { int id = idFromClassName( oldName ); if ( id == -1 ) @@ -908,16 +908,16 @@ bool WidgetDatabase::isWhatsThisLoaded() return whatsThisLoaded; } -void WidgetDatabase::loadWhatsThis( const QString &docPath ) +void WidgetDatabase::loadWhatsThis( const TQString &docPath ) { - QString whatsthisFile = docPath + "/whatsthis"; - QFile f( whatsthisFile ); + TQString whatsthisFile = docPath + "/whatsthis"; + TQFile f( whatsthisFile ); if ( !f.open( IO_ReadOnly ) ) return; - QTextStream ts( &f ); + TQTextStream ts( &f ); while ( !ts.atEnd() ) { - QString s = ts.readLine(); - QStringList l = QStringList::split( " | ", s ); + TQString s = ts.readLine(); + TQStringList l = TQStringList::split( " | ", s ); int id = idFromClassName( l[ 1 ] ); WidgetDatabaseRecord *r = at( id ); if ( r ) @@ -930,27 +930,27 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath ) // ### Qt 3.1: make these publically accessible via QWidgetDatabase API #if defined(UIC) bool dbnounload = FALSE; -QStringList *dbpaths = 0; +TQStringList *dbpaths = 0; #else -extern QString *qwf_plugin_dir; +extern TQString *qwf_plugin_dir; #endif QPluginManager *widgetManager() { if ( !widgetPluginManager ) { - QString pluginDir = "/designer"; + TQString pluginDir = "/designer"; #if !defined(UIC) if ( qwf_plugin_dir ) pluginDir = *qwf_plugin_dir; #endif - widgetPluginManager = new QPluginManager( IID_Widget, QApplication::libraryPaths(), pluginDir ); + widgetPluginManager = new QPluginManager( IID_Widget, TQApplication::libraryPaths(), pluginDir ); cleanup_manager.add( &widgetPluginManager ); #if defined(UIC) if ( dbnounload ) widgetPluginManager->setAutoUnload( FALSE ); if ( dbpaths ) { - QStringList::ConstIterator it = dbpaths->begin(); + TQStringList::ConstIterator it = dbpaths->begin(); for ( ; it != dbpaths->end(); ++it ) widgetPluginManager->addLibraryPath( *it ); } diff --git a/kdevdesigner/shared/widgetdatabase.h b/kdevdesigner/shared/widgetdatabase.h index 03060fa3..a41728fb 100644 --- a/kdevdesigner/shared/widgetdatabase.h +++ b/kdevdesigner/shared/widgetdatabase.h @@ -27,8 +27,8 @@ #ifndef WIDGETDATABASE_H #define WIDGETDATABASE_H -#include -#include +#include +#include #include "../interfaces/widgetinterface.h" // up here for GCC 2.7.* compatibility #include @@ -39,12 +39,12 @@ struct WidgetDatabaseRecord { WidgetDatabaseRecord(); ~WidgetDatabaseRecord(); - QString iconSet, name, group, toolTip, whatsThis, includeFile; + TQString iconSet, name, group, toolTip, whatsThis, includeFile; uint isContainer : 1; uint isForm : 1; uint isCommon : 1; uint isPlugin : 1; - QIconSet *icon; + TQIconSet *icon; int nameCounter; }; @@ -58,38 +58,38 @@ public: static int count(); static int startCustom(); - static QIconSet iconSet( int id ); - static QString className( int id ); - static QString group( int id ); - static QString toolTip( int id ); - static QString whatsThis( int id ); - static QString includeFile( int id ); + static TQIconSet iconSet( int id ); + static TQString className( int id ); + static TQString group( int id ); + static TQString toolTip( int id ); + static TQString whatsThis( int id ); + static TQString includeFile( int id ); static bool isForm( int id ); static bool isContainer( int id ); static bool isCommon( int id ); - static int idFromClassName( const QString &name ); - static QString createWidgetName( int id ); + static int idFromClassName( const TQString &name ); + static TQString createWidgetName( int id ); static WidgetDatabaseRecord *at( int index ); static void insert( int index, WidgetDatabaseRecord *r ); static void append( WidgetDatabaseRecord *r ); - static QString widgetGroup( const QString &g ); - static QString widgetGroup( int i ); + static TQString widgetGroup( const TQString &g ); + static TQString widgetGroup( int i ); static int numWidgetGroups(); - static bool isGroupVisible( const QString &g ); - static bool isGroupEmpty( const QString &grp ); + static bool isGroupVisible( const TQString &g ); + static bool isGroupEmpty( const TQString &grp ); static int addCustomWidget( WidgetDatabaseRecord *r ); static bool isCustomWidget( int id ); static bool isCustomPluginWidget( int id ); static bool isWhatsThisLoaded(); - static void loadWhatsThis( const QString &docPath ); + static void loadWhatsThis( const TQString &docPath ); - static bool hasWidget( const QString &name ); - static void customWidgetClassNameChanged( const QString &oldName, const QString &newName ); + static bool hasWidget( const TQString &name ); + static void customWidgetClassNameChanged( const TQString &oldName, const TQString &newName ); }; -- cgit v1.2.1