diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
commit | e63beeb5bdb82987b1e00bc35178667786fbad48 (patch) | |
tree | ab77b6ac830b7944d5d1eb9ce8f81feb8fdab948 /qtruby/rubylib/designer | |
parent | 67557a2b56c0678c22ab1b00c4fd0224c5e9ed99 (diff) | |
download | tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.tar.gz tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.zip |
Fix incorrect conversion
Diffstat (limited to 'qtruby/rubylib/designer')
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.cpp | 150 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.h | 22 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/embed.cpp | 40 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/form.cpp | 198 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/globaldefs.h | 12 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/main.cpp | 42 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/object.cpp | 162 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.cpp | 22 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.h | 2 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/subclassing.cpp | 40 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.cpp | 396 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.h | 182 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.cpp | 148 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.h | 32 | ||||
-rw-r--r-- | qtruby/rubylib/designer/uilib/qui.cpp | 40 |
15 files changed, 744 insertions, 744 deletions
diff --git a/qtruby/rubylib/designer/rbuic/domtool.cpp b/qtruby/rubylib/designer/rbuic/domtool.cpp index e42933b9..65ea3a71 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.cpp +++ b/qtruby/rubylib/designer/rbuic/domtool.cpp @@ -51,9 +51,9 @@ \sa hasProperty() */ -TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - TTQDomElement 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 @@ TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, /*! \overload */ -TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - TTQString comment; + TQString comment; return readProperty( e, name, defValue, comment ); } @@ -79,9 +79,9 @@ TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, \sa readProperty() */ -bool DomTool::hasProperty( const TTQDomElement& e, const TTQString& name ) +bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) { - TTQDomElement 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 TTQDomElement& e, const TTQString& name ) return false; } -TTQStringList DomTool::propertiesOfType( const TTQDomElement& e, const TTQString& type ) +TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) { - TTQStringList result; - TTQDomElement n; + TQStringList result; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { - TTQDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == type ) result += n.attribute( "name" ); } @@ -107,20 +107,20 @@ TTQStringList DomTool::propertiesOfType( const TTQDomElement& e, const TTQString } -TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue ) { - TTQString dummy; + TQString dummy; return elementToVariant( e, defValue, dummy ); } /*! Interprets element \a e as variant and returns the result of the interpretation. */ -TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue, TTQString &comment ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ) { - TTQVariant v; + TQVariant v; if ( e.tagName() == "rect" ) { - TTQDomElement 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 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQRect( x, y, w, h ) ); + v = TQVariant( TQRect( x, y, w, h ) ); } else if ( e.tagName() == "point" ) { - TTQDomElement 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 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& y = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQPoint( x, y ) ); + v = TQVariant( TQPoint( x, y ) ); } else if ( e.tagName() == "size" ) { - TTQDomElement 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 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQSize( w, h ) ); + v = TQVariant( TQSize( w, h ) ); } else if ( e.tagName() == "color" ) { - v = TTQVariant( readColor( e ) ); + v = TQVariant( readColor( e ) ); } else if ( e.tagName() == "font" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQFont 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 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& f.setStrikeOut( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( f ); + v = TQVariant( f ); } else if ( e.tagName() == "string" ) { - v = TTQVariant( e.firstChild().toText().data() ); - TTQDomElement 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 = TTQVariant( TTQCString( e.firstChild().toText().data() ) ); + v = TQVariant( TQCString( e.firstChild().toText().data() ) ); } else if ( e.tagName() == "number" ) { bool ok = true; - v = TTQVariant( e.firstChild().toText().data().toInt( &ok ) ); + v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); if ( !ok ) - v = TTQVariant( e.firstChild().toText().data().toDouble() ); + v = TQVariant( e.firstChild().toText().data().toDouble() ); } else if ( e.tagName() == "bool" ) { - TTQString t = e.firstChild().toText().data(); - v = TTQVariant( t == "true" || t == "1", 0 ); + TQString t = e.firstChild().toText().data(); + v = TQVariant( t == "true" || t == "1", 0 ); } else if ( e.tagName() == "pixmap" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "iconset" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "image" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "enum" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "set" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "sizepolicy" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQSizePolicy sp; + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; while ( !n3.isNull() ) { if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TTQSizePolicy::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 = TTQVariant( sp ); + v = TQVariant( sp ); } else if ( e.tagName() == "cursor" ) { - v = TTQVariant( TTQCursor( e.firstChild().toText().data().toInt() ) ); + v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) ); } else if ( e.tagName() == "stringlist" ) { - TTQStringList lst; - TTQDomElement n; + TQStringList lst; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) lst << n.firstChild().toText().data(); - v = TTQVariant( lst ); + v = TQVariant( lst ); } else if ( e.tagName() == "date" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int y, m, d; y = m = d = 0; while ( !n3.isNull() ) { @@ -239,9 +239,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQDate( y, m, d ) ); + v = TQVariant( TQDate( y, m, d ) ); } else if ( e.tagName() == "time" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, m, s; h = m = s = 0; while ( !n3.isNull() ) { @@ -253,9 +253,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& s = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQTime( h, m, s ) ); + v = TQVariant( TQTime( h, m, s ) ); } else if ( e.tagName() == "datetime" ) { - TTQDomElement 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 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQDateTime( TTQDate( y, mo, d ), TTQTime( h, mi, s ) ) ); + v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) ); } return v; } @@ -282,9 +282,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& /*! Returns the color which is returned in the dom element \a e. */ -TTQColor DomTool::readColor( const TTQDomElement &e ) +TQColor DomTool::readColor( const TQDomElement &e ) { - TTQDomElement 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 @@ TTQColor DomTool::readColor( const TTQDomElement &e ) n = n.nextSibling().toElement(); } - return TTQColor( r, g, b ); + return TQColor( r, g, b ); } /*! @@ -306,9 +306,9 @@ TTQColor DomTool::readColor( const TTQDomElement &e ) \sa hasAttribute() */ -TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - TTQDomElement 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 @@ TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name /*! \overload */ -TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - TTQString comment; + TQString comment; return readAttribute( e, name, defValue, comment ); } @@ -333,9 +333,9 @@ TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name \sa readAttribute() */ -bool DomTool::hasAttribute( const TTQDomElement& e, const TTQString& name ) +bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) { - TTQDomElement 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 TTQDomElement& e, const TTQString& name ) return false; } -static bool toBool( const TTQString& s ) +static bool toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } @@ -354,11 +354,11 @@ static bool toBool( const TTQString& s ) /*! Convert Qt 2.x format to Qt 3.0 format if necessary */ -void DomTool::fixDocument( TTQDomDocument& doc ) +void DomTool::fixDocument( TQDomDocument& doc ) { - TTQDomElement e; - TTQDomNode n; - TTQDomNodeList nl; + TQDomElement e; + TQDomNode n; + TQDomNodeList nl; int i = 0; e = doc.firstChild().toElement(); @@ -374,8 +374,8 @@ void DomTool::fixDocument( TTQDomDocument& 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++ ) { - TTQDomElement el = nl.item(i).toElement(); - TTQString 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( TTQDomDocument& doc ) e.setAttribute("stdsetdef", 1 ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement 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( TTQDomDocument& doc ) nl = doc.elementsByTagName( "attribute" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement 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( TTQDomDocument& doc ) nl = doc.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement 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( TTQDomDocument& doc ) nl = doc.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement 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 cf3bfc65..8f3aa67c 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.h +++ b/qtruby/rubylib/designer/rbuic/domtool.h @@ -36,17 +36,17 @@ class TQDomDocument; class DomTool : public Qt { public: - static TTQVariant readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ); - static TTQVariant readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ); - static bool hasProperty( const TTQDomElement& e, const TTQString& name ); - static TTQStringList propertiesOfType( const TTQDomElement& e, const TTQString& type ); - static TTQVariant elementToVariant( const TTQDomElement& e, const TTQVariant& defValue ); - static TTQVariant elementToVariant( const TTQDomElement& e, const TTQVariant& defValue, TTQString &comment ); - static TTQVariant readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ); - static TTQVariant readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ); - static bool hasAttribute( const TTQDomElement& e, const TTQString& name ); - static TTQColor readColor( const TTQDomElement &e ); - static void fixDocument( TTQDomDocument& ); + 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 365eaf7d..3377a1b0 100644 --- a/qtruby/rubylib/designer/rbuic/embed.cpp +++ b/qtruby/rubylib/designer/rbuic/embed.cpp @@ -52,14 +52,14 @@ struct EmbedImage int width, height, depth; int numColors; TQRgb* colorTable; - TTQString name; - TTQString cname; + TQString name; + TQString cname; bool alpha; }; -static TTQString convertToCIdentifier( const char *s ) +static TQString convertToCIdentifier( const char *s ) { - TTQString r = s; + TQString r = s; int len = r.length(); if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) r[0] = '_'; @@ -71,16 +71,16 @@ static TTQString convertToCIdentifier( const char *s ) } -static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes ) +static ulong embedData( TQTextStream& out, const uchar* input, int nbytes ) { #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION - TTQByteArray bazip( qCompress( input, nbytes ) ); + TQByteArray bazip( qCompress( input, nbytes ) ); ulong len = bazip.size(); #else ulong len = nbytes; #endif static const char hexdigits[] = "0123456789abcdef"; - TTQString s; + TQString s; for ( int i=0; i<(int)len; i++ ) { if ( (i%14) == 0 ) { s += "\n "; @@ -105,7 +105,7 @@ static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes ) return len; } -static void embedData( TTQTextStream& out, const TQRgb* input, int n ) +static void embedData( TQTextStream& out, const TQRgb* input, int n ) { out << hex; const TQRgb *v = input; @@ -120,19 +120,19 @@ static void embedData( TTQTextStream& out, const TQRgb* input, int n ) out << dec; // back to decimal mode } -void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& images ) +void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images ) { - TTQString cProject = convertToCIdentifier( project ); + TQString cProject = convertToCIdentifier( project ); - TTQStringList::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: " << TTQDateTime::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( TTQTextStream& out, const char* project, const TTQStringList& i out << indent << "class MimeSourceFactory_" << cProject << " < TQt::MimeSourceFactory" << endl; out << endl; - TTQPtrList<EmbedImage> list_image; + TQPtrList<EmbedImage> list_image; int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { - TTQImage 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( TTQTextStream& out, const char* project, const TTQStringList& i e->colorTable = new TQRgb[e->numColors]; e->alpha = img.hasAlphaBuffer(); memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb)); - TTQFileInfo fi( *it ); + TQFileInfo fi( *it ); e->name = fi.fileName(); - e->cname = TTQString("@@image_%1").arg( image_count++); + e->cname = TQString("@@image_%1").arg( image_count++); list_image.append( e ); out << "# " << *it << endl; - TTQString imgname = (const char *)e->cname; + TQString imgname = (const char *)e->cname; - TTQString s; + TQString s; if ( e->depth == 1 ) - img = img.convertBitOrder(TTQImage::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( TTQTextStream& out, const char* project, const TTQStringList& i { out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, " << e->width << ", " << e->height << ", " << e->depth << ", " - << (e->numColors ? e->cname + "_ctable" : TTQString::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 eb9d6ee7..bbb0c7f6 100644 --- a/qtruby/rubylib/designer/rbuic/form.cpp +++ b/qtruby/rubylib/designer/rbuic/form.cpp @@ -42,7 +42,7 @@ #include <zlib.h> -static TTQByteArray unzipXPM( TTQString 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 TTQByteArray unzipXPM( TTQString data, ulong& length ) ba[1] = ( length & 0x00ff0000 ) >> 16; ba[2] = ( length & 0x0000ff00 ) >> 8; ba[3] = ( length & 0x000000ff ); - TTQByteArray baunzip = qUncompress( ba, baSize ); + TQByteArray baunzip = qUncompress( ba, baSize ); delete[] ba; return baunzip; } -static TTQString imageDataName(TTQString name) { - TTQString result = name + "_data"; +static TQString imageDataName(TQString name) { + TQString result = name + "_data"; result.replace("@", "@@"); return result; } @@ -84,15 +84,15 @@ static TTQString imageDataName(TTQString name) { \sa createFormDecl(), createObjectImpl() */ -void Uic::createFormImpl( const TTQDomElement &e ) +void Uic::createFormImpl( const TQDomElement &e ) { - TTQDomElement n; - TTQDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if (hasKDEwidget) { out << indent << "retquire 'Korundum'" << endl << endl; @@ -101,16 +101,16 @@ void Uic::createFormImpl( const TTQDomElement &e ) } // generate local and local includes retquired - TTQStringList globalIncludes, localIncludes; - TTQStringList::Iterator it; - TTQStringList sqlClasses; + TQStringList globalIncludes, localIncludes; + TQStringList::Iterator it; + TQStringList sqlClasses; - TTQMap<TTQString, CustomInclude> customWidgetIncludes; - TTQMap<TTQString, TTQString> functionImpls; + TQMap<TQString, CustomInclude> customWidgetIncludes; + TQMap<TQString, TQString> functionImpls; // find additional slots - TTQStringList extraSlots; - TTQStringList 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 TTQDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString 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 TTQDomElement &e ) } // find signals - TTQStringList 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 TTQDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString 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 - TTQStringList extraFunctions; + TQStringList extraFunctions; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "functions" ) { // compatibility - for ( TTQDomElement 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" ) { - TTQString fname; + TQString fname; if( !n2.attribute("name").isNull() ) { fname = n2.attribute( "name" ); @@ -165,11 +165,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) } } } else if ( n.tagName() == "customwidgets" ) { - TTQDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "customwidget" ) { - TTQDomElement n3 = n2.firstChild().toElement(); - TTQString 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 TTQDomElement &e ) ++indent; // additional attributes (from Designer) - TTQStringList 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 TTQDomElement &e ) // Someday it should be uncommented. //if ( n.parentNode().toElement().tagName() != "variables" ) // continue; - TTQString access = n.attribute( "access", "protected" ); - TTQString 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 TTQDomElement &e ) // additional includes (local or global ) and forward declaractions nl = e.parentNode().toElement().elementsByTagName( "include" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString 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" && !TTQFile::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 TTQDomElement &e ) // do the local includes afterwards, since global includes have priority on clashes for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString 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" && !TTQFile::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 TTQDomElement &e ) // additional custom widget headers nl = e.parentNode().toElement().elementsByTagName( "header" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString 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 TTQDomElement &e ) // grab slots/funcs defined in ui.h files - for(TTQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) + for(TQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) { if((*it).right( 5 ) == ".ui.h") { - TTQFile f((*it)); + TQFile f((*it)); if( f.open( IO_ReadOnly ) ) { - TTQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$"); - TTQRegExp re2("^end\\s*$"); - TTQTextStream t( &f ); - TTQString 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,7 +366,7 @@ void Uic::createFormImpl( const TTQDomElement &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 - TTQString name = getClassName( nl.item(i).toElement() ); + TQString name = getClassName( nl.item(i).toElement() ); if ( name == "Spacer" ) { globalIncludes += "tqlayout.h"; globalIncludes += "tqapplication.h"; @@ -375,8 +375,8 @@ void Uic::createFormImpl( const TTQDomElement &e ) if ( name.mid( 4 ) == "ListView" ) globalIncludes += "tqheader.h"; if ( name != objClass ) { - int wid = WidgetDatabase::idFromClassName( name.replace( TTQRegExp("^TQt::"), "Q" ) ); - TTQMap<TTQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); + int wid = WidgetDatabase::idFromClassName( name.replace( TQRegExp("^TQt::"), "Q" ) ); + TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); if ( it == customWidgetIncludes.end() ) globalIncludes += WidgetDatabase::includeFile( wid ); } @@ -417,22 +417,22 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << endl; // find out what images are retquired - TTQStringList retquiredImages; + TQStringList retquiredImages; 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++ ) { - TTQString img = "@"; + TQString img = "@"; retquiredImages += (img + nl.item(j).firstChild().toText().data()); } } // register the object and unify its name - TTQString loadFunction(objName); + TQString loadFunction(objName); objName = registerObject( objName ); - TTQStringList images; - TTQStringList xpmImages; + TQStringList images; + TQStringList xpmImages; if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { // create images @@ -443,19 +443,19 @@ void Uic::createFormImpl( const TTQDomElement &e ) nl = n.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); + TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); if ( !retquiredImages.contains( img ) ) continue; - TTQDomElement tmp = nl.item(i).firstChild().toElement(); + TQDomElement tmp = nl.item(i).firstChild().toElement(); if ( tmp.tagName() != "data" ) continue; - TTQString format = tmp.attribute("format", "PNG" ); - TTQString 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(); - TTQByteArray 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 TTQDomElement &e ) ++indent; int a ; for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "0x" << TTQString(data[2*a]) << TTQString(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" << TTQString(data[2*a]) << TTQString(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 TTQDomElement &e ) // create pixmaps for all images if ( !images.isEmpty() ) { - TTQStringList::Iterator it; + TQStringList::Iterator it; for ( it = images.begin(); it != images.end(); ++it ) { out << indent << (*it) << " = TQt::Pixmap.new()" << endl; out << indent << (*it) << ".loadFromData(" << imageDataName(*it) << ", " << imageDataName(*it) << ".length, \"PNG\")" << endl; @@ -567,21 +567,21 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << indent << "statusBar()" << endl; // set the properties - TTQSize 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" ) ); - TTQString prop = n.attribute("name"); - TTQDomElement n2 = n.firstChild().toElement(); - TTQString value = setObjectProperty( objClass, TTQString::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") { - TTQDomElement 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 TTQDomElement &e ) n3 = n3.nextSibling().toElement(); } } else { - TTQString call; + TQString call; if ( stdset ) { call = mkStdSet( prop ) + "(" + value + ")"; } else { @@ -620,12 +620,12 @@ void Uic::createFormImpl( const TTQDomElement &e ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, "self" ); - TTQString comment; - TTQString 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; - TTQVariant 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 TTQDomElement &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(); - TTQString s = getClassName( n ); + TQString s = getClassName( n ); if ( s == "TQt::DataBrowser" || s == "TQt::DataView" ) { - TTQString objName = getObjectName( n ); - TTQString tab = getDatabaseInfo( n, "table" ); - TTQString con = getDatabaseInfo( n, "connection" ); + TQString objName = getObjectName( n ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString con = getDatabaseInfo( n, "connection" ); out << indent << objName << "Form = TQt::SqlForm.new(self, \"" << objName << "Form\")" << endl; - TTQDomElement 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 TTQDomElement &e ) out << endl; nl = n.elementsByTagName( "connection" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString sender, receiver, signal, slot; - for ( TTQDomElement 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" ) @@ -756,11 +756,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) } else if ( n.tagName() == "tabstops" ) { // setup tab order out << endl; - TTQString lastName; - TTQDomElement n2 = n.firstChild().toElement(); + TQString lastName; + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "tabstop" ) { - TTQString 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 TTQDomElement &e ) // QtRuby - FIXME: what the heck is this ? // buddies bool firstBuddy = true; - for ( TTQValueList<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 TTQDomElement &e ) for ( i = 0; i < (int) nl.length(); i++ ) { if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) needFontEventHandler = true; - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataTable" || s == "TQt::DataBrowser" ) { if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) continue; @@ -832,7 +832,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << " if ev.type() == TQt::Event::ApplicationFontChange " << endl; for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); - TTQStringList 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 TTQDomElement &e ) ++indent; if ( needSqlTableEventHandler ) { for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataTable" ) { n = nl.item(i).toElement(); - TTQString c = TTQString("@") + getObjectName( n ); - TTQString conn = getDatabaseInfo( n, "connection" ); - TTQString 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 TTQDomElement &e ) if ( needSqlDataBrowserEventHandler ) { nl = e.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataBrowser" ) { - TTQString obj = getObjectName( nl.item(i).toElement() ); - TTQString tab = getDatabaseInfo( nl.item(i).toElement(), + TQString obj = getObjectName( nl.item(i).toElement() ); + TQString tab = getDatabaseInfo( nl.item(i).toElement(), "table" ); - TTQString 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 TTQDomElement &e ) int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; bool createWarning = true; - TTQString fname = Parser::cleanArgs( *it ); - TTQMap<TTQString, TTQString>::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( "{" ); - TTQString 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 TTQDomElement &e ) out << endl; int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; - TTQString fname = Parser::cleanArgs( *it ); - TTQMap<TTQString, TTQString>::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( "{" ); - TTQString 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 TTQDomElement &e ) Traverses recursively over all children. */ -void Uic::createFormImpl( const TTQDomElement& e, const TTQString& form, const TTQString& connection, const TTQString& table ) +void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ) { if ( e.tagName() == "widget" && e.attribute( "class" ) != "TQt::DataTable" ) { - TTQString 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; } } - TTQDomElement 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 TTQDomElement& e, const TTQString& form, const T // Generate a QtRuby signal/slot definition. -void Uic::rubySlot(TTQStringList::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 4286ec03..aebf63c3 100644 --- a/qtruby/rubylib/designer/rbuic/globaldefs.h +++ b/qtruby/rubylib/designer/rbuic/globaldefs.h @@ -27,17 +27,17 @@ #define BOXLAYOUT_DEFAULT_SPACING 6 #ifndef NO_STATIC_COLORS -static TTQColor *backColor1 = 0; -static TTQColor *backColor2 = 0; -static TTQColor *selectedBack = 0; +static TQColor *backColor1 = 0; +static TQColor *backColor2 = 0; +static TQColor *selectedBack = 0; static void init_colors() { if ( backColor1 ) return; - backColor1 = new TTQColor( 236, 245, 255 ); - backColor2 = new TTQColor( 250, 250, 250 ); - selectedBack = new TTQColor( 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 7e2a4f83..b3cb6905 100644 --- a/qtruby/rubylib/designer/rbuic/main.cpp +++ b/qtruby/rubylib/designer/rbuic/main.cpp @@ -48,7 +48,7 @@ #include <zlib.h> #define RBUIC_VERSION "0.9" -void getDBConnections( Uic& uic, TTQString& 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; - TTQStringList 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; - TTQApplication app(argc, argv, false); - TTQString uicClass; + TQApplication app(argc, argv, false); + TQString uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { - TTQCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - TTQCString 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 = TTQCString(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); - TTQFile 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 ); } - TTQTextStream out( &fileOut ); + TQTextStream out( &fileOut ); if ( imagecollection ) { - out.setEncoding( TTQTextStream::Latin1 ); + out.setEncoding( TQTextStream::Latin1 ); Uic::embed( out, projectName, images ); return 0; } - out.setEncoding( TTQTextStream::UnicodeUTF8 ); - TTQFile file( fileName ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "rbuic: Could not open file '%s' ", fileName ); - TTQDomDocument doc; - TTQString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; if ( !doc.setContent( &file, &errMsg, &errLine ) ) - qFatal( TTQString("rbuic: Failed to parse %s: ") + errMsg + TTQString (" 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: " << TTQDateTime::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 = TQt::Application.new(ARGV)" << endl; } - TTQString s; + TQString s; getDBConnections( uic, s); out << s; - out << indent << "w = " << (subcl? TTQString::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, TTQString& s) +void getDBConnections( Uic& uic, TQString& s) { int num = 0; - for ( TTQStringList::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()) { - TTQString inc = (num ? TTQString::number(num+1) : TTQString::null); + TQString inc = (num ? TQString::number(num+1) : TQString::null); s += "\n # Connection to database " + (*it) + "\n\n"; s += " DRIVER" + inc + " =\t\t'TQMYSQL3'" + (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 bb1422b1..512da9ed 100644 --- a/qtruby/rubylib/designer/rbuic/object.cpp +++ b/qtruby/rubylib/designer/rbuic/object.cpp @@ -41,15 +41,15 @@ \sa createObjectImpl() */ -void Uic::createObjectDecl( const TTQDomElement& e ) +void Uic::createObjectDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { out << indent << registerObject(getLayoutName(e) ) << endl; } else { - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore TQLayoutWidgets @@ -68,15 +68,15 @@ void Uic::createObjectDecl( const TTQDomElement& e ) Children are not traversed recursively. */ -void Uic::createAttrDecl( const TTQDomElement& e ) +void Uic::createAttrDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { // out << indent << registerObject(getLayoutName(e) ) << endl; } else { - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore TQLayoutWidgets @@ -84,11 +84,11 @@ void Uic::createAttrDecl( const TTQDomElement& e ) return; // register the object and unify its name objName = registerObject( objName ); - TTQString attr(objName); - attr.replace(TTQChar('@'), "attr_reader :"); + TQString attr(objName); + attr.replace(TQChar('@'), "attr_reader :"); out << indent << attr << endl; - TTQDomElement 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 TTQDomElement& e ) static bool createdCentralWidget = false; -TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& par, const TTQString& layout ) +TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) { - TTQString parent( par ); + TQString parent( par ); if ( parent == "self" && isMainWindow ) { if ( !createdCentralWidget ) out << indent << "setCentralWidget(TQt::Widget.new(self, \"qt_central_widget\"))" << endl; createdCentralWidget = true; parent = "centralWidget()"; } - TTQDomElement n; - TTQString objClass, objName, fullObjName; + TQDomElement n; + TQString objClass, objName, fullObjName; int numItems = 0; int numColumns = 0; int numRows = 0; @@ -130,7 +130,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent return objName; objName = getObjectName( e ); - TTQString definedName = objName; + TQString definedName = objName; bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget"; if ( isTmpObject ) { if ( objClass[0] == 'Q' ) @@ -148,10 +148,10 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( layout.isEmpty() ) { // register the object and unify its name objName = registerObject( objName ); - out << indent << (isTmpObject ? TTQString::fromLatin1("") : TTQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl; + out << indent << (isTmpObject ? TQString::fromLatin1("") : TQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl; } else { // the layout widget is not necessary, hide it by creating its child in the parent - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent fullObjName = objName; if ( objClass == "TQt::AxWidget" ) { - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - TTQString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop == "database" ) continue; - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( prop == "frameworkCode" ) continue; if ( objClass == "TQt::MultiLineEdit" && - TTQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) continue; - TTQString call = fullObjName + "."; + TQString call = fullObjName + "."; if (! call.startsWith("@")) { call.prepend("@"); } @@ -249,8 +249,8 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent out << indent << call << endl; } } else if ( n.tagName() == "item" ) { - TTQString call; - TTQString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListBox" ) { call = createListBoxItemImpl( n, fullObjName, &value ); @@ -274,7 +274,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent trout << indent << call << endl; } } else if ( objClass.mid( 4 ) == "ListView" ) { - call = createListViewItemImpl( n, fullObjName, TTQString::null ); + call = createListViewItemImpl( n, fullObjName, TQString::null ); if ( !call.isEmpty() ) { if ( numItems == 0 ) trout << indent << fullObjName << ".clear()" << endl; @@ -284,8 +284,8 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( !call.isEmpty() ) numItems++; } else if ( n.tagName() == "column" || n.tagName() == "row" ) { - TTQString call; - TTQString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListView" ) { call = createListViewColumnImpl( n, fullObjName, &value ); @@ -314,9 +314,9 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( objClass == "TQt::TabWidget" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, fullObjName ); - TTQString comment; - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent } else if ( objClass == "TQt::WidgetStack" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent } else if ( objClass == "TQt::ToolBox" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, objName ); - TTQString comment; - TTQString 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 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent application font or palette change handlers in createFormImpl(). */ -void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp ) +void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ) { - TTQDomElement n; - TTQString objClass = getClassName( e ); + TQDomElement n; + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString 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 TTQDomElement & e, const TTQString& exc bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - TTQString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop != exclusiveProp ) continue; - TTQString 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 << "\", TQt::Variant.new(" << value << "))" << endl; @@ -394,11 +394,11 @@ void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exc Resource::saveProperty() and DomTool::elementToVariant. If you change one, change all. */ -TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset ) +TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ) { - TTQString v; + TQString v; if ( e.tagName() == "rect" ) { - TTQDomElement 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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = v.arg(x).arg(y).arg(w).arg(h); } else if ( e.tagName() == "point" ) { - TTQDomElement 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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Point.new(%1, %2)"; v = v.arg(x).arg(y); } else if ( e.tagName() == "size" ) { - TTQDomElement 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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Size.new(%1, %2)"; v = v.arg(w).arg(h); } else if ( e.tagName() == "color" ) { - TTQDomElement 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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Color.new(%1, %2, %3)"; v = v.arg(r).arg(g).arg(b); } else if ( e.tagName() == "font" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQString fontname; + TQDomElement n3 = e.firstChild().toElement(); + TQString fontname; if ( !obj.isEmpty() ) { fontname = obj + "_font"; out << indent << fontname << " = TQt::Font.new(" << obj << ".font())" << endl; @@ -487,8 +487,8 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = fontname; } } else if ( e.tagName() == "string" ) { - TTQString txt = e.firstChild().toText().data(); - TTQString com = getComment( e.parentNode() ); + TQString txt = e.firstChild().toText().data(); + TQString com = getComment( e.parentNode() ); if ( prop == "toolTip" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) { if ( !obj.isEmpty() ) @@ -511,7 +511,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "\"%1\""; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "number" ) { - // FIXME: hack. QtRuby needs a TTQKeySequence to build an accel + // FIXME: hack. QtRuby needs a TQKeySequence to build an accel if( e.parentNode().toElement().attribute("name") == "accel" ) v = "TQt::KeySequence.new(%1)"; else @@ -528,15 +528,15 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob if( !externPixmaps ) v.prepend( '@' ); if ( !pixmapLoaderFunction.isEmpty() ) { - v.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - v.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( e.tagName() == "iconset" ) { v = "TQt::IconSet.new(%1)"; - TTQString s = e.firstChild().toText().data(); + TQString s = e.firstChild().toText().data(); if ( !pixmapLoaderFunction.isEmpty() ) { - s.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - s.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } else { s.prepend("@"); } @@ -545,22 +545,22 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = e.firstChild().toText().data() + ".convertToImage()"; } else if ( e.tagName() == "enum" ) { v = "%1::%2"; - TTQString oc = objClass; - TTQString ev = e.firstChild().toText().data(); - if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TTQListView::Manual of WithMode enum in 3.0 + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0 oc = "TQt::ScrollView"; v = v.arg( oc ).arg( ev ); } else if ( e.tagName() == "set" ) { - TTQString keys( e.firstChild().toText().data() ); - TTQStringList lst = TTQStringList::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 - TTQStringList::Iterator it = lst.begin(); + TQStringList::Iterator it = lst.begin(); for ( ; it != lst.end(); ++it ) { #else - for ( TTQStringList::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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob } v += ""; } else if ( e.tagName() == "sizepolicy" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQSizePolicy sp; + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; while ( !n3.isNull() ) { if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TTQSizePolicy::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(); } - TTQString tmp = (obj.isEmpty() ? TTQString::fromLatin1("self") : obj) + "."; + TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("self") : obj) + "."; v = "TQt::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" ) { - TTQPalette pal; + TQPalette pal; bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; - TTQDomElement n; + TQDomElement n; if ( no_pixmaps ) { n = e.firstChild().toElement(); while ( !n.isNull() ) { - TTQColorGroup cg; + TQColorGroup cg; if ( n.tagName() == "active" ) { cg = loadColorGroup( n ); pal.setActive( cg ); @@ -605,17 +605,17 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob n = n.nextSibling().toElement(); } } - if ( no_pixmaps && pal == TTQPalette( pal.active().button(), pal.active().background() ) ) { + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { v = "TQt::Palette.new(TQt::Color.new(%1,%2,%3), TQt::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 { - TTQString palette = "pal"; + TQString palette = "pal"; if ( !pal_used ) { out << indent << palette << " = TQt::Palette.new()" << endl; pal_used = true; } - TTQString cg = "cg"; + TQString cg = "cg"; if ( !cg_used ) { out << indent << cg << " = TQt::ColorGroup.new()" << endl; cg_used = true; @@ -643,7 +643,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Cursor.new(%1)"; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "date" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int y, m, d; y = m = d = 0; while ( !n3.isNull() ) { @@ -658,7 +658,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Date.new(%1,%2,%3)"; v = v.arg(y).arg(m).arg(d); } else if ( e.tagName() == "time" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, m, s; h = m = s = 0; while ( !n3.isNull() ) { @@ -673,7 +673,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Time.new(%1, %2, %3)"; v = v.arg(h).arg(m).arg(s); } else if ( e.tagName() == "datetime" ) { - TTQDomElement 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 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::DateTime.new(TQt::Date.new(%1, %2, %3), TQt::Time.new(%4, %5, %6))"; v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); } else if ( e.tagName() == "stringlist" ) { - TTQStringList l; - TTQDomElement n3 = e.firstChild().toElement(); - TTQString listname; + TQStringList l; + TQDomElement n3 = e.firstChild().toElement(); + TQString listname; if ( !obj.isEmpty() ) { listname = obj + "_strlist"; out << indent << listname << " = ["; @@ -736,9 +736,9 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob /*! Extracts a named object property from \a e. */ -TTQDomElement Uic::getObjectProperty( const TTQDomElement& e, const TTQString& name ) +TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name ) { - TTQDomElement 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 8cfe5da4..8c264a63 100644 --- a/qtruby/rubylib/designer/rbuic/parser.cpp +++ b/qtruby/rubylib/designer/rbuic/parser.cpp @@ -30,22 +30,22 @@ class NormalizeObject : public TQObject { public: - NormalizeObject() : TTQObject() {} - static TTQCString normalizeSignalSlot( const char *signalSlot ) { return TTQObject::normalizeSignalSlot( signalSlot ); } + NormalizeObject() : TQObject() {} + static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } }; -TTQString Parser::cleanArgs( const TTQString &func ) +TQString Parser::cleanArgs( const TQString &func ) { - TTQString slot( func ); + TQString slot( func ); int begin = slot.find( "(" ) + 1; - TTQString args = slot.mid( begin ); + TQString args = slot.mid( begin ); args = args.left( args.find( ")" ) ); - TTQStringList lst = TTQStringList::split( ',', args ); - TTQString res = slot.left( begin ); - for ( TTQStringList::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 += ","; - TTQString arg = *it; + TQString arg = *it; int pos = 0; if ( ( pos = arg.find( "&" ) ) != -1 ) { arg = arg.left( pos + 1 ); @@ -55,7 +55,7 @@ TTQString Parser::cleanArgs( const TTQString &func ) arg = arg.simplifyWhiteSpace(); if ( ( pos = arg.find( ':' ) ) != -1 ) arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); - TTQStringList l = TTQStringList::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 @@ TTQString Parser::cleanArgs( const TTQString &func ) } res += ")"; - return TTQString::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 e03f1b1c..ace96d9e 100644 --- a/qtruby/rubylib/designer/rbuic/parser.h +++ b/qtruby/rubylib/designer/rbuic/parser.h @@ -26,7 +26,7 @@ class Parser { public: - static TTQString cleanArgs( const TTQString &func ); + static TQString cleanArgs( const TQString &func ); }; diff --git a/qtruby/rubylib/designer/rbuic/subclassing.cpp b/qtruby/rubylib/designer/rbuic/subclassing.cpp index ef19cf53..0a093a43 100644 --- a/qtruby/rubylib/designer/rbuic/subclassing.cpp +++ b/qtruby/rubylib/designer/rbuic/subclassing.cpp @@ -39,14 +39,14 @@ \sa createSubDecl() */ -void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) +void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass ) { - TTQDomElement n; - TTQDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - TTQStringList::Iterator it, it2, it3; + TQStringList::Iterator it, it2, it3; - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; if (hasKDEwidget) { @@ -82,10 +82,10 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) out << endl; // find additional slots - TTQStringList publicSlots, protectedSlots, privateSlots; - TTQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; - TTQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; - TTQMap<TTQString, TTQString> 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 TTQDomElement &e, const TTQString& subClass ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString returnType = n.attribute( "returnType", "void" ); - TTQString 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 ); - TTQString specifier = n.attribute( "specifier" ); - TTQString 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 TTQDomElement &e, const TTQString& subClass ) // compatibility with early 3.0 betas nl = e.parentNode().toElement().elementsByTagName( "function" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString 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 TTQDomElement &e, const TTQString& subClass ) if ( !publicSlots.isEmpty() ) { for ( it = publicSlots.begin(), it2 = publicSlotTypes.begin(), it3 = publicSlotSpecifier.begin(); it != publicSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -149,8 +149,8 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) if ( !protectedSlots.isEmpty() ) { for ( it = protectedSlots.begin(), it2 = protectedSlotTypes.begin(), it3 = protectedSlotSpecifier.begin(); it != protectedSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -173,8 +173,8 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) if ( !privateSlots.isEmpty() ) { for ( it = privateSlots.begin(), it2 = privateSlotTypes.begin(), it3 = privateSlotSpecifier.begin(); it != privateSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString 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 106e9879..9343b4e6 100644 --- a/qtruby/rubylib/designer/rbuic/uic.cpp +++ b/qtruby/rubylib/designer/rbuic/uic.cpp @@ -67,42 +67,42 @@ void RubyIndent::calc() } -TTQString Uic::getComment( const TTQDomNode& n ) +TQString Uic::getComment( const TQDomNode& n ) { - TTQDomNode 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 TTQString::null; + return TQString::null; } -TTQString Uic::mkBool( bool b ) +TQString Uic::mkBool( bool b ) { return b? "true" : "false"; } -TTQString Uic::mkBool( const TTQString& s ) +TQString Uic::mkBool( const TQString& s ) { return mkBool( s == "true" || s == "1" ); } -bool Uic::toBool( const TTQString& s ) +bool Uic::toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } -TTQString Uic::fixString( const TTQString &str ) +TQString Uic::fixString( const TQString &str ) { - TTQString s( str ); - s.replace( TTQRegExp( "\\\\" ), "\\\\" ); - s.replace( TTQRegExp( "\"" ), "\\\"" ); - s.replace( TTQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); return "\"" + s + "\""; } -TTQString Uic::trcall( const TTQString& sourceText, const TTQString& comment ) +TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) { if ( sourceText.isEmpty() && comment.isEmpty() ) return "nil"; @@ -112,19 +112,19 @@ TTQString Uic::trcall( const TTQString& sourceText, const TTQString& comment ) return trmacro + "(" + fixString( sourceText ) + "," + fixString( comment ) + ")"; } -TTQString Uic::mkStdSet( const TTQString& prop ) +TQString Uic::mkStdSet( const TQString& prop ) { - return TTQString( "set" ) + prop[0].upper() + prop.mid(1); + return TQString( "set" ) + prop[0].upper() + prop.mid(1); } -bool Uic::isEmptyFunction( const TTQString& fname ) +bool Uic::isEmptyFunction( const TQString& fname ) { - TTQMap<TTQString, TTQString>::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( "{" ); - TTQString 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 TTQString& fname ) The class Uic encapsulates the user interface compiler (uic). */ -Uic::Uic( const TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, - bool subcl, const TTQString &trm, const TTQString& subClass, - bool omitForwardDecls, TTQString &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 TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, uiFileVersion = doc.firstChild().toElement().attribute("version"); stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); - TTQDomElement e = doc.firstChild().firstChild().toElement(); - TTQDomElement 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", TTQString::number( defSpacing ) ).toInt(); - defMargin = e.attribute( "margin", TTQString::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 TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, /*! Extracts a pixmap loader function from \a e */ -TTQString Uic::getPixmapLoaderFunction( const TTQDomElement& e ) +TQString Uic::getPixmapLoaderFunction( const TQDomElement& e ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "pixmapfunction" ) return n.firstChild().toText().data(); } - return TTQString::null; + return TQString::null; } /*! Extracts the forms class name from \a e */ -TTQString Uic::getFormClassName( const TTQDomElement& e ) +TQString Uic::getFormClassName( const TQDomElement& e ) { - TTQDomElement n; - TTQString cn; + TQDomElement n; + TQString cn; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "class" ) { - TTQString s = n.firstChild().toText().data(); + TQString s = n.firstChild().toText().data(); int i; while ( ( i = s.find(' ' )) != -1 ) s[i] = '_'; @@ -224,16 +224,16 @@ TTQString Uic::getFormClassName( const TTQDomElement& e ) /*! Extracts a Ruby class name from \a e. */ -TTQString Uic::getClassName( const TTQDomElement& e ) +TQString Uic::getClassName( const TQDomElement& e ) { - TTQString s = e.attribute( "class" ); + TQString s = e.attribute( "class" ); if ( s.isEmpty() && e.tagName() == "toolbar" ) s = "TQt::ToolBar"; else if ( s.isEmpty() && e.tagName() == "menubar" ) s = "TQt::MenuBar"; else { - TTQRegExp r("^([QK])(\\S+)"); + TQRegExp r("^([QK])(\\S+)"); if( r.search( s ) != -1 ) { if (r.cap(1) == "K") { hasKDEwidget = true; @@ -255,11 +255,11 @@ TTQString Uic::getClassName( const TTQDomElement& e ) /*! Returns TRUE if database framework code is generated, else FALSE. */ -bool Uic::isFrameworkCodeGenerated( const TTQDomElement& e ) +bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) { - TTQDomElement n = getObjectProperty( e, "frameworkCode" ); + TQDomElement n = getObjectProperty( e, "frameworkCode" ); if ( n.attribute("name") == "frameworkCode" && - !DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant( true, 0 ) ).toBool() ) + !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true, 0 ) ).toBool() ) return false; return true; } @@ -267,36 +267,36 @@ bool Uic::isFrameworkCodeGenerated( const TTQDomElement& e ) /*! Extracts an object name from \a e. It's stored in the 'name' property. */ -TTQString Uic::getObjectName( const TTQDomElement& e ) +TQString Uic::getObjectName( const TQDomElement& e ) { - TTQDomElement n = getObjectProperty( e, "name" ); + TQDomElement n = getObjectProperty( e, "name" ); if ( n.firstChild().toElement().tagName() == "cstring" ) return n.firstChild().toElement().firstChild().toText().data(); - return TTQString::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 TQLayoutWidget). */ -TTQString Uic::getLayoutName( const TTQDomElement& e ) +TQString Uic::getLayoutName( const TQDomElement& e ) { - TTQDomElement p = e.parentNode().toElement(); - TTQString tail = TTQString::null; + TQDomElement p = e.parentNode().toElement(); + TQString tail = TQString::null; if ( getClassName(p) != "TQt::LayoutWidget" ) tail = "Layout"; - TTQDomElement 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(); } -TTQString Uic::getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ) +TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag ) { - TTQDomElement n; - TTQDomElement n1; + TQDomElement n; + TQDomElement n1; int child = 0; // database info is a stringlist stored in this order if ( tag == "connection" ) @@ -306,27 +306,27 @@ TTQString Uic::getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ) else if ( tag == "field" ) child = 2; else - return TTQString::null; + return TQString::null; n = getObjectProperty( e, "database" ); if ( n.firstChild().toElement().tagName() == "stringlist" ) { // find correct stringlist entry - TTQDomElement 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 TTQString::null; + return TQString::null; return n1.firstChild().toText().data(); } - return TTQString::null; + return TQString::null; } -void Uic::registerLayouts( const TTQDomElement &e ) +void Uic::registerLayouts( const TQDomElement &e ) { if ( layouts.contains(e.tagName()) ) createObjectDecl(e); - TTQDomNodeList 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 TTQDomElement &e ) /*! Returns include file for class \a className or a null string. */ -TTQString Uic::getInclude( const TTQString& className ) +TQString Uic::getInclude( const TQString& className ) { int wid = WidgetDatabase::idFromClassName( className ); if ( wid != -1 ) return WidgetDatabase::includeFile( wid ); - return TTQString::null; + return TQString::null; } -void Uic::createActionDecl( const TTQDomElement& e ) +void Uic::createActionDecl( const TQDomElement& e ) { - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; out << indent << objName << endl; if ( e.tagName() == "actiongroup" ) { - for ( TTQDomElement 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 TTQDomElement &n, const TTQString &parent ) +void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) { - for ( TTQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { - TTQString 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 << "= TQt::Action.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl; else if ( ae.tagName() == "actiongroup" ) @@ -369,20 +369,20 @@ void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent ) continue; bool subActionsDone = false; bool hasMenuText = false; - TTQString actionText; - for ( TTQDomElement 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" ) ); - TTQString prop = n2.attribute("name"); + TQString prop = n2.attribute("name"); if ( prop == "name" ) continue; - TTQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; - TTQString call = objName + "."; + TQString call = objName + "."; if ( stdset ) { call += mkStdSet( prop ) + "(" + value + ")"; } else { @@ -405,13 +405,13 @@ void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent ) subActionsDone = true; } } - // workaround for loading pre-3.3 files expecting bogus TTQAction 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; } } -TTQString get_dock( const TTQString &d ) +TQString get_dock( const TQString &d ) { if ( d == "0" ) return "DockUnmanaged"; @@ -430,16 +430,16 @@ TTQString get_dock( const TTQString &d ) return ""; } -void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent ) +void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - TTQDomNodeList nl = n.elementsByTagName( "toolbar" ); + TQDomNodeList nl = n.elementsByTagName( "toolbar" ); for ( int i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement ae = nl.item( i ).toElement(); - TTQString dock = get_dock( ae.attribute( "dock" ) ); - TTQString objName = "@" + getObjectName( ae ); + TQDomElement ae = nl.item( i ).toElement(); + TQString dock = get_dock( ae.attribute( "dock" ) ); + TQString objName = "@" + getObjectName( ae ); out << indent << objName << " = TQt::ToolBar.new(\"\", self, " << dock << ")" << endl; createObjectImpl( ae, parentClass, parent ); - for ( TTQDomElement 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 TTQDomElement &n, const TTQString &parentClas if ( n2.attribute( "class" ) != "Spacer" ) { createObjectImpl( n2, "TQt::ToolBar", objName ); } else { - TTQString child = createSpacerImpl( n2, parentClass, parent, objName ); + TQString child = createSpacerImpl( n2, parentClass, parent, objName ); out << indent << "TQt::Application.sendPostedEvents( " << objName << ", TQt::Event::ChildInserted)" << endl; out << indent << objName << ".boxLayout().addItem(" << child << ")" << endl; @@ -458,21 +458,21 @@ void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClas } } -void Uic::createMenuBarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent ) +void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - TTQString objName = "@" + getObjectName( n ); + TQString objName = "@" + getObjectName( n ); out << indent << objName << " = TQt::MenuBar.new( self, \"" << objName.mid(1) << "\" )" << endl; createObjectImpl( n, parentClass, parent ); int i = 0; - TTQDomElement c = n.firstChild().toElement(); + TQDomElement c = n.firstChild().toElement(); while ( !c.isNull() ) { if ( c.tagName() == "item" ) { - TTQString itemName = "@" + c.attribute( "name" ); + TQString itemName = "@" + c.attribute( "name" ); out << endl; out << indent << itemName << " = TQt::PopupMenu.new( self )" << endl; createPopupMenuImpl( c, parentClass, itemName ); out << indent << objName << ".insertItem( \"\", " << itemName << ", " << i << " )" << endl; - TTQString 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 TTQDomElement &n, const TTQString &parentClas } } -void Uic::createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ) +void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ) { int i = 0; - for ( TTQDomElement 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" ) { - TTQDomElement n2 = n.nextSibling().toElement(); + TQDomElement n2 = n.nextSibling().toElement(); if ( n2.tagName() == "item" ) { // the action has a sub menu - TTQString itemName = "@" + n2.attribute( "name" ); - TTQString itemText = n2.attribute( "text" ); + TQString itemName = "@" + n2.attribute( "name" ); + TQString itemText = n2.attribute( "text" ); out << indent << itemName << " = TQt::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 TTQDomElement &e, const TTQString &parentCl Creates implementation of an listbox item tag. */ -TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + 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 @@ TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &p pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -557,16 +557,16 @@ TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &p Creates implementation of an iconview item tag. */ -TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString &parent ) +TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + 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 @@ TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString & pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -594,15 +594,15 @@ TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString & Creates implementation of an listview item tag. */ -TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString &parent, - const TTQString &parentItem ) +TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ) { - TTQString s; + TQString s; - TTQDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); bool hasChildren = e.elementsByTagName( "item" ).count() > 0; - TTQString item; + TQString item; if ( hasChildren ) { item = registerObject( "item" ); @@ -623,22 +623,22 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & else s += "TQt::ListViewItem.new(" + parent + ", " + lastItem + ")\n"; - TTQStringList textes; - TTQStringList pixmaps; + TQStringList textes; + TQStringList pixmaps; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) textes << v.toString(); else if ( attrib == "pixmap" ) { - TTQString pix = v.toString(); + TQString pix = v.toString(); if (!pix.isEmpty()) { pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } pixmaps << pix; } @@ -651,9 +651,9 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & for ( int i = 0; i < (int)textes.count(); ++i ) { if ( !textes[ i ].isEmpty() ) - s += indent + item + ".setText(" + TTQString::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(" + TTQString::number( i ) + ", " + pixmaps[ i ] + ")\n"; + s += indent + item + ".setPixmap(" + TQString::number( i ) + ", " + pixmaps[ i ] + ")\n"; } lastItem = item; @@ -664,18 +664,18 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & Creates implementation of an listview column tag. */ -TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; bool clickable = false, resizeable = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + 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 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "clickable" ) clickable = v.toBool(); @@ -699,7 +699,7 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString if ( value ) *value = trcall( txt, com ); - TTQString 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 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString return s; } -TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQString objClass = getClassName( e.parentNode().toElement() ); - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; - TTQString 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" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + 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 + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "field" ) field = v.toString(); @@ -745,9 +745,9 @@ TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString // ### This generated code sucks! We have to set the number of // rows/cols before and then only do setLabel/() - // ### careful, though, since TTQDataTable has an API which makes this code pretty good + // ### careful, though, since TQDataTable has an API which makes this code pretty good - TTQString s; + TQString s; if ( isRow ) { s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1 )\n"; if ( pix.isEmpty() ) @@ -780,13 +780,13 @@ TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString /*! Creates the implementation of a layout tag. Called from createObjectImpl(). */ -TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout ) +TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) { - TTQDomElement n; - TTQString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); - TTQString qlayout = "TQt::VBoxLayout.new"; + TQString qlayout = "TQt::VBoxLayout.new"; if ( objClass == "hbox" ) qlayout = "TQt::HBoxLayout.new"; else if ( objClass == "grid" ) @@ -796,11 +796,11 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent objName = registerObject( getLayoutName( e ) ); layoutObjects += objName; - TTQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); - TTQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); - TTQString resizeMode = DomTool::readProperty( e, "resizeMode", TTQString::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(); - TTQString optcells; + TQString optcells; if ( isGrid ) optcells = "1, 1, "; if ( (parentClass == "TQt::GroupBox" || parentClass == "TQt::ButtonGroup") && layout.isEmpty() ) { @@ -827,10 +827,10 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent if ( !isGrid ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "spacer" ) { - TTQString 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() ) ) { - TTQString 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 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent } } else { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - TTQDomElement 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 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent if ( colspan < 1 ) colspan = 1; if ( n.tagName() == "spacer" ) { - TTQString 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 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent out << indent << objName << ".addItem(" << child << ", " << row << ", " << col << ")" << endl; } else if ( tags.contains( n.tagName() ) ) { - TTQString child = createObjectImpl( n, parentClass, parent, objName ); + TQString child = createObjectImpl( n, parentClass, parent, objName ); out << endl; - TTQString o = "Widget"; + TQString o = "Widget"; if ( isLayout( child ) ) o = "Layout"; if ( rowspan * colspan != 1 ) @@ -877,20 +877,20 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent -TTQString Uic::createSpacerImpl( const TTQDomElement &e, const TTQString& /*parentClass*/, const TTQString& /*parent*/, const TTQString& /*layout*/) +TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/) { - TTQDomElement n; - TTQString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); objName = registerObject( getObjectName( e ) ); - TTQSize size = DomTool::readProperty( e, "sizeHint", TTQSize( 0, 0 ) ).toSize(); - TTQString 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 - TTQRect geom = DomTool::readProperty( e, "geometry", TTQRect(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 TTQString& name, const TTQDomElement& e ) +void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e ) { - TTQColorGroup cg; + TQColorGroup cg; int r = -1; - TTQDomElement n = e.firstChild().toElement(); - TTQString color; + TQDomElement n = e.firstChild().toElement(); + TQString color; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - TTQColor col = DomTool::readColor( n ); + TQColor col = DomTool::readColor( n ); color = "TQt::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 TTQString& name, const TTQDomElement& e ) out << indent << name << ".setColor(TQt::ColorGroup::" << ColorRole[r] << ", " << color << ")" << endl; } } else if ( n.tagName() == "pixmap" ) { - TTQString pixmap = n.firstChild().toText().data(); + TQString pixmap = n.firstChild().toText().data(); pixmap.prepend("@"); if ( !pixmapLoaderFunction.isEmpty() ) { - pixmap.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pixmap.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } out << indent << name << ".setBrush(TQt::ColorGroup::" << ColorRole[r] << ", TQt::Brush.new(" << color << ", " << pixmap << "))" << endl; @@ -953,16 +953,16 @@ void Uic::createColorGroupImpl( const TTQString& name, const TTQDomElement& e ) Auxiliary function to load a color group. The colorgroup must not contain pixmaps. */ -TTQColorGroup Uic::loadColorGroup( const TTQDomElement &e ) +TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) { - TTQColorGroup cg; + TQColorGroup cg; int r = -1; - TTQDomElement n = e.firstChild().toElement(); - TTQColor col; + TQDomElement n = e.firstChild().toElement(); + TQColor col; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - cg.setColor( (TTQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); } n = n.nextSibling().toElement(); } @@ -973,10 +973,10 @@ TTQColorGroup Uic::loadColorGroup( const TTQDomElement &e ) the database \a connection and \a table. */ -bool Uic::isWidgetInTable( const TTQDomElement& e, const TTQString& connection, const TTQString& table ) +bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ) { - TTQString conn = getDatabaseInfo( e, "connection" ); - TTQString 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 TTQDomElement& e, const TTQString& connection, Registers all database connections, cursors and forms. */ -void Uic::registerDatabases( const TTQDomElement& e ) +void Uic::registerDatabases( const TQDomElement& e ) { - TTQDomElement n; - TTQDomNodeList 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(); - TTQString conn = getDatabaseInfo( n, "connection" ); - TTQString tab = getDatabaseInfo( n, "table" ); - TTQString 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 TTQDomElement& e ) \sa registeredName(), isObjectRegistered() */ -TTQString Uic::registerObject( const TTQString& name ) +TQString Uic::registerObject( const TQString& name ) { if ( objectNames.isEmpty() ) { // some temporary variables we need @@ -1025,7 +1025,7 @@ TTQString Uic::registerObject( const TTQString& name ) objectNames += "cg"; objectNames += "pal"; } - TTQString result("@"); + TQString result("@"); result += name; int i; while ( ( i = result.find(' ' )) != -1 ) { @@ -1034,10 +1034,10 @@ TTQString Uic::registerObject( const TTQString& name ) if ( objectNames.contains( result ) ) { int i = 2; - while ( objectNames.contains( result + "_" + TTQString::number(i) ) ) + while ( objectNames.contains( result + "_" + TQString::number(i) ) ) i++; result += "_"; - result += TTQString::number(i); + result += TQString::number(i); } objectNames += result; objectMapper.insert( name, result ); @@ -1050,7 +1050,7 @@ TTQString Uic::registerObject( const TTQString& name ) \sa registerObject(), isObjectRegistered() */ -TTQString Uic::registeredName( const TTQString& name ) +TQString Uic::registeredName( const TQString& name ) { if ( !objectMapper.contains( name ) ) return name; @@ -1060,24 +1060,24 @@ TTQString Uic::registeredName( const TTQString& name ) /*! Returns whether the object \a name was registered yet or not. */ -bool Uic::isObjectRegistered( const TTQString& name ) +bool Uic::isObjectRegistered( const TQString& name ) { return objectMapper.contains( name ); } /*! - Unifies the entries in stringlist \a list. Should really be a TTQStringList feature. + Unifies the entries in stringlist \a list. Should really be a TQStringList feature. */ -TTQStringList Uic::unique( const TTQStringList& list ) +TQStringList Uic::unique( const TQStringList& list ) { - TTQStringList result; + TQStringList result; if ( list.isEmpty() ) return result; - TTQStringList l = list; + TQStringList l = list; l.sort(); result += l.first(); - for ( TTQStringList::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 @@ TTQStringList Uic::unique( const TTQStringList& list ) /*! Creates an instance of class \a objClass, with parent \a parent and name \a objName */ -TTQString Uic::createObjectInstance( const TTQString& objClass, const TTQString& parent, const TTQString& objName ) +TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ) { if ( objClass.mid( 4 ) == "ComboBox" ) { @@ -1098,7 +1098,7 @@ TTQString Uic::createObjectInstance( const TTQString& objClass, const TTQString& return objClass + ".new(" + parent + ", \"" + objName.mid(1) + "\")"; } -bool Uic::isLayout( const TTQString& 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 18177ee7..ddfcc1be 100644 --- a/qtruby/rubylib/designer/rbuic/uic.h +++ b/qtruby/rubylib/designer/rbuic/uic.h @@ -37,12 +37,12 @@ public: void setTabStop(uint n) {tabStop = n; calc();} void operator++() {++current; calc();} void operator--() {--current; calc();} - operator TTQString() {return indstr;} + operator TQString() {return indstr;} private: uint tabStop; uint current; - TTQString indstr; + TQString indstr; void calc(); }; @@ -51,95 +51,95 @@ private: class Uic : public Qt { public: - Uic( const TTQString &fn, TTQTextStream& out, TTQDomDocument doc, bool subcl, - const TTQString &trm, const TTQString& subclname, bool omitForwardDecls, - TTQString &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 TTQDomElement &e ); - - void createSubImpl( const TTQDomElement &e, const TTQString& subclname ); - - void createObjectDecl( const TTQDomElement& e ); - void createAttrDecl( const TTQDomElement& e ); - void createActionDecl( const TTQDomElement& e ); - void createActionImpl( const TTQDomElement& e, const TTQString &parent ); - void createToolbarImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - void createMenuBarImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - void createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - TTQString createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - TTQString createLayoutImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - TTQString createObjectInstance( const TTQString& objClass, const TTQString& parent, const TTQString& objName ); - TTQString createSpacerImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - void createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp ); - TTQString createListBoxItemImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createIconViewItemImpl( const TTQDomElement &e, const TTQString &parent ); - TTQString createListViewColumnImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createTableRowColumnImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createListViewItemImpl( const TTQDomElement &e, const TTQString &parent, - const TTQString &parentItem ); - void createColorGroupImpl( const TTQString& cg, const TTQDomElement& e ); - TTQColorGroup loadColorGroup( const TTQDomElement &e ); - - TTQDomElement getObjectProperty( const TTQDomElement& e, const TTQString& name ); - TTQString getPixmapLoaderFunction( const TTQDomElement& e ); - TTQString getFormClassName( const TTQDomElement& e ); - TTQString getClassName( const TTQDomElement& e ); - TTQString getObjectName( const TTQDomElement& e ); - TTQString getLayoutName( const TTQDomElement& e ); - TTQString getInclude( const TTQString& className ); - - TTQString setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset ); - - TTQString registerObject( const TTQString& name ); - TTQString registeredName( const TTQString& name ); - bool isObjectRegistered( const TTQString& name ); - TTQStringList unique( const TTQStringList& ); - - TTQString trcall( const TTQString& sourceText, const TTQString& comment = "" ); - - static void embed( TTQTextStream& out, const char* project, const TTQStringList& images ); - - friend void getDBConnections(Uic& uic, TTQString& 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 TTQDomElement& e ); - - TTQTextStream& out; - TTQTextOStream trout; - TTQString languageChangeBody; - TTQStringList objectNames; - TTQMap<TTQString,TTQString> objectMapper; - TTQStringList tags; - TTQStringList layouts; - TTQString formName; - TTQString lastItem; - TTQString 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 TTQString& k, const TTQString& b ) + Buddy( const TQString& k, const TQString& b ) : key( k ), buddy( b ) {} Buddy(){} // for valuelist - TTQString key; - TTQString buddy; + TQString key; + TQString buddy; bool operator==( const Buddy& other ) const { return (key == other.key); } }; struct CustomInclude { - TTQString header; - TTQString location; + TQString header; + TQString location; }; - TTQValueList<Buddy> buddies; + TQValueList<Buddy> buddies; - TTQStringList layoutObjects; - bool isLayout( const TTQString& 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; - TTQString uiFileVersion; - TTQString nameOfClass; - TTQString pixmapLoaderFunction; + TQString uiFileVersion; + TQString nameOfClass; + TQString pixmapLoaderFunction; - void registerDatabases( const TTQDomElement& e ); - bool isWidgetInTable( const TTQDomElement& e, const TTQString& connection, const TTQString& table ); - bool isFrameworkCodeGenerated( const TTQDomElement& e ); - TTQString getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ); - void createFormImpl( const TTQDomElement& e, const TTQString& form, const TTQString& connection, const TTQString& table ); - TTQStringList dbConnections; - TTQMap< TTQString, TTQStringList > dbCursors; - TTQMap< TTQString, TTQStringList > 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 TTQString mkBool( bool b ); - static TTQString mkBool( const TTQString& s ); - bool toBool( const TTQString& s ); - static TTQString fixString( const TTQString &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 TTQString mkStdSet( const TTQString& prop ); - static TTQString getComment( const TTQDomNode& n ); + static TQString mkStdSet( const TQString& prop ); + static TQString getComment( const TQDomNode& n ); int defSpacing, defMargin; - TTQString fileName; + TQString fileName; bool writeSlotImpl; - bool isEmptyFunction( const TTQString& fname ); - TTQMap<TTQString, TTQString> functionImpls; + bool isEmptyFunction( const TQString& fname ); + TQMap<TQString, TQString> functionImpls; - void rubySlot(TTQStringList::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 cc4779a2..f8a0f0fd 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp @@ -41,17 +41,17 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static TTQDict<int> *className2Id = 0; +static TQDict<int> *className2Id = 0; static int dbcount = 0; static int dbcustomcount = 200; -static TTQStrList *wGroups; -static TTQStrList *invisibleGroups; +static TQStrList *wGroups; +static TQStrList *invisibleGroups; static bool whatsThisLoaded = false; static TQPluginManager<WidgetInterface> *widgetPluginManager = 0; static bool plugins_set_up = false; static bool was_in_setup = false; -TTQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager; +TQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager; WidgetDatabaseRecord::WidgetDatabaseRecord() { @@ -117,14 +117,14 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups = new TQStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new TTQDict<int>( dbdictsize ); + className2Id = new TQDict<int>( dbdictsize ); className2Id->setAutoDelete( true ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "pushbutton.xpm"; - r->name = "TTQPushButton"; + 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 = "TTQToolButton"; + 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 = "TTQRadioButton"; + 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 = "TTQCheckBox"; + 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 = "TTQGroupBox"; + 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 = "TTQButtonGroup"; + 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 = "TTQFrame"; + 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 = "TTQTabWidget"; + 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 = "TTQListBox"; + 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 = "TTQListView"; + 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 = "TTQIconView"; + 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 = "TTQTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -231,7 +231,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "datatable.xpm"; r->includeFile = "tqdatatable.h"; - r->name = "TTQDataTable"; + 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 = "TTQLineEdit"; + 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 = "TTQSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; @@ -283,7 +283,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "multilineedit.xpm"; - r->name = "TTQMultiLineEdit"; + 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 = "TTQTextEdit"; + 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 = "TTQComboBox"; + 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 = "TTQSlider"; + 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 = "TTQScrollBar"; + 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 = "TTQDial"; + 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 = "TTQLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -375,7 +375,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "progress.xpm"; - r->name = "TTQProgressBar"; + 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 = "TTQTextView"; + 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 = "TTQTextBrowser"; + 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 = "TTQWidget"; + r->name = "TQWidget"; r->isForm = true; r->group = widgetGroup( "Forms" ); append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQDialog"; + r->name = "TQDialog"; r->group = widgetGroup( "Forms" ); r->isForm = true; append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQWizard"; + r->name = "TQWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = true; @@ -443,7 +443,7 @@ void WidgetDatabase::setupDataBase( int id ) append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQSplitter"; + r->name = "TQSplitter"; r->group = widgetGroup( "Temp" ); r->includeFile = "tqsplitter.h"; r->isContainer = true; @@ -476,7 +476,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQMainWindow"; + r->name = "TQMainWindow"; r->includeFile = "tqmainwindow.h"; r->group = widgetGroup( "Temp" ); r->isContainer = true; @@ -486,7 +486,7 @@ void WidgetDatabase::setupDataBase( int id ) #ifndef QT_NO_SQL r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQDataBrowser"; + r->name = "TQDataBrowser"; r->includeFile = "tqdatabrowser.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Browser"; @@ -497,7 +497,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQDataView"; + r->name = "TQDataView"; r->includeFile = "tqdataview.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data View"; @@ -517,8 +517,8 @@ void WidgetDatabase::setupPlugins() if ( plugins_set_up ) return; plugins_set_up = true; - TTQStringList widgets = widgetManager()->featureList(); - for ( TTQStringList::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 - TTQIconSet icon = iface->iconSet( *it ); + TQIconSet icon = iface->iconSet( *it ); if ( !icon.pixmap().isNull() ) - r->icon = new TTQIconSet( icon ); + r->icon = new TQIconSet( icon ); #endif - TTQString 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. */ -TTQIconSet WidgetDatabase::iconSet( int id ) +TQIconSet WidgetDatabase::iconSet( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQIconSet(); + return TQIconSet(); #if !defined(UIC) && !defined(RESOURCE) if ( !r->icon ) - r->icon = new TTQIconSet( 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 TTQIconSet(); + return TQIconSet(); #endif } @@ -590,12 +590,12 @@ TTQIconSet WidgetDatabase::iconSet( int id ) Returns the classname of the widget which is registered as \a id. */ -TTQString WidgetDatabase::className( int id ) +TQString WidgetDatabase::className( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->name; } @@ -603,12 +603,12 @@ TTQString WidgetDatabase::className( int id ) Returns the group to which the widget registered as \a id belongs. */ -TTQString WidgetDatabase::group( int id ) +TQString WidgetDatabase::group( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->group; } @@ -616,12 +616,12 @@ TTQString WidgetDatabase::group( int id ) id. */ -TTQString WidgetDatabase::toolTip( int id ) +TQString WidgetDatabase::toolTip( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->toolTip; } @@ -629,12 +629,12 @@ TTQString WidgetDatabase::toolTip( int id ) as \a id. */ -TTQString WidgetDatabase::whatsThis( int id ) +TQString WidgetDatabase::whatsThis( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->whatsThis; } @@ -642,12 +642,12 @@ TTQString WidgetDatabase::whatsThis( int id ) Returns the include file if the widget which is registered as \a id. */ -TTQString WidgetDatabase::includeFile( int id ) +TQString WidgetDatabase::includeFile( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::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; } -TTQString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase( id ); - TTQString n = className( id ); + TQString n = className( id ); if ( n == "TQLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' ) @@ -688,13 +688,13 @@ TTQString WidgetDatabase::createWidgetName( int id ) WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += TTQString::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 TTQString &name ) +int WidgetDatabase::idFromClassName( const TQString &name ) { setupDataBase( -1 ); if ( name.isEmpty() ) @@ -715,7 +715,7 @@ int WidgetDatabase::idFromClassName( const TTQString &name ) return -1; } -bool WidgetDatabase::hasWidget( const TTQString &name ) +bool WidgetDatabase::hasWidget( const TQString &name ) { return className2Id->find( name ) != 0; } @@ -748,14 +748,14 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r ) insert( dbcount++, r ); } -TTQString WidgetDatabase::widgetGroup( const TTQString &g ) +TQString WidgetDatabase::widgetGroup( const TQString &g ) { if ( wGroups->find( g ) == -1 ) wGroups->append( g ); return g; } -bool WidgetDatabase::isGroupEmpty( const TTQString &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 TTQString &grp ) return true; } -TTQString WidgetDatabase::widgetGroup( int i ) +TQString WidgetDatabase::widgetGroup( int i ) { setupDataBase( -1 ); if ( i >= 0 && i < (int)wGroups->count() ) return wGroups->at( i ); - return TTQString::null; + return TQString::null; } int WidgetDatabase::numWidgetGroups() @@ -781,7 +781,7 @@ int WidgetDatabase::numWidgetGroups() return wGroups->count(); } -bool WidgetDatabase::isGroupVisible( const TTQString &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 TTQString &docPath ) +void WidgetDatabase::loadWhatsThis( const TQString &docPath ) { - TTQString whatsthisFile = docPath + "/whatsthis"; - TTQFile f( whatsthisFile ); + TQString whatsthisFile = docPath + "/whatsthis"; + TQFile f( whatsthisFile ); if ( !f.open( IO_ReadOnly ) ) return; - TTQTextStream ts( &f ); + TQTextStream ts( &f ); while ( !ts.atEnd() ) { - TTQString s = ts.readLine(); - TTQStringList l = TTQStringList::split( " | ", s ); + TQString s = ts.readLine(); + TQStringList l = TQStringList::split( " | ", s ); int id = idFromClassName( l[ 1 ] ); WidgetDatabaseRecord *r = at( id ); if ( r ) @@ -823,10 +823,10 @@ void WidgetDatabase::loadWhatsThis( const TTQString &docPath ) whatsThisLoaded = true; } -TTQPluginManager<WidgetInterface> *widgetManager() +TQPluginManager<WidgetInterface> *widgetManager() { if ( !widgetPluginManager ) { - widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TTQApplication::libraryPaths(), "/designer" ); + widgetPluginManager = new TQPluginManager<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 ebcfc00d..63ccd829 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.h +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.h @@ -33,10 +33,10 @@ struct WidgetDatabaseRecord { WidgetDatabaseRecord(); ~WidgetDatabaseRecord(); - TTQString iconSet, name, group, toolTip, whatsThis, includeFile; + TQString iconSet, name, group, toolTip, whatsThis, includeFile; uint isContainer : 1; uint isForm : 1; - TTQIconSet *icon; + TQIconSet *icon; int nameCounter; }; @@ -50,35 +50,35 @@ public: static int count(); static int startCustom(); - static TTQIconSet iconSet( int id ); - static TTQString className( int id ); - static TTQString group( int id ); - static TTQString toolTip( int id ); - static TTQString whatsThis( int id ); - static TTQString 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 TTQString &name ); - static TTQString 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 TTQString widgetGroup( const TTQString &g ); - static TTQString widgetGroup( int i ); + static TQString widgetGroup( const TQString &g ); + static TQString widgetGroup( int i ); static int numWidgetGroups(); - static bool isGroupVisible( const TTQString &g ); - static bool isGroupEmpty( const TTQString &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 TTQString &docPath ); + static void loadWhatsThis( const TQString &docPath ); - static bool hasWidget( const TTQString &name ); + static bool hasWidget( const TQString &name ); }; diff --git a/qtruby/rubylib/designer/uilib/qui.cpp b/qtruby/rubylib/designer/uilib/qui.cpp index 912918f6..05b094bb 100644 --- a/qtruby/rubylib/designer/uilib/qui.cpp +++ b/qtruby/rubylib/designer/uilib/qui.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - tqui.cpp - A ruby wrapper for the TTQWidgetFactory class + tqui.cpp - A ruby wrapper for the TQWidgetFactory class ------------------- begin : Wed Mar 14 2004 copyright : (C) 2004 by Richard Dale @@ -47,31 +47,31 @@ static VALUE qwidget_factory_class; static VALUE create(int argc, VALUE * argv, VALUE /*klass*/) { - TTQWidget * topLevelWidget = 0; + TQWidget * topLevelWidget = 0; VALUE result = Qnil; if (argc == 0 || argc > 4) { rb_raise(rb_eArgError, "wrong number of arguments (%d)\n", argc); } - TTQObject * connector = 0; + TQObject * connector = 0; if (argc >= 2) { if (TYPE(argv[1]) == T_DATA) { smokeruby_object *o = value_obj_info(argv[1]); if (o != 0) { - connector = (TTQObject *) o->ptr; + connector = (TQObject *) o->ptr; } } else { rb_raise(rb_eArgError, "invalid argument type\n"); } } - TTQWidget * parent = 0; + TQWidget * parent = 0; if (argc >= 3) { if (TYPE(argv[2]) == T_DATA) { smokeruby_object *o = value_obj_info(argv[2]); if (o != 0) { - parent = (TTQWidget *) o->ptr; + parent = (TQWidget *) o->ptr; } } else { rb_raise(rb_eArgError, "invalid argument type\n"); @@ -88,18 +88,18 @@ create(int argc, VALUE * argv, VALUE /*klass*/) } if (TYPE(argv[0]) == T_STRING) { - topLevelWidget = TTQWidgetFactory::create(TTQString(StringValuePtr(argv[0])), connector, parent, name); + topLevelWidget = TQWidgetFactory::create(TQString(StringValuePtr(argv[0])), connector, parent, name); } else if (TYPE(argv[0]) == T_DATA) { - TTQIODevice * dev = 0; + TQIODevice * dev = 0; smokeruby_object *o = value_obj_info(argv[0]); if (o != 0 && o->ptr != 0 && o->classId == qt_Smoke->idClass("TQIODevice")) { - dev = (TTQIODevice *) o->ptr; + dev = (TQIODevice *) o->ptr; } else { rb_raise(rb_eArgError, "invalid argument type\n"); } - topLevelWidget = TTQWidgetFactory::create(dev, connector, parent, name); + topLevelWidget = TQWidgetFactory::create(dev, connector, parent, name); } else { rb_raise(rb_eArgError, "invalid argument type\n"); } @@ -121,7 +121,7 @@ create(int argc, VALUE * argv, VALUE /*klass*/) static VALUE load_images(VALUE klass, VALUE dir) { - TTQWidgetFactory::loadImages(TTQString(StringValuePtr(dir))); + TQWidgetFactory::loadImages(TQString(StringValuePtr(dir))); return klass; } @@ -129,14 +129,14 @@ static VALUE widgets(VALUE /*self*/) { VALUE result = rb_ary_new(); - TTQStringList widgetList = TTQWidgetFactory::widgets(); + TQStringList widgetList = TQWidgetFactory::widgets(); - for (TTQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) { - TTQString widgetName = *it; + for (TQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) { + TQString widgetName = *it; if (widgetName.startsWith("Q")) { - widgetName.replace(0, 1, TTQString("TQt::")); + widgetName.replace(0, 1, TQString("TQt::")); } else if (widgetName.startsWith("K")) { - widgetName.replace(0, 1, TTQString("KDE::")); + widgetName.replace(0, 1, TQString("KDE::")); } rb_ary_push(result, rb_str_new2(widgetName.latin1())); } @@ -147,15 +147,15 @@ widgets(VALUE /*self*/) static VALUE supports_widget(VALUE /*self*/, VALUE widget) { - TTQString widgetName(StringValuePtr(widget)); + TQString widgetName(StringValuePtr(widget)); if (widgetName.startsWith("TQt::")) { - widgetName.replace(0, 4, TTQString("Q")); + widgetName.replace(0, 4, TQString("Q")); } else if (widgetName.startsWith("KDE::")) { - widgetName.replace(0, 5, TTQString("K")); + widgetName.replace(0, 5, TQString("K")); } - return TTQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse; + return TQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse; } void |