diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
commit | 479f5f799523bffbcc83dff581a2299c047c6fff (patch) | |
tree | 186aae707ed02aac6c7cab2fb14e97f72aca5e36 /qtruby/rubylib/designer/rbuic | |
parent | f1dbff6145c98324ff82e34448b7483727e8ace4 (diff) | |
download | tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtruby/rubylib/designer/rbuic')
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.cpp | 166 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.h | 26 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/embed.cpp | 52 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/form.cpp | 218 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/globaldefs.h | 14 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/main.cpp | 52 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/object.cpp | 168 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.cpp | 26 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.h | 4 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/subclassing.cpp | 48 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.cpp | 404 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.h | 194 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.cpp | 180 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.h | 36 |
14 files changed, 794 insertions, 794 deletions
diff --git a/qtruby/rubylib/designer/rbuic/domtool.cpp b/qtruby/rubylib/designer/rbuic/domtool.cpp index 1c30486f..65ea3a71 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.cpp +++ b/qtruby/rubylib/designer/rbuic/domtool.cpp @@ -26,14 +26,14 @@ #include "domtool.h" -#include <qsizepolicy.h> -#include <qcolor.h> -#include <qcursor.h> -#include <qdatetime.h> -#include <qrect.h> -#include <qsize.h> -#include <qfont.h> -#include <qdom.h> +#include <tqsizepolicy.h> +#include <tqcolor.h> +#include <tqcursor.h> +#include <tqdatetime.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqfont.h> +#include <tqdom.h> /*! \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/qtruby/rubylib/designer/rbuic/domtool.h b/qtruby/rubylib/designer/rbuic/domtool.h index 61b4269a..e83e106b 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.h +++ b/qtruby/rubylib/designer/rbuic/domtool.h @@ -27,8 +27,8 @@ #ifndef DOMTOOL_H #define DOMTOOL_H -#include <qvariant.h> -#include <qnamespace.h> +#include <tqvariant.h> +#include <tqnamespace.h> 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/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp index 89985968..a1cf0a3f 100644 --- a/qtruby/rubylib/designer/rbuic/embed.cpp +++ b/qtruby/rubylib/designer/rbuic/embed.cpp @@ -35,14 +35,14 @@ **********************************************************************/ #include "uic.h" -#include <qfile.h> -#include <qimage.h> -#include <qstringlist.h> -#include <qdatetime.h> -#include <qfileinfo.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqstringlist.h> +#include <tqdatetime.h> +#include <tqfileinfo.h> #define NO_STATIC_COLORS #include <globaldefs.h> -#include <qregexp.h> +#include <tqregexp.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -52,14 +52,14 @@ struct EmbedImage int width, height, depth; int numColors; QRgb* colorTable; - QString name; - QString cname; + TQString name; + TQString cname; bool alpha; }; -static QString convertToCIdentifier( const char *s ) +static TQString convertToCIdentifier( const char *s ) { - QString r = s; + TQString r = s; int len = r.length(); if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) r[0] = '_'; @@ -71,16 +71,16 @@ static QString convertToCIdentifier( const char *s ) } -static ulong embedData( QTextStream& out, const uchar* input, int nbytes ) +static ulong embedData( TQTextStream& out, const uchar* input, int nbytes ) { #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION - QByteArray bazip( qCompress( input, nbytes ) ); + TQByteArray bazip( qCompress( input, nbytes ) ); ulong len = bazip.size(); #else ulong len = nbytes; #endif static const char hexdigits[] = "0123456789abcdef"; - QString s; + TQString s; for ( int i=0; i<(int)len; i++ ) { if ( (i%14) == 0 ) { s += "\n "; @@ -105,7 +105,7 @@ static ulong embedData( QTextStream& out, const uchar* input, int nbytes ) return len; } -static void embedData( QTextStream& out, const QRgb* input, int n ) +static void embedData( TQTextStream& out, const QRgb* input, int n ) { out << hex; const QRgb *v = input; @@ -120,19 +120,19 @@ static void embedData( QTextStream& out, const QRgb* input, int n ) out << dec; // back to decimal mode } -void Uic::embed( QTextStream& out, const char* project, const QStringList& images ) +void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images ) { - QString cProject = convertToCIdentifier( project ); + TQString cProject = convertToCIdentifier( project ); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; out << "# Image collection for project '" << project << "'." << endl; out << "#" << endl; out << "# Generated from reading image files: " << endl; for ( it = images.begin(); it != images.end(); ++it ) out << "# " << *it << endl; out << "#" << endl; - out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# Created: " << TQDateTime::currentDateTime().toString() << endl; out << "# by: The QtRuby User Interface Compiler (rbuic)" << endl; out << "#" << endl; out << "# WARNING! All changes made in this file will be lost!" << endl; @@ -147,10 +147,10 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image out << indent << "class MimeSourceFactory_" << cProject << " < Qt::MimeSourceFactory" << endl; out << endl; - QPtrList<EmbedImage> list_image; + TQPtrList<EmbedImage> list_image; int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { - QImage img; + TQImage img; if ( !img.load( *it ) ) { fprintf( stderr, "rbuic: cannot load image file %s\n", (*it).latin1() ); continue; @@ -163,16 +163,16 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image e->colorTable = new QRgb[e->numColors]; e->alpha = img.hasAlphaBuffer(); memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb)); - QFileInfo fi( *it ); + TQFileInfo fi( *it ); e->name = fi.fileName(); - e->cname = QString("@@image_%1").arg( image_count++); + e->cname = TQString("@@image_%1").arg( image_count++); list_image.append( e ); out << "# " << *it << endl; - QString imgname = (const char *)e->cname; + TQString imgname = (const char *)e->cname; - QString s; + TQString s; if ( e->depth == 1 ) - img = img.convertBitOrder(QImage::BigEndian); + img = img.convertBitOrder(TQImage::BigEndian); out << indent << imgname << "_data = ["; embedData( out, img.bits(), img.numBytes() ); out << "]\n\n"; @@ -192,7 +192,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image { out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, " << e->width << ", " << e->height << ", " << e->depth << ", " - << (e->numColors ? e->cname + "_ctable" : QString::fromLatin1( "[]" ) ) << ", " + << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", " << (e->alpha ? "true" : "false") << "]," << endl; e = list_image.next(); } diff --git a/qtruby/rubylib/designer/rbuic/form.cpp b/qtruby/rubylib/designer/rbuic/form.cpp index 7efbacd1..d6c842c0 100644 --- a/qtruby/rubylib/designer/rbuic/form.cpp +++ b/qtruby/rubylib/designer/rbuic/form.cpp @@ -32,17 +32,17 @@ #include "widgetdatabase.h" #include "domtool.h" -#include <qstringlist.h> -#include <qregexp.h> -#include <qfile.h> -#include <qfileinfo.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqfile.h> +#include <tqfileinfo.h> #define NO_STATIC_COLORS #include <globaldefs.h> #include <zlib.h> -static QByteArray unzipXPM( QString data, ulong& length ) +static TQByteArray unzipXPM( TQString data, ulong& length ) { const int lengthOffset = 4; int baSize = data.length() / 2 + lengthOffset; @@ -68,13 +68,13 @@ static QByteArray unzipXPM( QString data, ulong& length ) ba[1] = ( length & 0x00ff0000 ) >> 16; ba[2] = ( length & 0x0000ff00 ) >> 8; ba[3] = ( length & 0x000000ff ); - QByteArray baunzip = qUncompress( ba, baSize ); + TQByteArray baunzip = qUncompress( ba, baSize ); delete[] ba; return baunzip; } -static QString imageDataName(QString name) { - QString result = name + "_data"; +static TQString imageDataName(TQString name) { + TQString result = name + "_data"; result.replace("@", "@@"); return result; } @@ -84,15 +84,15 @@ static QString imageDataName(QString name) { \sa createFormDecl(), createObjectImpl() */ -void Uic::createFormImpl( const QDomElement &e ) +void Uic::createFormImpl( const TQDomElement &e ) { - QDomElement n; - QDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - QString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - QString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if (hasKDEwidget) { out << indent << "require 'Korundum'" << endl << endl; @@ -101,16 +101,16 @@ void Uic::createFormImpl( const QDomElement &e ) } // generate local and local includes required - QStringList globalIncludes, localIncludes; - QStringList::Iterator it; - QStringList sqlClasses; + TQStringList globalIncludes, localIncludes; + TQStringList::Iterator it; + TQStringList sqlClasses; - QMap<QString, CustomInclude> customWidgetIncludes; - QMap<QString, QString> functionImpls; + TQMap<TQString, CustomInclude> customWidgetIncludes; + TQMap<TQString, TQString> functionImpls; // find additional slots - QStringList extraSlots; - QStringList extraSlotTypes; + TQStringList extraSlots; + TQStringList extraSlotTypes; nl = e.parentNode().toElement().elementsByTagName( "slot" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -119,7 +119,7 @@ void Uic::createFormImpl( const QDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - QString slotName = n.firstChild().toText().data().stripWhiteSpace(); + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); if ( slotName.endsWith( ";" ) ) slotName = slotName.left( slotName.length() - 1 ); @@ -128,7 +128,7 @@ void Uic::createFormImpl( const QDomElement &e ) } // find signals - QStringList extraSignals; + TQStringList extraSignals; nl = e.parentNode().toElement().elementsByTagName( "signal" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -137,19 +137,19 @@ void Uic::createFormImpl( const QDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - QString sigName = n.firstChild().toText().data().stripWhiteSpace(); + TQString sigName = n.firstChild().toText().data().stripWhiteSpace(); if ( sigName.endsWith( ";" ) ) sigName = sigName.left( sigName.length() - 1 ); extraSignals += sigName; } //find additional functions - QStringList extraFunctions; + TQStringList extraFunctions; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "functions" ) { // compatibility - for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "function" ) { - QString fname; + TQString fname; if( !n2.attribute("name").isNull() ) { fname = n2.attribute( "name" ); @@ -165,11 +165,11 @@ void Uic::createFormImpl( const QDomElement &e ) } } } else if ( n.tagName() == "customwidgets" ) { - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "customwidget" ) { - QDomElement n3 = n2.firstChild().toElement(); - QString cl, header; + TQDomElement n3 = n2.firstChild().toElement(); + TQString cl, header; WidgetDatabaseRecord *r = new WidgetDatabaseRecord; while ( !n3.isNull() ) { if ( n3.tagName() == "class" ) { @@ -253,7 +253,7 @@ void Uic::createFormImpl( const QDomElement &e ) ++indent; // additional attributes (from Designer) - QStringList publicVars, protectedVars, privateVars; + TQStringList publicVars, protectedVars, privateVars; nl = e.parentNode().toElement().elementsByTagName( "variable" ); for ( i = 0; i < (int)nl.length(); i++ ) { n = nl.item( i ).toElement(); @@ -261,8 +261,8 @@ void Uic::createFormImpl( const QDomElement &e ) // Someday it should be uncommented. //if ( n.parentNode().toElement().tagName() != "variables" ) // continue; - QString access = n.attribute( "access", "protected" ); - QString var = n.firstChild().toText().data().stripWhiteSpace(); + TQString access = n.attribute( "access", "protected" ); + TQString var = n.firstChild().toText().data().stripWhiteSpace(); if ( var.endsWith( ";" ) ) var.truncate(var.length() - 1); if ( access == "public" ) @@ -288,10 +288,10 @@ void Uic::createFormImpl( const QDomElement &e ) // additional includes (local or global ) and forward declaractions nl = e.parentNode().toElement().elementsByTagName( "include" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QDomElement n2 = nl.item(i).toElement(); - QString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) != "local" ) { - if ( s.right( 5 ) == ".ui.h" && !QFile::exists( s ) ) + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) continue; if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) continue; @@ -301,10 +301,10 @@ void Uic::createFormImpl( const QDomElement &e ) // do the local includes afterwards, since global includes have priority on clashes for ( i = 0; i < (int) nl.length(); i++ ) { - QDomElement n2 = nl.item(i).toElement(); - QString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) { - if ( s.right( 5 ) == ".ui.h" && !QFile::exists( s ) ) + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) continue; if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) continue; @@ -315,8 +315,8 @@ void Uic::createFormImpl( const QDomElement &e ) // additional custom widget headers nl = e.parentNode().toElement().elementsByTagName( "header" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QDomElement n2 = nl.item(i).toElement(); - QString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) != "local" ) globalIncludes += s; else @@ -325,17 +325,17 @@ void Uic::createFormImpl( const QDomElement &e ) // grab slots/funcs defined in ui.h files - for(QStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) + for(TQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) { if((*it).right( 5 ) == ".ui.h") { - QFile f((*it)); + TQFile f((*it)); if( f.open( IO_ReadOnly ) ) { - QRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$"); - QRegExp re2("^end\\s*$"); - QTextStream t( &f ); - QString s, s2, s3; + TQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$"); + TQRegExp re2("^end\\s*$"); + TQTextStream t( &f ); + TQString s, s2, s3; while ( !t.eof() ) { s = t.readLine(); @@ -366,17 +366,17 @@ void Uic::createFormImpl( const QDomElement &e ) for ( it = tags.begin(); it != tags.end(); ++it ) { nl = e.parentNode().toElement().elementsByTagName( *it ); for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget - QString name = getClassName( nl.item(i).toElement() ); + TQString name = getClassName( nl.item(i).toElement() ); if ( name == "Spacer" ) { - globalIncludes += "qlayout.h"; - globalIncludes += "qapplication.h"; + globalIncludes += "tqlayout.h"; + globalIncludes += "tqapplication.h"; continue; } if ( name.mid( 4 ) == "ListView" ) - globalIncludes += "qheader.h"; + globalIncludes += "tqheader.h"; if ( name != objClass ) { - int wid = WidgetDatabase::idFromClassName( name.replace( QRegExp("^Qt::"), "Q" ) ); - QMap<QString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); + int wid = WidgetDatabase::idFromClassName( name.replace( TQRegExp("^Qt::"), "Q" ) ); + TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); if ( it == customWidgetIncludes.end() ) globalIncludes += WidgetDatabase::includeFile( wid ); } @@ -405,34 +405,34 @@ void Uic::createFormImpl( const QDomElement &e ) sqlClasses += "Qt::SqlRecord"; } - if (globalIncludes.findIndex("qdatatable.h") >= 0) + if (globalIncludes.findIndex("tqdatatable.h") >= 0) sqlClasses += "Qt::DataTable"; if (globalIncludes.findIndex("qtableview.h") >= 0) sqlClasses += "Qt::TableView"; - if (globalIncludes.findIndex("qdatabrowser.h") >= 0) + if (globalIncludes.findIndex("tqdatabrowser.h") >= 0) sqlClasses += "Qt::DataBrowser"; out << endl; // find out what images are required - QStringList requiredImages; + TQStringList requiredImages; static const char *imgTags[] = { "pixmap", "iconset", 0 }; for ( i = 0; imgTags[i] != 0; i++ ) { nl = e.parentNode().toElement().elementsByTagName( imgTags[i] ); for ( int j = 0; j < (int) nl.length(); j++ ) { - QString img = "@"; + TQString img = "@"; requiredImages += (img + nl.item(j).firstChild().toText().data()); } } // register the object and unify its name - QString loadFunction(objName); + TQString loadFunction(objName); objName = registerObject( objName ); - QStringList images; - QStringList xpmImages; + TQStringList images; + TQStringList xpmImages; if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { // create images @@ -443,19 +443,19 @@ void Uic::createFormImpl( const QDomElement &e ) nl = n.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); + TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); if ( !requiredImages.contains( img ) ) continue; - QDomElement tmp = nl.item(i).firstChild().toElement(); + TQDomElement tmp = nl.item(i).firstChild().toElement(); if ( tmp.tagName() != "data" ) continue; - QString format = tmp.attribute("format", "PNG" ); - QString data = tmp.firstChild().toText().data(); + TQString format = tmp.attribute("format", "PNG" ); + TQString data = tmp.firstChild().toText().data(); if ( format == "XPM.GZ" ) { xpmImages += img; ulong length = tmp.attribute("length").toULong(); - QByteArray baunzip = unzipXPM( data, length ); + TQByteArray baunzip = unzipXPM( data, length ); // shouldn't we test the initial `length' against the // resulting `length' to catch corrupt UIC files? int a = 0; @@ -484,13 +484,13 @@ void Uic::createFormImpl( const QDomElement &e ) ++indent; int a ; for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << ","; + out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ","; if ( a % 12 == 11 ) out << endl << " "; else out << " "; } - out << "0x" << QString(data[2*a]) << QString(data[2*a+1]) << " ].pack \"C*\"" << endl; + out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << " ].pack \"C*\"" << endl; --indent; out << endl; } @@ -548,7 +548,7 @@ void Uic::createFormImpl( const QDomElement &e ) // create pixmaps for all images if ( !images.isEmpty() ) { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = images.begin(); it != images.end(); ++it ) { out << indent << (*it) << " = Qt::Pixmap.new()" << endl; out << indent << (*it) << ".loadFromData(" << imageDataName(*it) << ", " << imageDataName(*it) << ".length, \"PNG\")" << endl; @@ -567,21 +567,21 @@ void Uic::createFormImpl( const QDomElement &e ) out << indent << "statusBar()" << endl; // set the properties - QSize geometry( 0, 0 ); + TQSize geometry( 0, 0 ); for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - QString prop = n.attribute("name"); - QDomElement n2 = n.firstChild().toElement(); - QString value = setObjectProperty( objClass, QString::null, prop, n2, stdset ); + TQString prop = n.attribute("name"); + TQDomElement n2 = n.firstChild().toElement(); + TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset ); if ( value.isEmpty() ) continue; if ( prop == "geometry" && n2.tagName() == "rect") { - QDomElement n3 = n2.firstChild().toElement(); + TQDomElement n3 = n2.firstChild().toElement(); while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) geometry.setWidth( n3.firstChild().toText().data().toInt() ); @@ -590,7 +590,7 @@ void Uic::createFormImpl( const QDomElement &e ) n3 = n3.nextSibling().toElement(); } } else { - QString call; + TQString call; if ( stdset ) { call = mkStdSet( prop ) + "(" + value + ")"; } else { @@ -620,12 +620,12 @@ void Uic::createFormImpl( const QDomElement &e ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, "self" ); - QString comment; - QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + TQString page = createObjectImpl( n, objClass, "self" ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); out << indent << "addPage(" << page << ", "<< trcall( label ) << ")" << endl; trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " )" << endl; - QVariant def( false, 0 ); + TQVariant def( false, 0 ); if ( DomTool::hasAttribute( n, "backEnabled" ) ) out << indent << "setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ");" << endl; if ( DomTool::hasAttribute( n, "nextEnabled" ) ) @@ -661,13 +661,13 @@ void Uic::createFormImpl( const QDomElement &e ) nl = e.parentNode().toElement().elementsByTagName( "widget" ); for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget n = nl.item(i).toElement(); - QString s = getClassName( n ); + TQString s = getClassName( n ); if ( s == "Qt::DataBrowser" || s == "Qt::DataView" ) { - QString objName = getObjectName( n ); - QString tab = getDatabaseInfo( n, "table" ); - QString con = getDatabaseInfo( n, "connection" ); + TQString objName = getObjectName( n ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString con = getDatabaseInfo( n, "connection" ); out << indent << objName << "Form = Qt::SqlForm.new(self, \"" << objName << "Form\")" << endl; - QDomElement n2; + TQDomElement n2; for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) createFormImpl( n2, objName, con, tab ); out << indent << objName << ".setForm(" << objName << "Form)" << endl; @@ -724,8 +724,8 @@ void Uic::createFormImpl( const QDomElement &e ) out << endl; nl = n.elementsByTagName( "connection" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QString sender, receiver, signal, slot; - for ( QDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + TQString sender, receiver, signal, slot; + for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "sender" ) sender = n2.firstChild().toText().data(); else if ( n2.tagName() == "receiver" ) @@ -751,16 +751,16 @@ void Uic::createFormImpl( const QDomElement &e ) receiver = "self"; out << indent << "Qt::Object.connect(" << sender - << ", SIGNAL(\"" << signal << "\"), "<< receiver << ", SLOT(\"" << slot << "\") )" << endl; + << ", TQT_SIGNAL(\"" << signal << "\"), "<< receiver << ", TQT_SLOT(\"" << slot << "\") )" << endl; } } else if ( n.tagName() == "tabstops" ) { // setup tab order out << endl; - QString lastName; - QDomElement n2 = n.firstChild().toElement(); + TQString lastName; + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "tabstop" ) { - QString name = n2.firstChild().toText().data(); + TQString name = n2.firstChild().toText().data(); name = registeredName( name ); if ( !lastName.isEmpty() ) out << indent << "setTabOrder(" << lastName << ", " << name << ")" << endl; @@ -774,7 +774,7 @@ void Uic::createFormImpl( const QDomElement &e ) // QtRuby - FIXME: what the heck is this ? // buddies bool firstBuddy = true; - for ( QValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { if ( isObjectRegistered( (*buddy).buddy ) ) { if ( firstBuddy ) { out << endl; @@ -803,7 +803,7 @@ void Uic::createFormImpl( const QDomElement &e ) for ( i = 0; i < (int) nl.length(); i++ ) { if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) needFontEventHandler = true; - QString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "Qt::DataTable" || s == "Qt::DataBrowser" ) { if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) continue; @@ -832,7 +832,7 @@ void Uic::createFormImpl( const QDomElement &e ) out << " if ev.type() == Qt::Event::ApplicationFontChange " << endl; for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); - QStringList list = DomTool::propertiesOfType( n, "font" ); + TQStringList list = DomTool::propertiesOfType( n, "font" ); for ( it = list.begin(); it != list.end(); ++it ) createExclusiveProperty( n, *it ); } @@ -854,12 +854,12 @@ void Uic::createFormImpl( const QDomElement &e ) ++indent; if ( needSqlTableEventHandler ) { for ( i = 0; i < (int) nl.length(); i++ ) { - QString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "Qt::DataTable" ) { n = nl.item(i).toElement(); - QString c = QString("@") + getObjectName( n ); - QString conn = getDatabaseInfo( n, "connection" ); - QString tab = getDatabaseInfo( n, "table" ); + TQString c = TQString("@") + getObjectName( n ); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); if ( !( conn.isEmpty() || tab.isEmpty() ) ) { out << indent << "if " << "!" << c << ".nil?" << endl; ++indent; @@ -894,12 +894,12 @@ void Uic::createFormImpl( const QDomElement &e ) if ( needSqlDataBrowserEventHandler ) { nl = e.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "Qt::DataBrowser" ) { - QString obj = getObjectName( nl.item(i).toElement() ); - QString tab = getDatabaseInfo( nl.item(i).toElement(), + TQString obj = getObjectName( nl.item(i).toElement() ); + TQString tab = getDatabaseInfo( nl.item(i).toElement(), "table" ); - QString conn = getDatabaseInfo( nl.item(i).toElement(), + TQString conn = getDatabaseInfo( nl.item(i).toElement(), "connection" ); if ( !(tab).isEmpty() ) { out << indent << "if " << obj << endl; @@ -942,11 +942,11 @@ void Uic::createFormImpl( const QDomElement &e ) int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; bool createWarning = true; - QString fname = Parser::cleanArgs( *it ); - QMap<QString, QString>::Iterator fit = functionImpls.find( fname ); + TQString fname = Parser::cleanArgs( *it ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); createWarning = body.simplifyWhiteSpace().isEmpty(); if ( !createWarning ) out << body << endl; @@ -967,11 +967,11 @@ void Uic::createFormImpl( const QDomElement &e ) out << endl; int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; - QString fname = Parser::cleanArgs( *it ); - QMap<QString, QString>::Iterator fit = functionImpls.find( fname ); + TQString fname = Parser::cleanArgs( *it ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); body.simplifyWhiteSpace().isEmpty(); out << body << endl; } @@ -992,17 +992,17 @@ void Uic::createFormImpl( const QDomElement &e ) Traverses recursively over all children. */ -void Uic::createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table ) +void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ) { if ( e.tagName() == "widget" && e.attribute( "class" ) != "Qt::DataTable" ) { - QString field = getDatabaseInfo( e, "field" ); + TQString field = getDatabaseInfo( e, "field" ); if ( !field.isEmpty() ) { if ( isWidgetInTable( e, connection, table ) ) out << indent << form << "Form.insert(" << getObjectName( e ) << ", " << fixString( field ) << ")" << endl; } } - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { createFormImpl( n, form, connection, table ); } @@ -1011,7 +1011,7 @@ void Uic::createFormImpl( const QDomElement& e, const QString& form, const QStri // Generate a QtRuby signal/slot definition. -void Uic::rubySlot(QStringList::Iterator &it) +void Uic::rubySlot(TQStringList::Iterator &it) { out << indent << "'" << (*it) << "'"; } diff --git a/qtruby/rubylib/designer/rbuic/globaldefs.h b/qtruby/rubylib/designer/rbuic/globaldefs.h index cc6ed400..aebf63c3 100644 --- a/qtruby/rubylib/designer/rbuic/globaldefs.h +++ b/qtruby/rubylib/designer/rbuic/globaldefs.h @@ -21,23 +21,23 @@ #ifndef GLOBALDEFS_H #define GLOBALDEFS_H -#include <qcolor.h> +#include <tqcolor.h> #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() { if ( backColor1 ) return; - backColor1 = new QColor( 236, 245, 255 ); - backColor2 = new QColor( 250, 250, 250 ); - selectedBack = new QColor( 221, 221, 221 ); + backColor1 = new TQColor( 236, 245, 255 ); + backColor2 = new TQColor( 250, 250, 250 ); + selectedBack = new TQColor( 221, 221, 221 ); } #endif diff --git a/qtruby/rubylib/designer/rbuic/main.cpp b/qtruby/rubylib/designer/rbuic/main.cpp index a80d8785..4bebf46c 100644 --- a/qtruby/rubylib/designer/rbuic/main.cpp +++ b/qtruby/rubylib/designer/rbuic/main.cpp @@ -36,19 +36,19 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include <qapplication.h> -#include <qfile.h> -#include <qstringlist.h> -#include <qdatetime.h> +#include <tqapplication.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqdatetime.h> #define NO_STATIC_COLORS #include <globaldefs.h> -#include <qregexp.h> +#include <tqregexp.h> #include <stdio.h> #include <stdlib.h> #include <zlib.h> #define RBUIC_VERSION "0.9" -void getDBConnections( Uic& uic, QString& s); +void getDBConnections( Uic& uic, TQString& s); int main( int argc, char * argv[] ) { @@ -56,7 +56,7 @@ int main( int argc, char * argv[] ) bool execCode = false; bool subcl = false; bool imagecollection = false; - QStringList images; + TQStringList images; const char *error = 0; const char* fileName = 0; const char* className = 0; @@ -66,14 +66,14 @@ int main( int argc, char * argv[] ) bool nofwd = false; bool useKDE = false; bool fix = false; - QApplication app(argc, argv, false); - QString uicClass; + TQApplication app(argc, argv, false); + TQString uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { - QCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - QCString opt = &arg[1]; + TQCString opt = &arg[1]; if ( opt[0] == 'o' ) { // output redirection if ( opt[1] == '\0' ) { if ( !(n < argc-1) ) { @@ -132,7 +132,7 @@ int main( int argc, char * argv[] ) error = "Missing indent"; break; } - tabstop = QCString(argv[++n]).toUInt(&ok); + tabstop = TQCString(argv[++n]).toUInt(&ok); } else tabstop = opt.mid(1).toUInt(&ok); @@ -185,7 +185,7 @@ int main( int argc, char * argv[] ) Uic::setIndent(indent); - QFile fileOut; + TQFile fileOut; if ( outputFile ) { fileOut.setName( outputFile ); if (!fileOut.open( IO_WriteOnly ) ) @@ -193,25 +193,25 @@ int main( int argc, char * argv[] ) } else { fileOut.open( IO_WriteOnly, stdout ); } - QTextStream out( &fileOut ); + TQTextStream out( &fileOut ); if ( imagecollection ) { - out.setEncoding( QTextStream::Latin1 ); + out.setEncoding( TQTextStream::Latin1 ); Uic::embed( out, projectName, images ); return 0; } - out.setEncoding( QTextStream::UnicodeUTF8 ); - QFile file( fileName ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "rbuic: Could not open file '%s' ", fileName ); - QDomDocument doc; - QString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; if ( !doc.setContent( &file, &errMsg, &errLine ) ) - qFatal( QString("rbuic: Failed to parse %s: ") + errMsg + QString (" in line %d\n"), fileName, errLine ); + qFatal( TQString("rbuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); DomTool::fixDocument( doc ); @@ -223,7 +223,7 @@ int main( int argc, char * argv[] ) if ( !subcl ) { out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; out << "#" << endl; - out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# Created: " << TQDateTime::currentDateTime().toString() << endl; out << "# by: The QtRuby User Interface Compiler (rbuic)" << endl; out << "#" << endl; out << "# WARNING! All changes made in this file will be lost!" << endl; @@ -244,10 +244,10 @@ int main( int argc, char * argv[] ) } else { out << indent << "a = Qt::Application.new(ARGV)" << endl; } - QString s; + TQString s; getDBConnections( uic, s); out << s; - out << indent << "w = " << (subcl? QString::fromLatin1(className) : uicClass) << ".new" << endl; + out << indent << "w = " << (subcl? TQString::fromLatin1(className) : uicClass) << ".new" << endl; out << indent << "a.mainWidget = w" << endl; out << indent << "w.show" << endl; out << indent << "a.exec" << endl; @@ -258,12 +258,12 @@ int main( int argc, char * argv[] ) return 0; } -void getDBConnections( Uic& uic, QString& s) +void getDBConnections( Uic& uic, TQString& s) { int num = 0; - for ( QStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) { + for ( TQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) { if ( !(*it).isEmpty()) { - QString inc = (num ? QString::number(num+1) : QString::null); + TQString inc = (num ? TQString::number(num+1) : TQString::null); s += "\n # Connection to database " + (*it) + "\n\n"; s += " DRIVER" + inc + " =\t\t'QMYSQL3'" + (inc?"":" # appropriate driver") + "\n"; s += " DATABASE" + inc + " =\t\t'foo'" + (inc?"":" # name of your database") + "\n"; diff --git a/qtruby/rubylib/designer/rbuic/object.cpp b/qtruby/rubylib/designer/rbuic/object.cpp index ba8e38b7..2d05e0b6 100644 --- a/qtruby/rubylib/designer/rbuic/object.cpp +++ b/qtruby/rubylib/designer/rbuic/object.cpp @@ -27,9 +27,9 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include <qregexp.h> -#include <qsizepolicy.h> -#include <qstringlist.h> +#include <tqregexp.h> +#include <tqsizepolicy.h> +#include <tqstringlist.h> #define NO_STATIC_COLORS #include <globaldefs.h> #include <zlib.h> @@ -41,15 +41,15 @@ \sa createObjectImpl() */ -void Uic::createObjectDecl( const QDomElement& e ) +void Uic::createObjectDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { out << indent << registerObject(getLayoutName(e) ) << endl; } else { - QString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - QString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore QLayoutWidgets @@ -68,15 +68,15 @@ void Uic::createObjectDecl( const QDomElement& e ) Children are not traversed recursively. */ -void Uic::createAttrDecl( const QDomElement& e ) +void Uic::createAttrDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { // out << indent << registerObject(getLayoutName(e) ) << endl; } else { - QString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - QString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore QLayoutWidgets @@ -84,11 +84,11 @@ void Uic::createAttrDecl( const QDomElement& e ) return; // register the object and unify its name objName = registerObject( objName ); - QString attr(objName); - attr.replace(QChar('@'), "attr_reader :"); + TQString attr(objName); + attr.replace(TQChar('@'), "attr_reader :"); out << indent << attr << endl; - QDomElement n = getObjectProperty( e, "font"); + TQDomElement n = getObjectProperty( e, "font"); // if ( !n.isNull() ) // out << indent << objName + "_font" << endl; } @@ -107,17 +107,17 @@ void Uic::createAttrDecl( const QDomElement& e ) static bool createdCentralWidget = false; -QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& par, const QString& layout ) +TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) { - QString parent( par ); + TQString parent( par ); if ( parent == "self" && isMainWindow ) { if ( !createdCentralWidget ) out << indent << "setCentralWidget(Qt::Widget.new(self, \"qt_central_widget\"))" << endl; createdCentralWidget = true; parent = "centralWidget()"; } - QDomElement n; - QString objClass, objName, fullObjName; + TQDomElement n; + TQString objClass, objName, fullObjName; int numItems = 0; int numColumns = 0; int numRows = 0; @@ -130,7 +130,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, return objName; objName = getObjectName( e ); - QString definedName = objName; + TQString definedName = objName; bool isTmpObject = objName.isEmpty() || objClass == "Qt::LayoutWidget"; if ( isTmpObject ) { if ( objClass[0] == 'Q' ) @@ -148,10 +148,10 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( layout.isEmpty() ) { // register the object and unify its name objName = registerObject( objName ); - out << indent << (isTmpObject ? QString::fromLatin1("") : QString::null) << objName << " = Qt::Widget.new(" << parent << ", '" << objName << "')" << endl; + out << indent << (isTmpObject ? TQString::fromLatin1("") : TQString::null) << objName << " = Qt::Widget.new(" << parent << ", '" << objName << "')" << endl; } else { // the layout widget is not necessary, hide it by creating its child in the parent - QString result; + TQString result; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if (tags.contains( n.tagName() ) ) result = createObjectImpl( n, parentClass, parent, layout ); @@ -175,7 +175,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, fullObjName = objName; if ( objClass == "Qt::AxWidget" ) { - QString controlId; + TQString controlId; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) { controlId = n.firstChild().toElement().text(); @@ -193,10 +193,10 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - QString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop == "database" ) continue; - QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; if ( prop == "name" ) @@ -226,10 +226,10 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( prop == "frameworkCode" ) continue; if ( objClass == "Qt::MultiLineEdit" && - QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) continue; - QString call = fullObjName + "."; + TQString call = fullObjName + "."; if (! call.startsWith("@")) { call.prepend("@"); } @@ -249,8 +249,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, out << indent << call << endl; } } else if ( n.tagName() == "item" ) { - QString call; - QString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListBox" ) { call = createListBoxItemImpl( n, fullObjName, &value ); @@ -274,7 +274,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, trout << indent << call << endl; } } else if ( objClass.mid( 4 ) == "ListView" ) { - call = createListViewItemImpl( n, fullObjName, QString::null ); + call = createListViewItemImpl( n, fullObjName, TQString::null ); if ( !call.isEmpty() ) { if ( numItems == 0 ) trout << indent << fullObjName << ".clear()" << endl; @@ -284,8 +284,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( !call.isEmpty() ) numItems++; } else if ( n.tagName() == "column" || n.tagName() == "row" ) { - QString call; - QString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListView" ) { call = createListViewColumnImpl( n, fullObjName, &value ); @@ -314,9 +314,9 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, if ( objClass == "Qt::TabWidget" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, fullObjName ); - QString comment; - QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); out << indent << fullObjName << ".insertTab(" << page << ", " << trcall( label ) << ")" << endl; trout << indent << fullObjName << ".changeTab( " << page << ", " << trcall( label, comment ) << " )" << endl; @@ -325,7 +325,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, } else if ( objClass == "Qt::WidgetStack" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, objName ); + TQString page = createObjectImpl( n, objClass, objName ); int id = DomTool::readAttribute( n, "id", "" ).toInt(); out << indent << fullObjName << ".addWidget( " << page << ", " << id << " )" << endl; } @@ -333,9 +333,9 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, } else if ( objClass == "Qt::ToolBox" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - QString page = createObjectImpl( n, objClass, objName ); - QString comment; - QString label = DomTool::readAttribute( n, "label", comment ).toString(); + TQString page = createObjectImpl( n, objClass, objName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "label", comment ).toString(); out << indent << fullObjName << ".addItem( " << page << ", \"\" )" << endl; trout << indent << fullObjName << ".setItemLabel( " << fullObjName << ".indexOf(" << page << "), " << trcall( label, comment ) @@ -364,13 +364,13 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, application font or palette change handlers in createFormImpl(). */ -void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ) +void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ) { - QDomElement n; - QString objClass = getClassName( e ); + TQDomElement n; + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - QString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objClass.isEmpty() ) return; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { @@ -378,10 +378,10 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - QString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop != exclusiveProp ) continue; - QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; out << indent << indent << objName << ".setProperty(\"" << prop << "\", Qt::Variant.new(" << value << "))" << endl; @@ -394,11 +394,11 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi Resource::saveProperty() and DomTool::elementToVariant. If you change one, change all. */ -QString Uic::setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ) +TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ) { - QString v; + TQString 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" ) @@ -415,7 +415,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = v.arg(x).arg(y).arg(w).arg(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" ) @@ -427,7 +427,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Point.new(%1, %2)"; v = v.arg(x).arg(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" ) @@ -439,7 +439,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Size.new(%1, %2)"; v = v.arg(w).arg(h); } else if ( e.tagName() == "color" ) { - QDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int r= 0, g = 0, b = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "red" ) @@ -453,8 +453,8 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Color.new(%1, %2, %3)"; v = v.arg(r).arg(g).arg(b); } else if ( e.tagName() == "font" ) { - QDomElement n3 = e.firstChild().toElement(); - QString fontname; + TQDomElement n3 = e.firstChild().toElement(); + TQString fontname; if ( !obj.isEmpty() ) { fontname = obj + "_font"; out << indent << fontname << " = Qt::Font.new(" << obj << ".font())" << endl; @@ -487,8 +487,8 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = fontname; } } else if ( e.tagName() == "string" ) { - QString txt = e.firstChild().toText().data(); - QString com = getComment( e.parentNode() ); + TQString txt = e.firstChild().toText().data(); + TQString com = getComment( e.parentNode() ); if ( prop == "toolTip" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) { if ( !obj.isEmpty() ) @@ -511,7 +511,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "\"%1\""; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "number" ) { - // FIXME: hack. QtRuby needs a QKeySequence to build an accel + // FIXME: hack. QtRuby needs a TQKeySequence to build an accel if( e.parentNode().toElement().attribute("name") == "accel" ) v = "Qt::KeySequence.new(%1)"; else @@ -528,15 +528,15 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con if( !externPixmaps ) v.prepend( '@' ); if ( !pixmapLoaderFunction.isEmpty() ) { - v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - v.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( e.tagName() == "iconset" ) { v = "Qt::IconSet.new(%1)"; - QString s = e.firstChild().toText().data(); + TQString s = e.firstChild().toText().data(); if ( !pixmapLoaderFunction.isEmpty() ) { - s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - s.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } else { s.prepend("@"); } @@ -545,22 +545,22 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = e.firstChild().toText().data() + ".convertToImage()"; } else if ( e.tagName() == "enum" ) { v = "%1::%2"; - QString oc = objClass; - QString ev = e.firstChild().toText().data(); - if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual of WithMode enum in 3.0 + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0 oc = "Qt::ScrollView"; v = v.arg( oc ).arg( ev ); } else if ( e.tagName() == "set" ) { - QString keys( e.firstChild().toText().data() ); - QStringList lst = QStringList::split( '|', keys ); + TQString keys( e.firstChild().toText().data() ); + TQStringList lst = TQStringList::split( '|', keys ); v = ""; #if defined(Q_CC_EDG) // workaround for EDG bug reproduced with MIPSpro C++ 7.3.? // and KAI C++ 4.0e that will be fixed in KAI C++ 4.0f - QStringList::Iterator it = lst.begin(); + TQStringList::Iterator it = lst.begin(); for ( ; it != lst.end(); ++it ) { #else - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { #endif v += objClass + "::" + *it; if ( it != lst.fromLast() ) @@ -568,30 +568,30 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con } v += ""; } 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(); } - QString tmp = (obj.isEmpty() ? QString::fromLatin1("self") : obj) + "."; + TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("self") : obj) + "."; v = "Qt::SizePolicy.new(%1, %2, %3, %4, " + tmp + "sizePolicy().hasHeightForWidth())"; v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ).arg( sp.horStretch() ).arg( sp.verStretch() ); } else if ( e.tagName() == "palette" ) { - QPalette pal; + TQPalette pal; bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; - QDomElement n; + TQDomElement n; if ( no_pixmaps ) { n = e.firstChild().toElement(); while ( !n.isNull() ) { - QColorGroup cg; + TQColorGroup cg; if ( n.tagName() == "active" ) { cg = loadColorGroup( n ); pal.setActive( cg ); @@ -605,17 +605,17 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con n = n.nextSibling().toElement(); } } - if ( no_pixmaps && pal == QPalette( pal.active().button(), pal.active().background() ) ) { + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { v = "Qt::Palette.new(Qt::Color.new(%1,%2,%3), Qt::Color.new(%1,%2,%3))"; v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); } else { - QString palette = "pal"; + TQString palette = "pal"; if ( !pal_used ) { out << indent << palette << " = Qt::Palette.new()" << endl; pal_used = true; } - QString cg = "cg"; + TQString cg = "cg"; if ( !cg_used ) { out << indent << cg << " = Qt::ColorGroup.new()" << endl; cg_used = true; @@ -643,7 +643,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Cursor.new(%1)"; v = v.arg( e.firstChild().toText().data() ); } 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() ) { @@ -658,7 +658,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Date.new(%1,%2,%3)"; v = v.arg(y).arg(m).arg(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() ) { @@ -673,7 +673,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::Time.new(%1, %2, %3)"; v = v.arg(h).arg(m).arg(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() ) { @@ -694,9 +694,9 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con v = "Qt::DateTime.new(Qt::Date.new(%1, %2, %3), Qt::Time.new(%4, %5, %6))"; v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); } else if ( e.tagName() == "stringlist" ) { - QStringList l; - QDomElement n3 = e.firstChild().toElement(); - QString listname; + TQStringList l; + TQDomElement n3 = e.firstChild().toElement(); + TQString listname; if ( !obj.isEmpty() ) { listname = obj + "_strlist"; out << indent << listname << " = ["; @@ -736,9 +736,9 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con /*! Extracts a named object property from \a e. */ -QDomElement Uic::getObjectProperty( const QDomElement& e, const QString& name ) +TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { diff --git a/qtruby/rubylib/designer/rbuic/parser.cpp b/qtruby/rubylib/designer/rbuic/parser.cpp index b7869f75..11dfe060 100644 --- a/qtruby/rubylib/designer/rbuic/parser.cpp +++ b/qtruby/rubylib/designer/rbuic/parser.cpp @@ -24,28 +24,28 @@ **********************************************************************/ #include "parser.h" -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> 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 ); @@ -55,7 +55,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 ]; @@ -67,5 +67,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/qtruby/rubylib/designer/rbuic/parser.h b/qtruby/rubylib/designer/rbuic/parser.h index 5a5671ad..ace96d9e 100644 --- a/qtruby/rubylib/designer/rbuic/parser.h +++ b/qtruby/rubylib/designer/rbuic/parser.h @@ -21,12 +21,12 @@ #ifndef PARSER_H #define PARSER_H -#include <qstring.h> +#include <tqstring.h> class Parser { public: - static QString cleanArgs( const QString &func ); + static TQString cleanArgs( const TQString &func ); }; diff --git a/qtruby/rubylib/designer/rbuic/subclassing.cpp b/qtruby/rubylib/designer/rbuic/subclassing.cpp index a3ad25c3..e6a876f0 100644 --- a/qtruby/rubylib/designer/rbuic/subclassing.cpp +++ b/qtruby/rubylib/designer/rbuic/subclassing.cpp @@ -22,12 +22,12 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include <qfile.h> -#include <qstringlist.h> -#include <qdatetime.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqdatetime.h> #define NO_STATIC_COLORS #include <globaldefs.h> -#include <qregexp.h> +#include <tqregexp.h> #include <stdio.h> #include <stdlib.h> #include <zlib.h> @@ -39,14 +39,14 @@ \sa createSubDecl() */ -void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) +void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass ) { - QDomElement n; - QDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - QStringList::Iterator it, it2, it3; + TQStringList::Iterator it, it2, it3; - QString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; if (hasKDEwidget) { @@ -82,10 +82,10 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) out << endl; // find additional slots - QStringList publicSlots, protectedSlots, privateSlots; - QStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; - QStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; - QMap<QString, QString> functionImpls; + TQStringList publicSlots, protectedSlots, privateSlots; + TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; + TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; + TQMap<TQString, TQString> functionImpls; nl = e.parentNode().toElement().elementsByTagName( "slot" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -94,12 +94,12 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - QString returnType = n.attribute( "returnType", "void" ); - QString slotName = n.firstChild().toText().data().stripWhiteSpace(); + TQString returnType = n.attribute( "returnType", "void" ); + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); if ( slotName.endsWith( ";" ) ) slotName = slotName.left( slotName.length() - 1 ); - QString specifier = n.attribute( "specifier" ); - QString access = n.attribute( "access" ); + TQString specifier = n.attribute( "specifier" ); + TQString access = n.attribute( "access" ); if ( access == "protected" ) { protectedSlots += slotName; protectedSlotTypes += returnType; @@ -119,7 +119,7 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) // compatibility with early 3.0 betas nl = e.parentNode().toElement().elementsByTagName( "function" ); for ( i = 0; i < (int) nl.length(); i++ ) { - QString fname = n.attribute( "name" ); + TQString fname = n.attribute( "name" ); fname = Parser::cleanArgs( fname ); functionImpls.insert( fname, n.firstChild().toText().data() ); } @@ -127,8 +127,8 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) if ( !publicSlots.isEmpty() ) { for ( it = publicSlots.begin(), it2 = publicSlotTypes.begin(), it3 = publicSlotSpecifier.begin(); it != publicSlots.end(); ++it, ++it2, ++it3 ) { - QString pure; - QString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -149,8 +149,8 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) if ( !protectedSlots.isEmpty() ) { for ( it = protectedSlots.begin(), it2 = protectedSlotTypes.begin(), it3 = protectedSlotSpecifier.begin(); it != protectedSlots.end(); ++it, ++it2, ++it3 ) { - QString pure; - QString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -173,8 +173,8 @@ void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) if ( !privateSlots.isEmpty() ) { for ( it = privateSlots.begin(), it2 = privateSlotTypes.begin(), it3 = privateSlotSpecifier.begin(); it != privateSlots.end(); ++it, ++it2, ++it3 ) { - QString pure; - QString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) diff --git a/qtruby/rubylib/designer/rbuic/uic.cpp b/qtruby/rubylib/designer/rbuic/uic.cpp index e4f8eed7..07fb377a 100644 --- a/qtruby/rubylib/designer/rbuic/uic.cpp +++ b/qtruby/rubylib/designer/rbuic/uic.cpp @@ -37,12 +37,12 @@ #include "parser.h" #include "widgetdatabase.h" #include "domtool.h" -#include <qfile.h> -#include <qstringlist.h> -#include <qdatetime.h> +#include <tqfile.h> +#include <tqstringlist.h> +#include <tqdatetime.h> #define NO_STATIC_COLORS #include <globaldefs.h> -#include <qregexp.h> +#include <tqregexp.h> #include <stdio.h> #include <stdlib.h> #include <zlib.h> @@ -67,42 +67,42 @@ void RubyIndent::calc() } -QString Uic::getComment( const QDomNode& n ) +TQString Uic::getComment( const TQDomNode& n ) { - QDomNode child = n.firstChild(); + TQDomNode child = n.firstChild(); while ( !child.isNull() ) { if ( child.toElement().tagName() == "comment" ) return child.toElement().firstChild().toText().data(); child = child.nextSibling(); } - return QString::null; + return TQString::null; } -QString Uic::mkBool( bool b ) +TQString Uic::mkBool( bool b ) { return b? "true" : "false"; } -QString Uic::mkBool( const QString& s ) +TQString Uic::mkBool( const TQString& s ) { return mkBool( s == "true" || s == "1" ); } -bool Uic::toBool( const QString& s ) +bool Uic::toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } -QString Uic::fixString( const QString &str ) +TQString Uic::fixString( const TQString &str ) { - QString s( str ); - s.replace( QRegExp( "\\\\" ), "\\\\" ); - s.replace( QRegExp( "\"" ), "\\\"" ); - s.replace( QRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); return "\"" + s + "\""; } -QString Uic::trcall( const QString& sourceText, const QString& comment ) +TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) { if ( sourceText.isEmpty() && comment.isEmpty() ) return "nil"; @@ -112,19 +112,19 @@ QString Uic::trcall( const QString& sourceText, const QString& comment ) return trmacro + "(" + fixString( sourceText ) + "," + fixString( comment ) + ")"; } -QString Uic::mkStdSet( const QString& prop ) +TQString Uic::mkStdSet( const TQString& prop ) { - return QString( "set" ) + prop[0].upper() + prop.mid(1); + return TQString( "set" ) + prop[0].upper() + prop.mid(1); } -bool Uic::isEmptyFunction( const QString& fname ) +bool Uic::isEmptyFunction( const TQString& fname ) { - QMap<QString, QString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); return body.simplifyWhiteSpace().isEmpty(); } // For now ruby functions are always empty, until a rubyeditor Qt Designer plugin exists.. @@ -139,9 +139,9 @@ bool Uic::isEmptyFunction( const QString& fname ) The class Uic encapsulates the user interface compiler (uic). */ -Uic::Uic( const QString &fn, QTextStream &outStream, QDomDocument doc, - bool subcl, const QString &trm, const QString& subClass, - bool omitForwardDecls, QString &uicClass, bool useKDE ) +Uic::Uic( const TQString &fn, TQTextStream &outStream, TQDomDocument doc, + bool subcl, const TQString &trm, const TQString& subClass, + bool omitForwardDecls, TQString &uicClass, bool useKDE ) : out( outStream ), trout( &languageChangeBody ), trmacro( trm ), nofwd( omitForwardDecls ) { @@ -164,16 +164,16 @@ Uic::Uic( const QString &fn, QTextStream &outStream, QDomDocument doc, uiFileVersion = doc.firstChild().toElement().attribute("version"); stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); - QDomElement e = doc.firstChild().firstChild().toElement(); - QDomElement widget; + TQDomElement e = doc.firstChild().firstChild().toElement(); + TQDomElement widget; while ( !e.isNull() ) { if ( e.tagName() == "widget" ) { widget = e; } else if ( e.tagName() == "pixmapinproject" ) { externPixmaps = true; } else if ( e.tagName() == "layoutdefaults" ) { - defSpacing = e.attribute( "spacing", QString::number( defSpacing ) ).toInt(); - defMargin = e.attribute( "margin", QString::number( defMargin ) ).toInt(); + defSpacing = e.attribute( "spacing", TQString::number( defSpacing ) ).toInt(); + defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt(); } e = e.nextSibling().toElement(); } @@ -193,26 +193,26 @@ Uic::Uic( const QString &fn, QTextStream &outStream, QDomDocument doc, /*! Extracts a pixmap loader function from \a e */ -QString Uic::getPixmapLoaderFunction( const QDomElement& e ) +TQString Uic::getPixmapLoaderFunction( const TQDomElement& e ) { - QDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "pixmapfunction" ) return n.firstChild().toText().data(); } - return QString::null; + return TQString::null; } /*! Extracts the forms class name from \a e */ -QString Uic::getFormClassName( const QDomElement& e ) +TQString Uic::getFormClassName( const TQDomElement& e ) { - QDomElement n; - QString cn; + TQDomElement n; + TQString cn; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "class" ) { - QString s = n.firstChild().toText().data(); + TQString s = n.firstChild().toText().data(); int i; while ( ( i = s.find(' ' )) != -1 ) s[i] = '_'; @@ -224,16 +224,16 @@ QString Uic::getFormClassName( const QDomElement& e ) /*! Extracts a Ruby class name from \a e. */ -QString Uic::getClassName( const QDomElement& e ) +TQString Uic::getClassName( const TQDomElement& e ) { - QString s = e.attribute( "class" ); + TQString s = e.attribute( "class" ); if ( s.isEmpty() && e.tagName() == "toolbar" ) s = "Qt::ToolBar"; else if ( s.isEmpty() && e.tagName() == "menubar" ) s = "Qt::MenuBar"; else { - QRegExp r("^([QK])(\\S+)"); + TQRegExp r("^([QK])(\\S+)"); if( r.search( s ) != -1 ) { if (r.cap(1) == "K") { hasKDEwidget = true; @@ -255,11 +255,11 @@ QString Uic::getClassName( const QDomElement& e ) /*! Returns TRUE if database framework code is generated, else FALSE. */ -bool Uic::isFrameworkCodeGenerated( const QDomElement& e ) +bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) { - QDomElement n = getObjectProperty( e, "frameworkCode" ); + TQDomElement n = getObjectProperty( e, "frameworkCode" ); if ( n.attribute("name") == "frameworkCode" && - !DomTool::elementToVariant( n.firstChild().toElement(), QVariant( true, 0 ) ).toBool() ) + !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true, 0 ) ).toBool() ) return false; return true; } @@ -267,36 +267,36 @@ bool Uic::isFrameworkCodeGenerated( const QDomElement& e ) /*! Extracts an object name from \a e. It's stored in the 'name' property. */ -QString Uic::getObjectName( const QDomElement& e ) +TQString Uic::getObjectName( const TQDomElement& e ) { - QDomElement n = getObjectProperty( e, "name" ); + TQDomElement n = getObjectProperty( e, "name" ); if ( n.firstChild().toElement().tagName() == "cstring" ) return n.firstChild().toElement().firstChild().toText().data(); - return QString::null; + return TQString::null; } /*! Extracts an layout name from \a e. It's stored in the 'name' property of the preceeding sibling (the first child of a QLayoutWidget). */ -QString Uic::getLayoutName( const QDomElement& e ) +TQString Uic::getLayoutName( const TQDomElement& e ) { - QDomElement p = e.parentNode().toElement(); - QString tail = QString::null; + TQDomElement p = e.parentNode().toElement(); + TQString tail = TQString::null; if ( getClassName(p) != "Qt::LayoutWidget" ) tail = "Layout"; - QDomElement n = getObjectProperty( p, "name" ); + TQDomElement n = getObjectProperty( p, "name" ); if ( n.firstChild().toElement().tagName() == "cstring" ) return n.firstChild().toElement().firstChild().toText().data() + tail; return e.tagName(); } -QString Uic::getDatabaseInfo( const QDomElement& e, const QString& tag ) +TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag ) { - QDomElement n; - QDomElement n1; + TQDomElement n; + TQDomElement n1; int child = 0; // database info is a stringlist stored in this order if ( tag == "connection" ) @@ -306,27 +306,27 @@ QString Uic::getDatabaseInfo( const QDomElement& e, const QString& tag ) else if ( tag == "field" ) child = 2; else - return QString::null; + return TQString::null; n = getObjectProperty( e, "database" ); if ( n.firstChild().toElement().tagName() == "stringlist" ) { // find correct stringlist entry - QDomElement n1 = n.firstChild().firstChild().toElement(); + TQDomElement n1 = n.firstChild().firstChild().toElement(); for ( int i = 0; i < child && !n1.isNull(); ++i ) n1 = n1.nextSibling().toElement(); if ( n1.isNull() ) - return QString::null; + return TQString::null; return n1.firstChild().toText().data(); } - return QString::null; + return TQString::null; } -void Uic::registerLayouts( const QDomElement &e ) +void Uic::registerLayouts( const TQDomElement &e ) { if ( layouts.contains(e.tagName()) ) createObjectDecl(e); - QDomNodeList nl = e.childNodes(); + TQDomNodeList nl = e.childNodes(); for ( int i = 0; i < (int) nl.length(); ++i ) registerLayouts( nl.item(i).toElement() ); } @@ -335,32 +335,32 @@ void Uic::registerLayouts( const QDomElement &e ) /*! Returns include file for class \a className or a null string. */ -QString Uic::getInclude( const QString& className ) +TQString Uic::getInclude( const TQString& className ) { int wid = WidgetDatabase::idFromClassName( className ); if ( wid != -1 ) return WidgetDatabase::includeFile( wid ); - return QString::null; + return TQString::null; } -void Uic::createActionDecl( const QDomElement& e ) +void Uic::createActionDecl( const TQDomElement& e ) { - QString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; out << indent << objName << endl; if ( e.tagName() == "actiongroup" ) { - for ( QDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) createActionDecl( n ); } } } -void Uic::createActionImpl( const QDomElement &n, const QString &parent ) +void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) { - for ( QDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { - QString objName = registerObject( getObjectName( ae ) ); + for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { + TQString objName = registerObject( getObjectName( ae ) ); if ( ae.tagName() == "action" ) out << indent << objName << "= Qt::Action.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl; else if ( ae.tagName() == "actiongroup" ) @@ -369,20 +369,20 @@ void Uic::createActionImpl( const QDomElement &n, const QString &parent ) continue; bool subActionsDone = false; bool hasMenuText = false; - QString actionText; - for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + TQString actionText; + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "property" ) { bool stdset = stdsetdef; if ( n2.hasAttribute( "stdset" ) ) stdset = toBool( n2.attribute( "stdset" ) ); - QString prop = n2.attribute("name"); + TQString prop = n2.attribute("name"); if ( prop == "name" ) continue; - QString value = setObjectProperty( "Qt::Action", objName, prop, n2.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( "Qt::Action", objName, prop, n2.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; - QString call = objName + "."; + TQString call = objName + "."; if ( stdset ) { call += mkStdSet( prop ) + "(" + value + ")"; } else { @@ -405,13 +405,13 @@ void Uic::createActionImpl( const QDomElement &n, const QString &parent ) subActionsDone = true; } } - // workaround for loading pre-3.3 files expecting bogus QAction behavior + // workaround for loading pre-3.3 files expecting bogus TQAction behavior if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") trout << indent << objName << ".setMenuText(" << actionText << ")" << endl; } } -QString get_dock( const QString &d ) +TQString get_dock( const TQString &d ) { if ( d == "0" ) return "DockUnmanaged"; @@ -430,16 +430,16 @@ QString get_dock( const QString &d ) return ""; } -void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, const QString &parent ) +void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - QDomNodeList nl = n.elementsByTagName( "toolbar" ); + TQDomNodeList nl = n.elementsByTagName( "toolbar" ); for ( int i = 0; i < (int) nl.length(); i++ ) { - QDomElement ae = nl.item( i ).toElement(); - QString dock = get_dock( ae.attribute( "dock" ) ); - QString objName = "@" + getObjectName( ae ); + TQDomElement ae = nl.item( i ).toElement(); + TQString dock = get_dock( ae.attribute( "dock" ) ); + TQString objName = "@" + getObjectName( ae ); out << indent << objName << " = Qt::ToolBar.new(\"\", self, " << dock << ")" << endl; createObjectImpl( ae, parentClass, parent ); - for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "action" ) { out << indent << "@" << n2.attribute( "name" ) << ".addTo( " << objName << " )" << endl; } else if ( n2.tagName() == "separator" ) { @@ -448,7 +448,7 @@ void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, c if ( n2.attribute( "class" ) != "Spacer" ) { createObjectImpl( n2, "Qt::ToolBar", objName ); } else { - QString child = createSpacerImpl( n2, parentClass, parent, objName ); + TQString child = createSpacerImpl( n2, parentClass, parent, objName ); out << indent << "Qt::Application.sendPostedEvents( " << objName << ", Qt::Event::ChildInserted)" << endl; out << indent << objName << ".boxLayout().addItem(" << child << ")" << endl; @@ -458,21 +458,21 @@ void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, c } } -void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, const QString &parent ) +void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - QString objName = "@" + getObjectName( n ); + TQString objName = "@" + getObjectName( n ); out << indent << objName << " = Qt::MenuBar.new( self, \"" << objName.mid(1) << "\" )" << endl; createObjectImpl( n, parentClass, parent ); int i = 0; - QDomElement c = n.firstChild().toElement(); + TQDomElement c = n.firstChild().toElement(); while ( !c.isNull() ) { if ( c.tagName() == "item" ) { - QString itemName = "@" + c.attribute( "name" ); + TQString itemName = "@" + c.attribute( "name" ); out << endl; out << indent << itemName << " = Qt::PopupMenu.new( self )" << endl; createPopupMenuImpl( c, parentClass, itemName ); out << indent << objName << ".insertItem( \"\", " << itemName << ", " << i << " )" << endl; - QString findItem(objName + ".findItem(%1)"); + TQString findItem(objName + ".findItem(%1)"); findItem = findItem.arg(i); trout << indent << "if !" << findItem << ".nil?" << endl; trout << indent << indent << findItem << ".setText( " << trcall( c.attribute( "text" ) ) << " )" << endl; @@ -486,15 +486,15 @@ void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, c } } -void Uic::createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent ) +void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ) { int i = 0; - for ( QDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) { - QDomElement n2 = n.nextSibling().toElement(); + TQDomElement n2 = n.nextSibling().toElement(); if ( n2.tagName() == "item" ) { // the action has a sub menu - QString itemName = "@" + n2.attribute( "name" ); - QString itemText = n2.attribute( "text" ); + TQString itemName = "@" + n2.attribute( "name" ); + TQString itemText = n2.attribute( "text" ); out << indent << itemName << " = Qt::PopupMenu.new( self )" << endl; out << indent << indent << parent << ".insertItem( @" << n.attribute( "name" ) << ".iconSet(),"; out << trcall( itemText ) << ", " << itemName << " )" << endl; @@ -516,17 +516,17 @@ void Uic::createPopupMenuImpl( const QDomElement &e, const QString &parentClass, Creates implementation of an listbox item tag. */ -QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent, - QString *value ) +TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - QDomElement n = e.firstChild().toElement(); - QString txt; - QString com; - QString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute("name"); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -536,8 +536,8 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent, pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -557,16 +557,16 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent, Creates implementation of an iconview item tag. */ -QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent ) +TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent ) { - QDomElement n = e.firstChild().toElement(); - QString txt; - QString com; - QString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute("name"); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -576,8 +576,8 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -594,15 +594,15 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent Creates implementation of an listview item tag. */ -QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent, - const QString &parentItem ) +TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ) { - QString s; + TQString s; - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); bool hasChildren = e.elementsByTagName( "item" ).count() > 0; - QString item; + TQString item; if ( hasChildren ) { item = registerObject( "item" ); @@ -623,22 +623,22 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent else s += "Qt::ListViewItem.new(" + parent + ", " + lastItem + ")\n"; - QStringList textes; - QStringList pixmaps; + TQStringList textes; + TQStringList pixmaps; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute("name"); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) textes << v.toString(); else if ( attrib == "pixmap" ) { - QString pix = v.toString(); + TQString pix = v.toString(); if (!pix.isEmpty()) { pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } pixmaps << pix; } @@ -651,9 +651,9 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent for ( int i = 0; i < (int)textes.count(); ++i ) { if ( !textes[ i ].isEmpty() ) - s += indent + item + ".setText(" + QString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n"; + s += indent + item + ".setText(" + TQString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n"; if ( !pixmaps[ i ].isEmpty() ) - s += indent + item + ".setPixmap(" + QString::number( i ) + ", " + pixmaps[ i ] + ")\n"; + s += indent + item + ".setPixmap(" + TQString::number( i ) + ", " + pixmaps[ i ] + ")\n"; } lastItem = item; @@ -664,18 +664,18 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent Creates implementation of an listview column tag. */ -QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &parent, - QString *value ) +TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - QDomElement n = e.firstChild().toElement(); - QString txt; - QString com; - QString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; bool clickable = false, resizeable = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute("name"); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -685,8 +685,8 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "clickable" ) clickable = v.toBool(); @@ -699,7 +699,7 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare if ( value ) *value = trcall( txt, com ); - QString s; + TQString s; s = indent + parent + ".addColumn(" + trcall( txt, com ) + ")\n"; if ( !pix.isEmpty() ) s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1," + pix + ", " + trcall( txt, com ) + ")\n"; @@ -711,28 +711,28 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare return s; } -QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &parent, - QString *value ) +TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - QString objClass = getClassName( e.parentNode().toElement() ); - QDomElement n = e.firstChild().toElement(); - QString txt; - QString com; - QString pix; - QString field; + TQString objClass = getClassName( e.parentNode().toElement() ); + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + TQString field; bool isRow = e.tagName() == "row"; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute("name"); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); } else if ( attrib == "pixmap" ) { pix = v.toString(); if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "field" ) field = v.toString(); @@ -745,9 +745,9 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare // ### This generated code sucks! We have to set the number of // rows/cols before and then only do setLabel/() - // ### careful, though, since QDataTable has an API which makes this code pretty good + // ### careful, though, since TQDataTable has an API which makes this code pretty good - QString s; + TQString s; if ( isRow ) { s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1 )\n"; if ( pix.isEmpty() ) @@ -780,13 +780,13 @@ QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &pare /*! Creates the implementation of a layout tag. Called from createObjectImpl(). */ -QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout ) +TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) { - QDomElement n; - QString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); - QString qlayout = "Qt::VBoxLayout.new"; + TQString qlayout = "Qt::VBoxLayout.new"; if ( objClass == "hbox" ) qlayout = "Qt::HBoxLayout.new"; else if ( objClass == "grid" ) @@ -796,11 +796,11 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, objName = registerObject( getLayoutName( e ) ); layoutObjects += objName; - QString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); - QString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); - QString resizeMode = DomTool::readProperty( e, "resizeMode", QString::null ).toString(); + TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); + TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); + TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString::null ).toString(); - QString optcells; + TQString optcells; if ( isGrid ) optcells = "1, 1, "; if ( (parentClass == "Qt::GroupBox" || parentClass == "Qt::ButtonGroup") && layout.isEmpty() ) { @@ -827,10 +827,10 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, if ( !isGrid ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "spacer" ) { - QString child = createSpacerImpl( n, parentClass, parent, objName ); + TQString child = createSpacerImpl( n, parentClass, parent, objName ); out << indent << objName << ".addItem(" << child << ")" << endl; } else if ( tags.contains( n.tagName() ) ) { - QString child = createObjectImpl( n, parentClass, parent, objName ); + TQString child = createObjectImpl( n, parentClass, parent, objName ); if ( isLayout( child ) ) out << indent << objName << ".addLayout(" << child << ")" << endl; else @@ -839,7 +839,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, } } else { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - QDomElement ae = n; + TQDomElement ae = n; int row = ae.attribute( "row" ).toInt(); int col = ae.attribute( "column" ).toInt(); int rowspan = ae.attribute( "rowspan" ).toInt(); @@ -849,7 +849,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, if ( colspan < 1 ) colspan = 1; if ( n.tagName() == "spacer" ) { - QString child = createSpacerImpl( n, parentClass, parent, objName ); + TQString child = createSpacerImpl( n, parentClass, parent, objName ); if ( rowspan * colspan != 1 ) out << indent << objName << ".addMultiCell(" << child << ", " << row << ", " << row + rowspan - 1 << ", " << col << ", " << col + colspan - 1 << ")" << endl; @@ -857,9 +857,9 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, out << indent << objName << ".addItem(" << child << ", " << row << ", " << col << ")" << endl; } else if ( tags.contains( n.tagName() ) ) { - QString child = createObjectImpl( n, parentClass, parent, objName ); + TQString child = createObjectImpl( n, parentClass, parent, objName ); out << endl; - QString o = "Widget"; + TQString o = "Widget"; if ( isLayout( child ) ) o = "Layout"; if ( rowspan * colspan != 1 ) @@ -877,20 +877,20 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, -QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/) +TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/) { - QDomElement n; - QString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); objName = registerObject( getObjectName( e ) ); - QSize size = DomTool::readProperty( e, "sizeHint", QSize( 0, 0 ) ).toSize(); - QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); + TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize(); + TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2 - QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect(); + TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); size = geom.size(); } @@ -916,16 +916,16 @@ static const char* const ColorRole[] = { /*! Creates a colorgroup with name \a name from the color group \a cg */ -void Uic::createColorGroupImpl( const QString& name, const QDomElement& e ) +void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e ) { - QColorGroup cg; + TQColorGroup cg; int r = -1; - QDomElement n = e.firstChild().toElement(); - QString color; + TQDomElement n = e.firstChild().toElement(); + TQString color; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - QColor col = DomTool::readColor( n ); + TQColor col = DomTool::readColor( n ); color = "Qt::Color.new(%1,%2,%3)"; color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); if ( col == white ) @@ -936,11 +936,11 @@ void Uic::createColorGroupImpl( const QString& name, const QDomElement& e ) out << indent << name << ".setColor(Qt::ColorGroup::" << ColorRole[r] << ", " << color << ")" << endl; } } else if ( n.tagName() == "pixmap" ) { - QString pixmap = n.firstChild().toText().data(); + TQString pixmap = n.firstChild().toText().data(); pixmap.prepend("@"); if ( !pixmapLoaderFunction.isEmpty() ) { - pixmap.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); - pixmap.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } out << indent << name << ".setBrush(Qt::ColorGroup::" << ColorRole[r] << ", Qt::Brush.new(" << color << ", " << pixmap << "))" << endl; @@ -953,16 +953,16 @@ void Uic::createColorGroupImpl( const QString& name, const QDomElement& e ) Auxiliary function to load a color group. The colorgroup must not contain pixmaps. */ -QColorGroup Uic::loadColorGroup( const QDomElement &e ) +TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) { - QColorGroup cg; + TQColorGroup cg; int r = -1; - QDomElement n = e.firstChild().toElement(); - QColor col; + TQDomElement n = e.firstChild().toElement(); + TQColor col; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); } n = n.nextSibling().toElement(); } @@ -973,10 +973,10 @@ QColorGroup Uic::loadColorGroup( const QDomElement &e ) the database \a connection and \a table. */ -bool Uic::isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table ) +bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ) { - QString conn = getDatabaseInfo( e, "connection" ); - QString tab = getDatabaseInfo( e, "table" ); + TQString conn = getDatabaseInfo( e, "connection" ); + TQString tab = getDatabaseInfo( e, "table" ); if ( conn == connection && tab == table ) return true; return false; @@ -986,17 +986,17 @@ bool Uic::isWidgetInTable( const QDomElement& e, const QString& connection, cons Registers all database connections, cursors and forms. */ -void Uic::registerDatabases( const QDomElement& e ) +void Uic::registerDatabases( const TQDomElement& e ) { - QDomElement n; - QDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; nl = e.parentNode().toElement().elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); ++i ) { n = nl.item(i).toElement(); - QString conn = getDatabaseInfo( n, "connection" ); - QString tab = getDatabaseInfo( n, "table" ); - QString fld = getDatabaseInfo( n, "field" ); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString fld = getDatabaseInfo( n, "field" ); if ( !conn.isNull() ) { dbConnections += conn; if ( !tab.isNull() ) { @@ -1016,7 +1016,7 @@ void Uic::registerDatabases( const QDomElement& e ) \sa registeredName(), isObjectRegistered() */ -QString Uic::registerObject( const QString& name ) +TQString Uic::registerObject( const TQString& name ) { if ( objectNames.isEmpty() ) { // some temporary variables we need @@ -1025,7 +1025,7 @@ QString Uic::registerObject( const QString& name ) objectNames += "cg"; objectNames += "pal"; } - QString result("@"); + TQString result("@"); result += name; int i; while ( ( i = result.find(' ' )) != -1 ) { @@ -1034,10 +1034,10 @@ QString Uic::registerObject( const QString& name ) if ( objectNames.contains( result ) ) { int i = 2; - while ( objectNames.contains( result + "_" + QString::number(i) ) ) + while ( objectNames.contains( result + "_" + TQString::number(i) ) ) i++; result += "_"; - result += QString::number(i); + result += TQString::number(i); } objectNames += result; objectMapper.insert( name, result ); @@ -1050,7 +1050,7 @@ QString Uic::registerObject( const QString& name ) \sa registerObject(), isObjectRegistered() */ -QString Uic::registeredName( const QString& name ) +TQString Uic::registeredName( const TQString& name ) { if ( !objectMapper.contains( name ) ) return name; @@ -1060,24 +1060,24 @@ QString Uic::registeredName( const QString& name ) /*! Returns whether the object \a name was registered yet or not. */ -bool Uic::isObjectRegistered( const QString& name ) +bool Uic::isObjectRegistered( const TQString& name ) { return objectMapper.contains( name ); } /*! - Unifies the entries in stringlist \a list. Should really be a QStringList feature. + Unifies the entries in stringlist \a list. Should really be a TQStringList feature. */ -QStringList Uic::unique( const QStringList& list ) +TQStringList Uic::unique( const TQStringList& list ) { - QStringList result; + TQStringList result; if ( list.isEmpty() ) return result; - QStringList l = list; + TQStringList l = list; l.sort(); result += l.first(); - for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { if ( *it != result.last() ) result += *it; } @@ -1089,7 +1089,7 @@ QStringList Uic::unique( const QStringList& list ) /*! Creates an instance of class \a objClass, with parent \a parent and name \a objName */ -QString Uic::createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ) +TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ) { if ( objClass.mid( 4 ) == "ComboBox" ) { @@ -1098,7 +1098,7 @@ QString Uic::createObjectInstance( const QString& objClass, const QString& paren return objClass + ".new(" + parent + ", \"" + objName.mid(1) + "\")"; } -bool Uic::isLayout( const QString& name ) const +bool Uic::isLayout( const TQString& name ) const { return layoutObjects.contains( name ); } diff --git a/qtruby/rubylib/designer/rbuic/uic.h b/qtruby/rubylib/designer/rbuic/uic.h index 707df590..ddfcc1be 100644 --- a/qtruby/rubylib/designer/rbuic/uic.h +++ b/qtruby/rubylib/designer/rbuic/uic.h @@ -21,12 +21,12 @@ #ifndef UIC_H #define UIC_H -#include <qdom.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qmap.h> -#include <qtextstream.h> -#include <qpalette.h> +#include <tqdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqtextstream.h> +#include <tqpalette.h> class RubyIndent @@ -37,12 +37,12 @@ public: void setTabStop(uint n) {tabStop = n; calc();} void operator++() {++current; calc();} void operator--() {--current; calc();} - operator QString() {return indstr;} + operator TQString() {return indstr;} private: uint tabStop; uint current; - QString indstr; + TQString indstr; void calc(); }; @@ -51,95 +51,95 @@ private: class Uic : public Qt { public: - Uic( const QString &fn, QTextStream& out, QDomDocument doc, bool subcl, - const QString &trm, const QString& subclname, bool omitForwardDecls, - QString &uicClass, bool useKDE ); + Uic( const TQString &fn, TQTextStream& out, TQDomDocument doc, bool subcl, + const TQString &trm, const TQString& subclname, bool omitForwardDecls, + TQString &uicClass, bool useKDE ); static void setIndent(const RubyIndent &rubyind) {indent = rubyind;} - void createFormImpl( const QDomElement &e ); - - void createSubImpl( const QDomElement &e, const QString& subclname ); - - void createObjectDecl( const QDomElement& e ); - void createAttrDecl( const QDomElement& e ); - void createActionDecl( const QDomElement& e ); - void createActionImpl( const QDomElement& e, const QString &parent ); - void createToolbarImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); - void createMenuBarImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); - void createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); - QString createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); - QString createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); - QString createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ); - QString createSpacerImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); - void createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ); - QString createListBoxItemImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); - QString createIconViewItemImpl( const QDomElement &e, const QString &parent ); - QString createListViewColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); - QString createTableRowColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); - QString createListViewItemImpl( const QDomElement &e, const QString &parent, - const QString &parentItem ); - void createColorGroupImpl( const QString& cg, const QDomElement& e ); - QColorGroup loadColorGroup( const QDomElement &e ); - - QDomElement getObjectProperty( const QDomElement& e, const QString& name ); - QString getPixmapLoaderFunction( const QDomElement& e ); - QString getFormClassName( const QDomElement& e ); - QString getClassName( const QDomElement& e ); - QString getObjectName( const QDomElement& e ); - QString getLayoutName( const QDomElement& e ); - QString getInclude( const QString& className ); - - QString setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ); - - QString registerObject( const QString& name ); - QString registeredName( const QString& name ); - bool isObjectRegistered( const QString& name ); - QStringList unique( const QStringList& ); - - QString trcall( const QString& sourceText, const QString& comment = "" ); - - static void embed( QTextStream& out, const char* project, const QStringList& images ); - - friend void getDBConnections(Uic& uic, QString& s); + void createFormImpl( const TQDomElement &e ); + + void createSubImpl( const TQDomElement &e, const TQString& subclname ); + + void createObjectDecl( const TQDomElement& e ); + void createAttrDecl( const TQDomElement& e ); + void createActionDecl( const TQDomElement& e ); + void createActionImpl( const TQDomElement& e, const TQString &parent ); + void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ); + TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ); + TQString createListBoxItemImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createIconViewItemImpl( const TQDomElement &e, const TQString &parent ); + TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ); + void createColorGroupImpl( const TQString& cg, const TQDomElement& e ); + TQColorGroup loadColorGroup( const TQDomElement &e ); + + TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name ); + TQString getPixmapLoaderFunction( const TQDomElement& e ); + TQString getFormClassName( const TQDomElement& e ); + TQString getClassName( const TQDomElement& e ); + TQString getObjectName( const TQDomElement& e ); + TQString getLayoutName( const TQDomElement& e ); + TQString getInclude( const TQString& className ); + + TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ); + + TQString registerObject( const TQString& name ); + TQString registeredName( const TQString& name ); + bool isObjectRegistered( const TQString& name ); + TQStringList unique( const TQStringList& ); + + TQString trcall( const TQString& sourceText, const TQString& comment = "" ); + + static void embed( TQTextStream& out, const char* project, const TQStringList& images ); + + friend void getDBConnections(Uic& uic, TQString& s); static bool hasKDEwidget; private: - void registerLayouts ( const QDomElement& e ); - - QTextStream& out; - QTextOStream trout; - QString languageChangeBody; - QStringList objectNames; - QMap<QString,QString> objectMapper; - QStringList tags; - QStringList layouts; - QString formName; - QString lastItem; - QString trmacro; + void registerLayouts ( const TQDomElement& e ); + + TQTextStream& out; + TQTextOStream trout; + TQString languageChangeBody; + TQStringList objectNames; + TQMap<TQString,TQString> objectMapper; + TQStringList tags; + TQStringList layouts; + TQString formName; + TQString lastItem; + TQString trmacro; bool nofwd; static RubyIndent indent; struct Buddy { - Buddy( const QString& k, const QString& b ) + Buddy( const TQString& k, const TQString& b ) : key( k ), buddy( b ) {} Buddy(){} // for valuelist - QString key; - QString buddy; + TQString key; + TQString buddy; bool operator==( const Buddy& other ) const { return (key == other.key); } }; struct CustomInclude { - QString header; - QString location; + TQString header; + TQString location; }; - QValueList<Buddy> buddies; + TQValueList<Buddy> buddies; - QStringList layoutObjects; - bool isLayout( const QString& name ) const; + TQStringList layoutObjects; + bool isLayout( const TQString& name ) const; uint item_used : 1; uint cg_used : 1; @@ -147,35 +147,35 @@ private: uint stdsetdef : 1; uint externPixmaps : 1; - QString uiFileVersion; - QString nameOfClass; - QString pixmapLoaderFunction; + TQString uiFileVersion; + TQString nameOfClass; + TQString pixmapLoaderFunction; - void registerDatabases( const QDomElement& e ); - bool isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table ); - bool isFrameworkCodeGenerated( const QDomElement& e ); - QString getDatabaseInfo( const QDomElement& e, const QString& tag ); - void createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table ); - QStringList dbConnections; - QMap< QString, QStringList > dbCursors; - QMap< QString, QStringList > dbForms; + void registerDatabases( const TQDomElement& e ); + bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ); + bool isFrameworkCodeGenerated( const TQDomElement& e ); + TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag ); + void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ); + TQStringList dbConnections; + TQMap< TQString, TQStringList > dbCursors; + TQMap< TQString, TQStringList > dbForms; static bool isMainWindow; - static QString mkBool( bool b ); - static QString mkBool( const QString& s ); - bool toBool( const QString& s ); - static QString fixString( const QString &str ); + static TQString mkBool( bool b ); + static TQString mkBool( const TQString& s ); + bool toBool( const TQString& s ); + static TQString fixString( const TQString &str ); static bool onlyAscii; - static QString mkStdSet( const QString& prop ); - static QString getComment( const QDomNode& n ); + static TQString mkStdSet( const TQString& prop ); + static TQString getComment( const TQDomNode& n ); int defSpacing, defMargin; - QString fileName; + TQString fileName; bool writeSlotImpl; - bool isEmptyFunction( const QString& fname ); - QMap<QString, QString> functionImpls; + bool isEmptyFunction( const TQString& fname ); + TQMap<TQString, TQString> functionImpls; - void rubySlot(QStringList::Iterator &it); + void rubySlot(TQStringList::Iterator &it); }; #endif diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp index c79815b1..17b5014c 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp @@ -24,16 +24,16 @@ #include "widgetinterface.h" #include "widgetdatabase.h" -#include <qapplication.h> +#include <tqapplication.h> #define NO_STATIC_COLORS #include <globaldefs.h> -#include <qstrlist.h> -#include <qdict.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qcleanuphandler.h> +#include <tqstrlist.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqcleanuphandler.h> -#include <qfeatures.h> +#include <tqfeatures.h> #include <stdlib.h> @@ -41,17 +41,17 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static QDict<int> *className2Id = 0; +static TQDict<int> *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<WidgetInterface> *widgetPluginManager = 0; static bool plugins_set_up = false; static bool was_in_setup = false; -QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager; +TQCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager; WidgetDatabaseRecord::WidgetDatabaseRecord() { @@ -117,14 +117,14 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups = new QStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new QDict<int>( dbdictsize ); + className2Id = new TQDict<int>( dbdictsize ); className2Id->setAutoDelete( true ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "pushbutton.xpm"; - r->name = "QPushButton"; + r->name = "TQPushButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Push Button"; @@ -132,7 +132,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "toolbutton.xpm"; - r->name = "QToolButton"; + r->name = "TQToolButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Tool Button"; @@ -140,7 +140,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "radiobutton.xpm"; - r->name = "QRadioButton"; + r->name = "TQRadioButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Radio Button"; @@ -148,7 +148,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "checkbox.xpm"; - r->name = "QCheckBox"; + r->name = "TQCheckBox"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Check Box"; @@ -156,7 +156,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "groupbox.xpm"; - r->name = "QGroupBox"; + r->name = "TQGroupBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Group Box"; r->isContainer = true; @@ -165,7 +165,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "buttongroup.xpm"; - r->name = "QButtonGroup"; + r->name = "TQButtonGroup"; r->group = widgetGroup( "Containers" ); r->toolTip = "Button Group"; r->isContainer = true; @@ -174,7 +174,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "frame.xpm"; - r->name = "QFrame"; + r->name = "TQFrame"; r->group = widgetGroup( "Containers" ); r->toolTip = "Frame"; r->isContainer = true; @@ -183,7 +183,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "QTabWidget"; + r->name = "TQTabWidget"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tabwidget"; r->isContainer = true; @@ -193,7 +193,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "listbox.xpm"; - r->name = "QListBox"; + r->name = "TQListBox"; r->group = widgetGroup( "Views" ); r->toolTip = "List Box"; @@ -201,7 +201,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "listview.xpm"; - r->name = "QListView"; + r->name = "TQListView"; r->group = widgetGroup( "Views" ); r->toolTip = "List View"; @@ -210,7 +210,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_ICONVIEW) || defined(UIC) r = new WidgetDatabaseRecord; r->iconSet = "iconview.xpm"; - r->name = "QIconView"; + r->name = "TQIconView"; r->group = widgetGroup( "Views" ); r->toolTip = "Icon View"; @@ -220,7 +220,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "table.xpm"; - r->name = "QTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -230,8 +230,8 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_SQL) r = new WidgetDatabaseRecord; r->iconSet = "datatable.xpm"; - r->includeFile = "qdatatable.h"; - r->name = "QDataTable"; + r->includeFile = "tqdatatable.h"; + r->name = "TQDataTable"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Table"; @@ -240,7 +240,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "lineedit.xpm"; - r->name = "QLineEdit"; + r->name = "TQLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Line Edit"; @@ -248,7 +248,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "spinbox.xpm"; - r->name = "QSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; @@ -259,7 +259,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 ); @@ -268,7 +268,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 ); @@ -277,13 +277,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 = "multilineedit.xpm"; - r->name = "QMultiLineEdit"; + r->name = "TQMultiLineEdit"; r->group = widgetGroup( "Temp" ); r->toolTip = "Multi Line Edit"; @@ -291,7 +291,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "richtextedit.xpm"; - r->name = "QTextEdit"; + r->name = "TQTextEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Richtext Editor"; @@ -299,7 +299,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "combobox.xpm"; - r->name = "QComboBox"; + r->name = "TQComboBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Combo Box"; @@ -307,7 +307,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "slider.xpm"; - r->name = "QSlider"; + r->name = "TQSlider"; r->group = widgetGroup( "Input" ); r->toolTip = "Slider"; @@ -315,7 +315,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "scrollbar.xpm"; - r->name = "QScrollBar"; + r->name = "TQScrollBar"; r->group = widgetGroup( "Input" ); r->toolTip = "Scrollbar"; @@ -323,7 +323,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "dial.xpm"; - r->name = "QDial"; + r->name = "TQDial"; r->group = widgetGroup( "Input" ); r->toolTip = "Dial"; @@ -331,7 +331,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "label.xpm"; - r->name = "QLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -357,7 +357,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "lcdnumber.xpm"; - r->name = "QLCDNumber"; + r->name = "TQLCDNumber"; r->group = widgetGroup( "Display" ); r->toolTip = "LCD Number"; @@ -368,14 +368,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 = "progress.xpm"; - r->name = "QProgressBar"; + r->name = "TQProgressBar"; r->group = widgetGroup( "Display" ); r->toolTip = "Progress Bar"; @@ -383,7 +383,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "textview.xpm"; - r->name = "QTextView"; + r->name = "TQTextView"; r->group = widgetGroup( "Temp" ); r->toolTip = "Text View"; @@ -391,7 +391,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "textbrowser.xpm"; - r->name = "QTextBrowser"; + r->name = "TQTextBrowser"; r->group = widgetGroup( "Display" ); r->toolTip = "Text Browser"; @@ -407,21 +407,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; @@ -443,9 +443,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 ); @@ -476,8 +476,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; @@ -486,8 +486,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 = "databrowser.xpm"; @@ -497,8 +497,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 = "dataview.xpm"; @@ -517,8 +517,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; @@ -528,11 +528,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 ); @@ -570,19 +570,19 @@ 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 ) - r->icon = new QIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), + r->icon = new TQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) ); return *r->icon; #else - return QIconSet(); + return TQIconSet(); #endif } @@ -590,12 +590,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; } @@ -603,12 +603,12 @@ QString WidgetDatabase::className( int id ) Returns the group to which the widget registered as \a id belongs. */ -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; } @@ -616,12 +616,12 @@ QString WidgetDatabase::group( int id ) 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; } @@ -629,12 +629,12 @@ QString WidgetDatabase::toolTip( int id ) 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; } @@ -642,12 +642,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; @@ -677,10 +677,10 @@ bool WidgetDatabase::isContainer( int id ) return r->isContainer || r->isForm; } -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' ) @@ -688,13 +688,13 @@ QString WidgetDatabase::createWidgetName( int id ) WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += QString::number( ++r->nameCounter ); + n += TQString::number( ++r->nameCounter ); 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() ) @@ -715,7 +715,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; } @@ -748,14 +748,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 ) { @@ -767,12 +767,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() @@ -781,7 +781,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; @@ -805,16 +805,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 ) @@ -826,7 +826,7 @@ void WidgetDatabase::loadWhatsThis( const QString &docPath ) QPluginManager<WidgetInterface> *widgetManager() { if ( !widgetPluginManager ) { - widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), "/designer" ); + widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "/designer" ); cleanup_manager.add( &widgetPluginManager ); } return widgetPluginManager; diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.h b/qtruby/rubylib/designer/rbuic/widgetdatabase.h index efe585ab..acfe10c2 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.h +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.h @@ -21,8 +21,8 @@ #ifndef WIDGETDATABASE_H #define WIDGETDATABASE_H -#include <qiconset.h> -#include <qstring.h> +#include <tqiconset.h> +#include <tqstring.h> #include "widgetinterface.h" // up here for GCC 2.7.* compatibility #include <private/qpluginmanager_p.h> @@ -33,10 +33,10 @@ struct WidgetDatabaseRecord { WidgetDatabaseRecord(); ~WidgetDatabaseRecord(); - QString iconSet, name, group, toolTip, whatsThis, includeFile; + TQString iconSet, name, group, toolTip, whatsThis, includeFile; uint isContainer : 1; uint isForm : 1; - QIconSet *icon; + TQIconSet *icon; int nameCounter; }; @@ -50,35 +50,35 @@ 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 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 isWhatsThisLoaded(); - static void loadWhatsThis( const QString &docPath ); + static void loadWhatsThis( const TQString &docPath ); - static bool hasWidget( const QString &name ); + static bool hasWidget( const TQString &name ); }; |