summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/designer/rbuic
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/designer/rbuic')
-rw-r--r--qtruby/rubylib/designer/rbuic/LICENSE.GPL12
-rw-r--r--qtruby/rubylib/designer/rbuic/domtool.cpp150
-rw-r--r--qtruby/rubylib/designer/rbuic/domtool.h26
-rw-r--r--qtruby/rubylib/designer/rbuic/embed.cpp78
-rw-r--r--qtruby/rubylib/designer/rbuic/form.cpp286
-rw-r--r--qtruby/rubylib/designer/rbuic/globaldefs.h12
-rw-r--r--qtruby/rubylib/designer/rbuic/main.cpp52
-rw-r--r--qtruby/rubylib/designer/rbuic/object.cpp258
-rw-r--r--qtruby/rubylib/designer/rbuic/parser.cpp24
-rw-r--r--qtruby/rubylib/designer/rbuic/parser.h2
-rw-r--r--qtruby/rubylib/designer/rbuic/subclassing.cpp46
-rw-r--r--qtruby/rubylib/designer/rbuic/uic.cpp470
-rw-r--r--qtruby/rubylib/designer/rbuic/uic.h182
-rw-r--r--qtruby/rubylib/designer/rbuic/widgetdatabase.cpp178
-rw-r--r--qtruby/rubylib/designer/rbuic/widgetdatabase.h34
-rw-r--r--qtruby/rubylib/designer/rbuic/widgetinterface.h2
16 files changed, 906 insertions, 906 deletions
diff --git a/qtruby/rubylib/designer/rbuic/LICENSE.GPL b/qtruby/rubylib/designer/rbuic/LICENSE.GPL
index 3e51afd8..853306c0 100644
--- a/qtruby/rubylib/designer/rbuic/LICENSE.GPL
+++ b/qtruby/rubylib/designer/rbuic/LICENSE.GPL
@@ -109,9 +109,9 @@ above, provided that you also meet all of these conditions:
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
+ the Program is not retquired to print an announcement.)
-These requirements apply to the modified work as a whole. If
+These retquirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
@@ -177,7 +177,7 @@ However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
- 5. You are not required to accept this License, since you have not
+ 5. You are not retquired to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
@@ -263,14 +263,14 @@ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+TO THE TQUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ 12. IN NO EVENT UNLESS RETQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSETQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
diff --git a/qtruby/rubylib/designer/rbuic/domtool.cpp b/qtruby/rubylib/designer/rbuic/domtool.cpp
index 65ea3a71..e42933b9 100644
--- a/qtruby/rubylib/designer/rbuic/domtool.cpp
+++ b/qtruby/rubylib/designer/rbuic/domtool.cpp
@@ -51,9 +51,9 @@
\sa hasProperty()
*/
-TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
+TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment )
{
- TQDomElement n;
+ TTQDomElement 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 @@ TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, co
/*!
\overload
*/
-TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
+TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue )
{
- TQString comment;
+ TTQString comment;
return readProperty( e, name, defValue, comment );
}
@@ -79,9 +79,9 @@ TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, co
\sa readProperty()
*/
-bool DomTool::hasProperty( const TQDomElement& e, const TQString& name )
+bool DomTool::hasProperty( const TTQDomElement& e, const TTQString& name )
{
- TQDomElement n;
+ TTQDomElement 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 TQDomElement& e, const TQString& name )
return false;
}
-TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type )
+TTQStringList DomTool::propertiesOfType( const TTQDomElement& e, const TTQString& type )
{
- TQStringList result;
- TQDomElement n;
+ TTQStringList result;
+ TTQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
- TQDomElement n2 = n.firstChild().toElement();
+ TTQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == type )
result += n.attribute( "name" );
}
@@ -107,20 +107,20 @@ TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& t
}
-TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue )
+TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue )
{
- TQString dummy;
+ TTQString dummy;
return elementToVariant( e, defValue, dummy );
}
/*!
Interprets element \a e as variant and returns the result of the interpretation.
*/
-TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment )
+TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue, TTQString &comment )
{
- TQVariant v;
+ TTQVariant v;
if ( e.tagName() == "rect" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -133,9 +133,9 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQRect( x, y, w, h ) );
+ v = TTQVariant( TTQRect( x, y, w, h ) );
} else if ( e.tagName() == "point" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -144,9 +144,9 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQPoint( x, y ) );
+ v = TTQVariant( TTQPoint( x, y ) );
} else if ( e.tagName() == "size" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -155,12 +155,12 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQSize( w, h ) );
+ v = TTQVariant( TTQSize( w, h ) );
} else if ( e.tagName() == "color" ) {
- v = TQVariant( readColor( e ) );
+ v = TTQVariant( readColor( e ) );
} else if ( e.tagName() == "font" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQFont f( defValue.toFont() );
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQFont f( defValue.toFont() );
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
f.setFamily( n3.firstChild().toText().data() );
@@ -176,58 +176,58 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
f.setStrikeOut( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( f );
+ v = TTQVariant( f );
} else if ( e.tagName() == "string" ) {
- v = TQVariant( e.firstChild().toText().data() );
- TQDomElement n = e;
+ v = TTQVariant( e.firstChild().toText().data() );
+ TTQDomElement n = e;
n = n.nextSibling().toElement();
if ( n.tagName() == "comment" )
comment = n.firstChild().toText().data();
} else if ( e.tagName() == "cstring" ) {
- v = TQVariant( TQCString( e.firstChild().toText().data() ) );
+ v = TTQVariant( TTQCString( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "number" ) {
bool ok = true;
- v = TQVariant( e.firstChild().toText().data().toInt( &ok ) );
+ v = TTQVariant( e.firstChild().toText().data().toInt( &ok ) );
if ( !ok )
- v = TQVariant( e.firstChild().toText().data().toDouble() );
+ v = TTQVariant( e.firstChild().toText().data().toDouble() );
} else if ( e.tagName() == "bool" ) {
- TQString t = e.firstChild().toText().data();
- v = TQVariant( t == "true" || t == "1", 0 );
+ TTQString t = e.firstChild().toText().data();
+ v = TTQVariant( t == "true" || t == "1", 0 );
} else if ( e.tagName() == "pixmap" ) {
- v = TQVariant( e.firstChild().toText().data() );
+ v = TTQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "iconset" ) {
- v = TQVariant( e.firstChild().toText().data() );
+ v = TTQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "image" ) {
- v = TQVariant( e.firstChild().toText().data() );
+ v = TTQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "enum" ) {
- v = TQVariant( e.firstChild().toText().data() );
+ v = TTQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "set" ) {
- v = TQVariant( e.firstChild().toText().data() );
+ v = TTQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "sizepolicy" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQSizePolicy sp;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TTQSizePolicy::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 = TQVariant( sp );
+ v = TTQVariant( sp );
} else if ( e.tagName() == "cursor" ) {
- v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) );
+ v = TTQVariant( TTQCursor( e.firstChild().toText().data().toInt() ) );
} else if ( e.tagName() == "stringlist" ) {
- TQStringList lst;
- TQDomElement n;
+ TTQStringList lst;
+ TTQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
lst << n.firstChild().toText().data();
- v = TQVariant( lst );
+ v = TTQVariant( lst );
} else if ( e.tagName() == "date" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -239,9 +239,9 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQDate( y, m, d ) );
+ v = TTQVariant( TTQDate( y, m, d ) );
} else if ( e.tagName() == "time" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -253,9 +253,9 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQTime( h, m, s ) );
+ v = TTQVariant( TTQTime( h, m, s ) );
} else if ( e.tagName() == "datetime" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement 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 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) );
+ v = TTQVariant( TTQDateTime( TTQDate( y, mo, d ), TTQTime( h, mi, s ) ) );
}
return v;
}
@@ -282,9 +282,9 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
/*! Returns the color which is returned in the dom element \a e.
*/
-TQColor DomTool::readColor( const TQDomElement &e )
+TTQColor DomTool::readColor( const TTQDomElement &e )
{
- TQDomElement n = e.firstChild().toElement();
+ TTQDomElement n = e.firstChild().toElement();
int r= 0, g = 0, b = 0;
while ( !n.isNull() ) {
if ( n.tagName() == "red" )
@@ -296,7 +296,7 @@ TQColor DomTool::readColor( const TQDomElement &e )
n = n.nextSibling().toElement();
}
- return TQColor( r, g, b );
+ return TTQColor( r, g, b );
}
/*!
@@ -306,9 +306,9 @@ TQColor DomTool::readColor( const TQDomElement &e )
\sa hasAttribute()
*/
-TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment )
+TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment )
{
- TQDomElement n;
+ TTQDomElement 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 @@ TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, c
/*!
\overload
*/
-TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue )
+TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue )
{
- TQString comment;
+ TTQString comment;
return readAttribute( e, name, defValue, comment );
}
@@ -333,9 +333,9 @@ TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, c
\sa readAttribute()
*/
-bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name )
+bool DomTool::hasAttribute( const TTQDomElement& e, const TTQString& name )
{
- TQDomElement n;
+ TTQDomElement 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 TQDomElement& e, const TQString& name )
return false;
}
-static bool toBool( const TQString& s )
+static bool toBool( const TTQString& s )
{
return s == "true" || s.toInt() != 0;
}
@@ -354,11 +354,11 @@ static bool toBool( const TQString& s )
/*!
Convert Qt 2.x format to Qt 3.0 format if necessary
*/
-void DomTool::fixDocument( TQDomDocument& doc )
+void DomTool::fixDocument( TTQDomDocument& doc )
{
- TQDomElement e;
- TQDomNode n;
- TQDomNodeList nl;
+ TTQDomElement e;
+ TTQDomNode n;
+ TTQDomNodeList nl;
int i = 0;
e = doc.firstChild().toElement();
@@ -374,8 +374,8 @@ void DomTool::fixDocument( TQDomDocument& 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++ ) {
- TQDomElement el = nl.item(i).toElement();
- TQString s = el.attribute( "name" );
+ TTQDomElement el = nl.item(i).toElement();
+ TTQString s = el.attribute( "name" );
if ( s == "resizeable" ) {
el.removeAttribute( "name" );
el.setAttribute( "name", "resizable" );
@@ -391,8 +391,8 @@ void DomTool::fixDocument( TQDomDocument& doc )
e.setAttribute("stdsetdef", 1 );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- TQString name;
- TQDomElement n2 = e.firstChild().toElement();
+ TTQString name;
+ TTQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
if ( name == "resizeable" )
@@ -416,8 +416,8 @@ void DomTool::fixDocument( TQDomDocument& doc )
nl = doc.elementsByTagName( "attribute" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- TQString name;
- TQDomElement n2 = e.firstChild().toElement();
+ TTQString name;
+ TTQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
e.setAttribute( "name", name );
@@ -428,8 +428,8 @@ void DomTool::fixDocument( TQDomDocument& doc )
nl = doc.elementsByTagName( "image" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- TQString name;
- TQDomElement n2 = e.firstChild().toElement();
+ TTQString name;
+ TTQDomElement n2 = e.firstChild().toElement();
if ( n2.tagName() == "name" ) {
name = n2.firstChild().toText().data();
e.setAttribute( "name", name );
@@ -440,8 +440,8 @@ void DomTool::fixDocument( TQDomDocument& doc )
nl = doc.elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); i++ ) {
e = nl.item(i).toElement();
- TQString name;
- TQDomElement n2 = e.firstChild().toElement();
+ TTQString name;
+ TTQDomElement 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 e83e106b..cf3bfc65 100644
--- a/qtruby/rubylib/designer/rbuic/domtool.h
+++ b/qtruby/rubylib/designer/rbuic/domtool.h
@@ -30,23 +30,23 @@
#include <tqvariant.h>
#include <tqnamespace.h>
-class QDomElement;
-class QDomDocument;
+class TQDomElement;
+class TQDomDocument;
class DomTool : public Qt
{
public:
- 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& );
+ 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& );
};
diff --git a/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp
index a1cf0a3f..365eaf7d 100644
--- a/qtruby/rubylib/designer/rbuic/embed.cpp
+++ b/qtruby/rubylib/designer/rbuic/embed.cpp
@@ -51,15 +51,15 @@ struct EmbedImage
{
int width, height, depth;
int numColors;
- QRgb* colorTable;
- TQString name;
- TQString cname;
+ TQRgb* colorTable;
+ TTQString name;
+ TTQString cname;
bool alpha;
};
-static TQString convertToCIdentifier( const char *s )
+static TTQString convertToCIdentifier( const char *s )
{
- TQString r = s;
+ TTQString r = s;
int len = r.length();
if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
r[0] = '_';
@@ -71,16 +71,16 @@ static TQString convertToCIdentifier( const char *s )
}
-static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
+static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes )
{
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
- TQByteArray bazip( qCompress( input, nbytes ) );
+ TTQByteArray bazip( qCompress( input, nbytes ) );
ulong len = bazip.size();
#else
ulong len = nbytes;
#endif
static const char hexdigits[] = "0123456789abcdef";
- TQString s;
+ TTQString s;
for ( int i=0; i<(int)len; i++ ) {
if ( (i%14) == 0 ) {
s += "\n ";
@@ -105,10 +105,10 @@ static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
return len;
}
-static void embedData( TQTextStream& out, const QRgb* input, int n )
+static void embedData( TTQTextStream& out, const TQRgb* input, int n )
{
out << hex;
- const QRgb *v = input;
+ const TQRgb *v = input;
for ( int i=0; i<n; i++ ) {
if ( (i%14) == 0 )
out << "\n ";
@@ -120,37 +120,37 @@ static void embedData( TQTextStream& out, const QRgb* input, int n )
out << dec; // back to decimal mode
}
-void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images )
+void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& images )
{
- TQString cProject = convertToCIdentifier( project );
+ TTQString cProject = convertToCIdentifier( project );
- TQStringList::ConstIterator it;
+ TTQStringList::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: " << TQDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TTQDateTime::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;
out << endl;
if (hasKDEwidget) {
- out << "require 'Korundum'" << endl;
+ out << "retquire 'Korundum'" << endl;
} else {
- out << "require 'Qt'" << endl;
+ out << "retquire 'Qt'" << endl;
}
out << endl;
- out << indent << "class MimeSourceFactory_" << cProject << " < Qt::MimeSourceFactory" << endl;
+ out << indent << "class MimeSourceFactory_" << cProject << " < TQt::MimeSourceFactory" << endl;
out << endl;
- TQPtrList<EmbedImage> list_image;
+ TTQPtrList<EmbedImage> list_image;
int image_count = 0;
for ( it = images.begin(); it != images.end(); ++it ) {
- TQImage img;
+ TTQImage img;
if ( !img.load( *it ) ) {
fprintf( stderr, "rbuic: cannot load image file %s\n", (*it).latin1() );
continue;
@@ -160,19 +160,19 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
e->height = img.height();
e->depth = img.depth();
e->numColors = img.numColors();
- e->colorTable = new QRgb[e->numColors];
+ e->colorTable = new TQRgb[e->numColors];
e->alpha = img.hasAlphaBuffer();
- memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb));
- TQFileInfo fi( *it );
+ memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb));
+ TTQFileInfo fi( *it );
e->name = fi.fileName();
- e->cname = TQString("@@image_%1").arg( image_count++);
+ e->cname = TTQString("@@image_%1").arg( image_count++);
list_image.append( e );
out << "# " << *it << endl;
- TQString imgname = (const char *)e->cname;
+ TTQString imgname = (const char *)e->cname;
- TQString s;
+ TTQString s;
if ( e->depth == 1 )
- img = img.convertBitOrder(TQImage::BigEndian);
+ img = img.convertBitOrder(TTQImage::BigEndian);
out << indent << imgname << "_data = [";
embedData( out, img.bits(), img.numBytes() );
out << "]\n\n";
@@ -192,7 +192,7 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
{
out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, "
<< e->width << ", " << e->height << ", " << e->depth << ", "
- << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", "
+ << (e->numColors ? e->cname + "_ctable" : TTQString::fromLatin1( "[]" ) ) << ", "
<< (e->alpha ? "true" : "false") << "]," << endl;
e = list_image.next();
}
@@ -212,28 +212,28 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
out << indent << "if @@embed_images[name].nil?" << endl;
++indent;
- out << indent << "return Qt::Image.new()" << endl;
+ out << indent << "return TQt::Image.new()" << endl;
--indent;
out << indent << "end" << endl;
out << indent << endl;
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
out << indent << "baunzip = qUncompress( @@embed_images[name][0].pack(\"C*\")," << endl;
out << indent << " @@embed_images[name][0].length )" << endl;
- out << indent << "img = Qt::Image.new( baunzip.data," << endl;
+ out << indent << "img = TQt::Image.new( baunzip.data," << endl;
out << indent << " @@embed_images[name][1]," << endl;
out << indent << " @@embed_images[name][2]," << endl;
out << indent << " @@embed_images[name][3]," << endl;
out << indent << " @@embed_images[name][4]," << endl;
out << indent << " @@embed_images[name][4].length," << endl;
- out << indent << " Qt::Image::BigEndian )" << endl;
+ out << indent << " TQt::Image::BigEndian )" << endl;
#else
- out << indent << "img = Qt::Image.new( @@embed_images[name][0].pack(\"C*\")," << endl;
+ out << indent << "img = TQt::Image.new( @@embed_images[name][0].pack(\"C*\")," << endl;
out << indent << " @@embed_images[name][1]," << endl;
out << indent << " @@embed_images[name][2]," << endl;
out << indent << " @@embed_images[name][3]," << endl;
out << indent << " @@embed_images[name][4]," << endl;
out << indent << " @@embed_images[name][4].length," << endl;
- out << indent << " Qt::Image::BigEndian )" << endl;
+ out << indent << " TQt::Image::BigEndian )" << endl;
#endif
out << indent << "if @@embed_images[name][5]" << endl;
++indent;
@@ -250,14 +250,14 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
out << indent << "img = uic_findImage(abs_name)" << endl;
out << indent << "if img.nil?" << endl;
++indent;
- out << indent << "Qt::MimeSourceFactory.removeFactory(self)" << endl;
- out << indent << "s = Qt::MimeSourceFactory.defaultFactory().data(abs_name);" << endl;
- out << indent << "Qt::MimeSourceFactory.addFactory(self)" << endl;
+ out << indent << "TQt::MimeSourceFactory.removeFactory(self)" << endl;
+ out << indent << "s = TQt::MimeSourceFactory.defaultFactory().data(abs_name);" << endl;
+ out << indent << "TQt::MimeSourceFactory.addFactory(self)" << endl;
out << indent << "return s" << endl;
--indent;
out << indent << "end" << endl;
- out << indent << "Qt::MimeSourceFactory.defaultFactory().setImage(abs_name, img)" << endl;
- out << indent << "return Qt::MimeSourceFactory.defaultFactory().data(abs_name)" << endl;
+ out << indent << "TQt::MimeSourceFactory.defaultFactory().setImage(abs_name, img)" << endl;
+ out << indent << "return TQt::MimeSourceFactory.defaultFactory().data(abs_name)" << endl;
--indent;
out << indent << "end" << endl;
--indent;
@@ -273,7 +273,7 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
out << indent << "def StaticInitImages_" << cProject << ".qInitImages" << endl;
++indent;
out << indent << "factory = MimeSourceFactory_" << cProject << ".new()" << endl;
- out << indent << "Qt::MimeSourceFactory.defaultFactory().addFactory(factory)" << endl;
+ out << indent << "TQt::MimeSourceFactory.defaultFactory().addFactory(factory)" << endl;
out << indent << "@@factories['MimeSourceFactory_" << cProject << "'] = factory" << endl;
--indent;
out << indent << "end" << endl;
@@ -282,7 +282,7 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima
++indent;
out << indent << "for values in @@factories" << endl;
++indent;
- out << indent << "Qt::MimeSourceFactory.defaultFactory().removeFactory(values)" << endl;
+ out << indent << "TQt::MimeSourceFactory.defaultFactory().removeFactory(values)" << endl;
--indent;
out << indent << "end" << endl;
out << indent << "@@factories = nil" << endl;
diff --git a/qtruby/rubylib/designer/rbuic/form.cpp b/qtruby/rubylib/designer/rbuic/form.cpp
index d6c842c0..eb9d6ee7 100644
--- a/qtruby/rubylib/designer/rbuic/form.cpp
+++ b/qtruby/rubylib/designer/rbuic/form.cpp
@@ -42,7 +42,7 @@
#include <zlib.h>
-static TQByteArray unzipXPM( TQString data, ulong& length )
+static TTQByteArray unzipXPM( TTQString data, ulong& length )
{
const int lengthOffset = 4;
int baSize = data.length() / 2 + lengthOffset;
@@ -68,13 +68,13 @@ static TQByteArray unzipXPM( TQString data, ulong& length )
ba[1] = ( length & 0x00ff0000 ) >> 16;
ba[2] = ( length & 0x0000ff00 ) >> 8;
ba[3] = ( length & 0x000000ff );
- TQByteArray baunzip = qUncompress( ba, baSize );
+ TTQByteArray baunzip = qUncompress( ba, baSize );
delete[] ba;
return baunzip;
}
-static TQString imageDataName(TQString name) {
- TQString result = name + "_data";
+static TTQString imageDataName(TTQString name) {
+ TTQString result = name + "_data";
result.replace("@", "@@");
return result;
}
@@ -84,33 +84,33 @@ static TQString imageDataName(TQString name) {
\sa createFormDecl(), createObjectImpl()
*/
-void Uic::createFormImpl( const TQDomElement &e )
+void Uic::createFormImpl( const TTQDomElement &e )
{
- TQDomElement n;
- TQDomNodeList nl;
+ TTQDomElement n;
+ TTQDomNodeList nl;
int i;
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if (hasKDEwidget) {
- out << indent << "require 'Korundum'" << endl << endl;
+ out << indent << "retquire 'Korundum'" << endl << endl;
} else {
- out << indent << "require 'Qt'" << endl << endl;
+ out << indent << "retquire 'Qt'" << endl << endl;
}
- // generate local and local includes required
- TQStringList globalIncludes, localIncludes;
- TQStringList::Iterator it;
- TQStringList sqlClasses;
+ // generate local and local includes retquired
+ TTQStringList globalIncludes, localIncludes;
+ TTQStringList::Iterator it;
+ TTQStringList sqlClasses;
- TQMap<TQString, CustomInclude> customWidgetIncludes;
- TQMap<TQString, TQString> functionImpls;
+ TTQMap<TTQString, CustomInclude> customWidgetIncludes;
+ TTQMap<TTQString, TTQString> functionImpls;
// find additional slots
- TQStringList extraSlots;
- TQStringList extraSlotTypes;
+ TTQStringList extraSlots;
+ TTQStringList 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 TQDomElement &e )
continue;
if ( n.attribute( "language", "C++" ) != "C++" )
continue;
- TQString slotName = n.firstChild().toText().data().stripWhiteSpace();
+ TTQString slotName = n.firstChild().toText().data().stripWhiteSpace();
if ( slotName.endsWith( ";" ) )
slotName = slotName.left( slotName.length() - 1 );
@@ -128,7 +128,7 @@ void Uic::createFormImpl( const TQDomElement &e )
}
// find signals
- TQStringList extraSignals;
+ TTQStringList 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 TQDomElement &e )
continue;
if ( n.attribute( "language", "C++" ) != "C++" )
continue;
- TQString sigName = n.firstChild().toText().data().stripWhiteSpace();
+ TTQString sigName = n.firstChild().toText().data().stripWhiteSpace();
if ( sigName.endsWith( ";" ) )
sigName = sigName.left( sigName.length() - 1 );
extraSignals += sigName;
}
//find additional functions
- TQStringList extraFunctions;
+ TTQStringList extraFunctions;
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "functions" ) { // compatibility
- for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ for ( TTQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "function" ) {
- TQString fname;
+ TTQString fname;
if( !n2.attribute("name").isNull() )
{
fname = n2.attribute( "name" );
@@ -165,11 +165,11 @@ void Uic::createFormImpl( const TQDomElement &e )
}
}
} else if ( n.tagName() == "customwidgets" ) {
- TQDomElement n2 = n.firstChild().toElement();
+ TTQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "customwidget" ) {
- TQDomElement n3 = n2.firstChild().toElement();
- TQString cl, header;
+ TTQDomElement n3 = n2.firstChild().toElement();
+ TTQString cl, header;
WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
while ( !n3.isNull() ) {
if ( n3.tagName() == "class" ) {
@@ -253,7 +253,7 @@ void Uic::createFormImpl( const TQDomElement &e )
++indent;
// additional attributes (from Designer)
- TQStringList publicVars, protectedVars, privateVars;
+ TTQStringList 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 TQDomElement &e )
// Someday it should be uncommented.
//if ( n.parentNode().toElement().tagName() != "variables" )
// continue;
- TQString access = n.attribute( "access", "protected" );
- TQString var = n.firstChild().toText().data().stripWhiteSpace();
+ TTQString access = n.attribute( "access", "protected" );
+ TTQString 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 TQDomElement &e )
// additional includes (local or global ) and forward declaractions
nl = e.parentNode().toElement().elementsByTagName( "include" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQDomElement n2 = nl.item(i).toElement();
- TQString s = n2.firstChild().toText().data();
+ TTQDomElement n2 = nl.item(i).toElement();
+ TTQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" ) {
- if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) )
+ if ( s.right( 5 ) == ".ui.h" && !TTQFile::exists( s ) )
continue;
if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
continue;
@@ -301,10 +301,10 @@ void Uic::createFormImpl( const TQDomElement &e )
// do the local includes afterwards, since global includes have priority on clashes
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQDomElement n2 = nl.item(i).toElement();
- TQString s = n2.firstChild().toText().data();
+ TTQDomElement n2 = nl.item(i).toElement();
+ TTQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) {
- if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) )
+ if ( s.right( 5 ) == ".ui.h" && !TTQFile::exists( s ) )
continue;
if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
continue;
@@ -315,8 +315,8 @@ void Uic::createFormImpl( const TQDomElement &e )
// additional custom widget headers
nl = e.parentNode().toElement().elementsByTagName( "header" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQDomElement n2 = nl.item(i).toElement();
- TQString s = n2.firstChild().toText().data();
+ TTQDomElement n2 = nl.item(i).toElement();
+ TTQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" )
globalIncludes += s;
else
@@ -325,17 +325,17 @@ void Uic::createFormImpl( const TQDomElement &e )
// grab slots/funcs defined in ui.h files
- for(TQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it)
+ for(TTQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it)
{
if((*it).right( 5 ) == ".ui.h")
{
- TQFile f((*it));
+ TTQFile f((*it));
if( f.open( IO_ReadOnly ) )
{
- TQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$");
- TQRegExp re2("^end\\s*$");
- TQTextStream t( &f );
- TQString s, s2, s3;
+ TTQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$");
+ TTQRegExp re2("^end\\s*$");
+ TTQTextStream t( &f );
+ TTQString s, s2, s3;
while ( !t.eof() )
{
s = t.readLine();
@@ -366,7 +366,7 @@ void Uic::createFormImpl( const TQDomElement &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
- TQString name = getClassName( nl.item(i).toElement() );
+ TTQString name = getClassName( nl.item(i).toElement() );
if ( name == "Spacer" ) {
globalIncludes += "tqlayout.h";
globalIncludes += "tqapplication.h";
@@ -375,8 +375,8 @@ void Uic::createFormImpl( const TQDomElement &e )
if ( name.mid( 4 ) == "ListView" )
globalIncludes += "tqheader.h";
if ( name != objClass ) {
- int wid = WidgetDatabase::idFromClassName( name.replace( TQRegExp("^Qt::"), "Q" ) );
- TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
+ int wid = WidgetDatabase::idFromClassName( name.replace( TTQRegExp("^TQt::"), "Q" ) );
+ TTQMap<TTQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
if ( it == customWidgetIncludes.end() )
globalIncludes += WidgetDatabase::includeFile( wid );
}
@@ -385,9 +385,9 @@ void Uic::createFormImpl( const TQDomElement &e )
dbConnections = unique( dbConnections );
if ( dbConnections.count() )
- sqlClasses += "Qt::SqlDatabase";
+ sqlClasses += "TQt::SqlDatabase";
if ( dbCursors.count() )
- sqlClasses += "Qt::SqlCursor";
+ sqlClasses += "TQt::SqlCursor";
bool dbForm = false;
if ( dbForms[ "(default)" ].count() )
dbForm = true;
@@ -401,38 +401,38 @@ void Uic::createFormImpl( const TQDomElement &e )
}
}
if ( dbForm || subDbForms ) {
- sqlClasses += "Qt::SqlForm";
- sqlClasses += "Qt::SqlRecord";
+ sqlClasses += "TQt::SqlForm";
+ sqlClasses += "TQt::SqlRecord";
}
if (globalIncludes.findIndex("tqdatatable.h") >= 0)
- sqlClasses += "Qt::DataTable";
+ sqlClasses += "TQt::DataTable";
if (globalIncludes.findIndex("qtableview.h") >= 0)
- sqlClasses += "Qt::TableView";
+ sqlClasses += "TQt::TableView";
if (globalIncludes.findIndex("tqdatabrowser.h") >= 0)
- sqlClasses += "Qt::DataBrowser";
+ sqlClasses += "TQt::DataBrowser";
out << endl;
- // find out what images are required
- TQStringList requiredImages;
+ // find out what images are retquired
+ TTQStringList 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++ ) {
- TQString img = "@";
- requiredImages += (img + nl.item(j).firstChild().toText().data());
+ TTQString img = "@";
+ retquiredImages += (img + nl.item(j).firstChild().toText().data());
}
}
// register the object and unify its name
- TQString loadFunction(objName);
+ TTQString loadFunction(objName);
objName = registerObject( objName );
- TQStringList images;
- TQStringList xpmImages;
+ TTQStringList images;
+ TTQStringList xpmImages;
if ( pixmapLoaderFunction.isEmpty() && !externPixmaps )
{
// create images
@@ -443,19 +443,19 @@ void Uic::createFormImpl( const TQDomElement &e )
nl = n.elementsByTagName( "image" );
for ( i = 0; i < (int) nl.length(); i++ )
{
- TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
- if ( !requiredImages.contains( img ) )
+ TTQString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
+ if ( !retquiredImages.contains( img ) )
continue;
- TQDomElement tmp = nl.item(i).firstChild().toElement();
+ TTQDomElement tmp = nl.item(i).firstChild().toElement();
if ( tmp.tagName() != "data" )
continue;
- TQString format = tmp.attribute("format", "PNG" );
- TQString data = tmp.firstChild().toText().data();
+ TTQString format = tmp.attribute("format", "PNG" );
+ TTQString data = tmp.firstChild().toText().data();
if ( format == "XPM.GZ" )
{
xpmImages += img;
ulong length = tmp.attribute("length").toULong();
- TQByteArray baunzip = unzipXPM( data, length );
+ TTQByteArray 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 TQDomElement &e )
++indent;
int a ;
for ( a = 0; a < (int) (data.length()/2)-1; a++ ) {
- out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ",";
+ out << "0x" << TTQString(data[2*a]) << TTQString(data[2*a+1]) << ",";
if ( a % 12 == 11 )
out << endl << " ";
else
out << " ";
}
- out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << " ].pack \"C*\"" << endl;
+ out << "0x" << TTQString(data[2*a]) << TTQString(data[2*a+1]) << " ].pack \"C*\"" << endl;
--indent;
out << endl;
}
@@ -504,12 +504,12 @@ void Uic::createFormImpl( const TQDomElement &e )
/*
out << indent << "def uic_load_pixmap_" << loadFunction << "( data )" << endl;
++indent;
- out << indent << "pix = Qt::Pixmap.new()" << endl;
- out << indent << "m = Qt::MimeSourceFactory.defaultFactory().data(data)" << endl;
+ out << indent << "pix = TQt::Pixmap.new()" << endl;
+ out << indent << "m = TQt::MimeSourceFactory.defaultFactory().data(data)" << endl;
out << endl;
out << indent << "if ! m.nil?" << endl;
++indent;
- out << indent << "Qt::ImageDrag.decode(m, pix)" << endl;
+ out << indent << "TQt::ImageDrag.decode(m, pix)" << endl;
--indent;
out << indent << "end" << endl;
out << endl;
@@ -520,20 +520,20 @@ void Uic::createFormImpl( const TQDomElement &e )
out << endl;
pixmapLoaderFunction = "uic_load_pixmap_" + loadFunction;
*/
- pixmapLoaderFunction = "Qt::Pixmap.fromMimeSource";
+ pixmapLoaderFunction = "TQt::Pixmap.fromMimeSource";
}
// constructor(s)
- if ( objClass == "Qt::Dialog" || objClass == "Qt::Wizard" ) {
+ if ( objClass == "TQt::Dialog" || objClass == "TQt::Wizard" ) {
out << indent << "def initialize(parent = nil, name = nil, modal = false, fl = 0)" << endl;
++indent;
out << indent << "super" << endl;
- } else if ( objClass == "Qt::Widget") {
+ } else if ( objClass == "TQt::Widget") {
out << indent << "def initialize(parent = nil, name = nil, fl = 0)" << endl;
++indent;
out << indent << "super" << endl;
- } else if ( objClass == "Qt::MainWindow" ) {
+ } else if ( objClass == "TQt::MainWindow" ) {
out << indent << "def initialize(parent = nil, name = nil, fl = WType_TopLevel)" << endl;
++indent;
out << indent << "super" << endl;
@@ -548,9 +548,9 @@ void Uic::createFormImpl( const TQDomElement &e )
// create pixmaps for all images
if ( !images.isEmpty() ) {
- TQStringList::Iterator it;
+ TTQStringList::Iterator it;
for ( it = images.begin(); it != images.end(); ++it ) {
- out << indent << (*it) << " = Qt::Pixmap.new()" << endl;
+ out << indent << (*it) << " = TQt::Pixmap.new()" << endl;
out << indent << (*it) << ".loadFromData(" << imageDataName(*it) << ", " << imageDataName(*it) << ".length, \"PNG\")" << endl;
}
out << endl;
@@ -558,7 +558,7 @@ void Uic::createFormImpl( const TQDomElement &e )
// create pixmaps for all images
if ( !xpmImages.isEmpty() ) {
for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) {
- out << indent << (*it) << " = Qt::Pixmap.new(" << imageDataName(*it) << ")" << endl;
+ out << indent << (*it) << " = TQt::Pixmap.new(" << imageDataName(*it) << ")" << endl;
}
out << endl;
}
@@ -567,21 +567,21 @@ void Uic::createFormImpl( const TQDomElement &e )
out << indent << "statusBar()" << endl;
// set the properties
- TQSize geometry( 0, 0 );
+ TTQSize 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" ) );
- TQString prop = n.attribute("name");
- TQDomElement n2 = n.firstChild().toElement();
- TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset );
+ TTQString prop = n.attribute("name");
+ TTQDomElement n2 = n.firstChild().toElement();
+ TTQString value = setObjectProperty( objClass, TTQString::null, prop, n2, stdset );
if ( value.isEmpty() )
continue;
if ( prop == "geometry" && n2.tagName() == "rect") {
- TQDomElement n3 = n2.firstChild().toElement();
+ TTQDomElement n3 = n2.firstChild().toElement();
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
geometry.setWidth( n3.firstChild().toText().data().toInt() );
@@ -590,11 +590,11 @@ void Uic::createFormImpl( const TQDomElement &e )
n3 = n3.nextSibling().toElement();
}
} else {
- TQString call;
+ TTQString call;
if ( stdset ) {
call = mkStdSet( prop ) + "(" + value + ")";
} else {
- call = "setProperty(\"" + prop + "\", Qt::Variant.new(" + value + "))";
+ call = "setProperty(\"" + prop + "\", TQt::Variant.new(" + value + "))";
}
if ( n2.tagName() == "string" ) {
@@ -612,20 +612,20 @@ void Uic::createFormImpl( const TQDomElement &e )
out << endl;
- // create all children, some forms have special requirements
+ // create all children, some forms have special retquirements
- if ( objClass == "Qt::Wizard" )
+ if ( objClass == "TQt::Wizard" )
{
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
{
if ( tags.contains( n.tagName() ) )
{
- TQString page = createObjectImpl( n, objClass, "self" );
- TQString comment;
- TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TTQString page = createObjectImpl( n, objClass, "self" );
+ TTQString comment;
+ TTQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << "addPage(" << page << ", "<< trcall( label ) << ")" << endl;
trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " )" << endl;
- TQVariant def( false, 0 );
+ TTQVariant 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" ) )
@@ -654,20 +654,20 @@ void Uic::createFormImpl( const TQDomElement &e )
out << endl;
for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
if ( !(*it).isEmpty() && (*it) != "(default)") {
- out << indent << (*it) << "Connection = Qt::SqlDatabase.database(\"" <<(*it) << "\");" << endl;
+ out << indent << (*it) << "Connection = TQt::SqlDatabase.database(\"" <<(*it) << "\");" << endl;
}
}
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();
- TQString s = getClassName( n );
- if ( s == "Qt::DataBrowser" || s == "Qt::DataView" ) {
- TQString objName = getObjectName( n );
- TQString tab = getDatabaseInfo( n, "table" );
- TQString con = getDatabaseInfo( n, "connection" );
- out << indent << objName << "Form = Qt::SqlForm.new(self, \"" << objName << "Form\")" << endl;
- TQDomElement n2;
+ TTQString s = getClassName( n );
+ if ( s == "TQt::DataBrowser" || s == "TQt::DataView" ) {
+ TTQString objName = getObjectName( n );
+ TTQString tab = getDatabaseInfo( n, "table" );
+ TTQString con = getDatabaseInfo( n, "connection" );
+ out << indent << objName << "Form = TQt::SqlForm.new(self, \"" << objName << "Form\")" << endl;
+ TTQDomElement n2;
for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() )
createFormImpl( n2, objName, con, tab );
out << indent << objName << ".setForm(" << objName << "Form)" << endl;
@@ -713,7 +713,7 @@ void Uic::createFormImpl( const TQDomElement &e )
// take minimumSizeHint() into account, for height-for-width widgets
if ( !geometry.isNull() ) {
- out << indent << "resize( Qt::Size.new(" << geometry.width() << ", "
+ out << indent << "resize( TQt::Size.new(" << geometry.width() << ", "
<< geometry.height() << ").expandedTo(minimumSizeHint()) )" << endl;
out << indent << "clearWState( WState_Polished )" << endl;
}
@@ -724,8 +724,8 @@ void Uic::createFormImpl( const TQDomElement &e )
out << endl;
nl = n.elementsByTagName( "connection" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQString sender, receiver, signal, slot;
- for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ TTQString sender, receiver, signal, slot;
+ for ( TTQDomElement 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" )
@@ -750,17 +750,17 @@ void Uic::createFormImpl( const TQDomElement &e )
if ( receiver == objName )
receiver = "self";
- out << indent << "Qt::Object.connect(" << sender
+ out << indent << "TQt::Object.connect(" << sender
<< ", TQT_SIGNAL(\"" << signal << "\"), "<< receiver << ", TQT_SLOT(\"" << slot << "\") )" << endl;
}
} else if ( n.tagName() == "tabstops" ) {
// setup tab order
out << endl;
- TQString lastName;
- TQDomElement n2 = n.firstChild().toElement();
+ TTQString lastName;
+ TTQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "tabstop" ) {
- TQString name = n2.firstChild().toText().data();
+ TTQString 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 TQDomElement &e )
// QtRuby - FIXME: what the heck is this ?
// buddies
bool firstBuddy = true;
- for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
+ for ( TTQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
if ( isObjectRegistered( (*buddy).buddy ) ) {
if ( firstBuddy ) {
out << endl;
@@ -795,7 +795,7 @@ void Uic::createFormImpl( const TQDomElement &e )
- // handle application events if required
+ // handle application events if retquired
bool needFontEventHandler = false;
bool needSqlTableEventHandler = false;
bool needSqlDataBrowserEventHandler = false;
@@ -803,13 +803,13 @@ void Uic::createFormImpl( const TQDomElement &e )
for ( i = 0; i < (int) nl.length(); i++ ) {
if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() )
needFontEventHandler = true;
- TQString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataTable" || s == "Qt::DataBrowser" ) {
+ TTQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataTable" || s == "TQt::DataBrowser" ) {
if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) )
continue;
- if ( s == "Qt::DataTable" )
+ if ( s == "TQt::DataTable" )
needSqlTableEventHandler = true;
- if ( s == "Qt::DataBrowser" )
+ if ( s == "TQt::DataBrowser" )
needSqlDataBrowserEventHandler = true;
}
if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler )
@@ -829,10 +829,10 @@ void Uic::createFormImpl( const TQDomElement &e )
out << " ret = super( ev ) " << endl;
if ( needFontEventHandler ) {
++indent;
- out << " if ev.type() == Qt::Event::ApplicationFontChange " << endl;
+ out << " if ev.type() == TQt::Event::ApplicationFontChange " << endl;
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
- TQStringList list = DomTool::propertiesOfType( n, "font" );
+ TTQStringList list = DomTool::propertiesOfType( n, "font" );
for ( it = list.begin(); it != list.end(); ++it )
createExclusiveProperty( n, *it );
}
@@ -854,12 +854,12 @@ void Uic::createFormImpl( const TQDomElement &e )
++indent;
if ( needSqlTableEventHandler ) {
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataTable" ) {
+ TTQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataTable" ) {
n = nl.item(i).toElement();
- TQString c = TQString("@") + getObjectName( n );
- TQString conn = getDatabaseInfo( n, "connection" );
- TQString tab = getDatabaseInfo( n, "table" );
+ TTQString c = TTQString("@") + getObjectName( n );
+ TTQString conn = getDatabaseInfo( n, "connection" );
+ TTQString tab = getDatabaseInfo( n, "table" );
if ( !( conn.isEmpty() || tab.isEmpty() ) ) {
out << indent << "if " << "!" << c << ".nil?" << endl;
++indent;
@@ -868,12 +868,12 @@ void Uic::createFormImpl( const TQDomElement &e )
out << indent << "if !cursor.nil?" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "cursor = Qt::SqlCursor.new(\"" << tab << "\")" << endl;
+ out << indent << "cursor = TQt::SqlCursor.new(\"" << tab << "\")" << endl;
else
- out << indent << "cursor = Qt::SqlCursor.new(\"" << tab << "\", true, " << conn << "Connection)" << endl;
+ out << indent << "cursor = TQt::SqlCursor.new(\"" << tab << "\", true, " << conn << "Connection)" << endl;
out << indent << "if " << c << ".readOnly? " << endl;
++indent;
- out << indent << "cursor.mode = Qt::SqlCursor::ReadOnly" << endl;
+ out << indent << "cursor.mode = TQt::SqlCursor::ReadOnly" << endl;
--indent;
out << indent << "end " << endl;
out << indent << c << ".setSqlCursor(cursor, false, true)" << endl;
@@ -882,7 +882,7 @@ void Uic::createFormImpl( const TQDomElement &e )
out << indent << "end" << endl;
out << indent << "if !cursor.active?" << endl;
++indent;
- out << indent << c << ".refresh(Qt::DataTable::RefreshAll)" << endl;
+ out << indent << c << ".refresh(TQt::DataTable::RefreshAll)" << endl;
--indent;
out << indent << "end" << endl;
--indent;
@@ -894,12 +894,12 @@ void Uic::createFormImpl( const TQDomElement &e )
if ( needSqlDataBrowserEventHandler ) {
nl = e.elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQString s = getClassName( nl.item(i).toElement() );
- if ( s == "Qt::DataBrowser" ) {
- TQString obj = getObjectName( nl.item(i).toElement() );
- TQString tab = getDatabaseInfo( nl.item(i).toElement(),
+ TTQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQt::DataBrowser" ) {
+ TTQString obj = getObjectName( nl.item(i).toElement() );
+ TTQString tab = getDatabaseInfo( nl.item(i).toElement(),
"table" );
- TQString conn = getDatabaseInfo( nl.item(i).toElement(),
+ TTQString conn = getDatabaseInfo( nl.item(i).toElement(),
"connection" );
if ( !(tab).isEmpty() ) {
out << indent << "if " << obj << endl;
@@ -907,9 +907,9 @@ void Uic::createFormImpl( const TQDomElement &e )
out << indent << "if !" << obj << ".sqlCursor()" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "cursor = Qt::SqlCursor.new(\"" << tab << "\")" << endl;
+ out << indent << "cursor = TQt::SqlCursor.new(\"" << tab << "\")" << endl;
else
- out << indent << "cursor = Qt::SqlCursor.new(\"" << tab << "\", true, " << conn << "Connection)" << endl;
+ out << indent << "cursor = TQt::SqlCursor.new(\"" << tab << "\", true, " << conn << "Connection)" << endl;
out << indent << obj << ".setSqlCursor(cursor, true)" << endl;
out << indent << obj << ".refresh()" << endl;
out << indent << obj << ".first()" << endl;
@@ -942,11 +942,11 @@ void Uic::createFormImpl( const TQDomElement &e )
int astart = (*it).find('(');
out << indent << "def " << (*it).left(astart) << "(*k)" << endl;
bool createWarning = true;
- TQString fname = Parser::cleanArgs( *it );
- TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname );
+ TTQString fname = Parser::cleanArgs( *it );
+ TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( fname );
if ( fit != functionImpls.end() ) {
int begin = (*fit).find( "{" );
- TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
+ TTQString 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 TQDomElement &e )
out << endl;
int astart = (*it).find('(');
out << indent << "def " << (*it).left(astart) << "(*k)" << endl;
- TQString fname = Parser::cleanArgs( *it );
- TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname );
+ TTQString fname = Parser::cleanArgs( *it );
+ TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( fname );
if ( fit != functionImpls.end() ) {
int begin = (*fit).find( "{" );
- TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
+ TTQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
body.simplifyWhiteSpace().isEmpty();
out << body << endl;
}
@@ -992,17 +992,17 @@ void Uic::createFormImpl( const TQDomElement &e )
Traverses recursively over all children.
*/
-void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table )
+void Uic::createFormImpl( const TTQDomElement& e, const TTQString& form, const TTQString& connection, const TTQString& table )
{
if ( e.tagName() == "widget" &&
- e.attribute( "class" ) != "Qt::DataTable" ) {
- TQString field = getDatabaseInfo( e, "field" );
+ e.attribute( "class" ) != "TQt::DataTable" ) {
+ TTQString field = getDatabaseInfo( e, "field" );
if ( !field.isEmpty() ) {
if ( isWidgetInTable( e, connection, table ) )
out << indent << form << "Form.insert(" << getObjectName( e ) << ", " << fixString( field ) << ")" << endl;
}
}
- TQDomElement n;
+ TTQDomElement 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 TQDomElement& e, const TQString& form, const TQS
// Generate a QtRuby signal/slot definition.
-void Uic::rubySlot(TQStringList::Iterator &it)
+void Uic::rubySlot(TTQStringList::Iterator &it)
{
out << indent << "'" << (*it) << "'";
}
diff --git a/qtruby/rubylib/designer/rbuic/globaldefs.h b/qtruby/rubylib/designer/rbuic/globaldefs.h
index aebf63c3..4286ec03 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 TQColor *backColor1 = 0;
-static TQColor *backColor2 = 0;
-static TQColor *selectedBack = 0;
+static TTQColor *backColor1 = 0;
+static TTQColor *backColor2 = 0;
+static TTQColor *selectedBack = 0;
static void init_colors()
{
if ( backColor1 )
return;
- backColor1 = new TQColor( 236, 245, 255 );
- backColor2 = new TQColor( 250, 250, 250 );
- selectedBack = new TQColor( 221, 221, 221 );
+ backColor1 = new TTQColor( 236, 245, 255 );
+ backColor2 = new TTQColor( 250, 250, 250 );
+ selectedBack = new TTQColor( 221, 221, 221 );
}
#endif
diff --git a/qtruby/rubylib/designer/rbuic/main.cpp b/qtruby/rubylib/designer/rbuic/main.cpp
index 4bebf46c..7e2a4f83 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, TQString& s);
+void getDBConnections( Uic& uic, TTQString& 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;
- TQStringList images;
+ TTQStringList 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;
- TQApplication app(argc, argv, false);
- TQString uicClass;
+ TTQApplication app(argc, argv, false);
+ TTQString uicClass;
for ( int n = 1; n < argc && error == 0; n++ ) {
- TQCString arg = argv[n];
+ TTQCString arg = argv[n];
if ( arg[0] == '-' ) { // option
- TQCString opt = &arg[1];
+ TTQCString 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 = TQCString(argv[++n]).toUInt(&ok);
+ tabstop = TTQCString(argv[++n]).toUInt(&ok);
} else
tabstop = opt.mid(1).toUInt(&ok);
@@ -174,7 +174,7 @@ int main( int argc, char * argv[] )
"\t-o file\t\tWrite output to file rather than stdout\n"
"\t-p indent\tSet the indent in spaces (0 to use a tab)\n"
"\t-nofwd\t\tOmit imports of custom widgets\n"
- "\t-kde\t\tUse kde widgets, require 'Korundum' extension\n"
+ "\t-kde\t\tUse kde widgets, retquire 'Korundum' extension\n"
"\t-tr func\tUse func(...) rather than trUtf8(...) for i18n\n"
"\t-x\t\tGenerate extra code to test the class\n"
"\t-version\tDisplay version of rbuic\n"
@@ -185,7 +185,7 @@ int main( int argc, char * argv[] )
Uic::setIndent(indent);
- TQFile fileOut;
+ TTQFile 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 );
}
- TQTextStream out( &fileOut );
+ TTQTextStream out( &fileOut );
if ( imagecollection ) {
- out.setEncoding( TQTextStream::Latin1 );
+ out.setEncoding( TTQTextStream::Latin1 );
Uic::embed( out, projectName, images );
return 0;
}
- out.setEncoding( TQTextStream::UnicodeUTF8 );
- TQFile file( fileName );
+ out.setEncoding( TTQTextStream::UnicodeUTF8 );
+ TTQFile file( fileName );
if ( !file.open( IO_ReadOnly ) )
qFatal( "rbuic: Could not open file '%s' ", fileName );
- TQDomDocument doc;
- TQString errMsg;
+ TTQDomDocument doc;
+ TTQString errMsg;
int errLine;
if ( !doc.setContent( &file, &errMsg, &errLine ) )
- qFatal( TQString("rbuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine );
+ qFatal( TTQString("rbuic: Failed to parse %s: ") + errMsg + TTQString (" 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: " << TQDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TTQDateTime::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;
@@ -242,12 +242,12 @@ int main( int argc, char * argv[] )
out << indent << "KDE::CmdLineArgs.init(ARGV, about)" << endl;
out << indent << "a = KDE::Application.new" << endl;
} else {
- out << indent << "a = Qt::Application.new(ARGV)" << endl;
+ out << indent << "a = TQt::Application.new(ARGV)" << endl;
}
- TQString s;
+ TTQString s;
getDBConnections( uic, s);
out << s;
- out << indent << "w = " << (subcl? TQString::fromLatin1(className) : uicClass) << ".new" << endl;
+ out << indent << "w = " << (subcl? TTQString::fromLatin1(className) : uicClass) << ".new" << endl;
out << indent << "a.mainWidget = w" << endl;
out << indent << "w.show" << endl;
out << indent << "a.exec" << endl;
@@ -258,20 +258,20 @@ int main( int argc, char * argv[] )
return 0;
}
-void getDBConnections( Uic& uic, TQString& s)
+void getDBConnections( Uic& uic, TTQString& s)
{
int num = 0;
- for ( TQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
+ for ( TTQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) {
if ( !(*it).isEmpty()) {
- TQString inc = (num ? TQString::number(num+1) : TQString::null);
+ TTQString inc = (num ? TTQString::number(num+1) : TTQString::null);
s += "\n # Connection to database " + (*it) + "\n\n";
- s += " DRIVER" + inc + " =\t\t'QMYSQL3'" + (inc?"":" # appropriate driver") + "\n";
+ s += " DRIVER" + inc + " =\t\t'TQMYSQL3'" + (inc?"":" # appropriate driver") + "\n";
s += " DATABASE" + inc + " =\t\t'foo'" + (inc?"":" # name of your database") + "\n";
s += " USER" + inc + "=\t\t'john'" + (inc?"":" # username") + "\n";
s += " PASSWORD" + inc + "=\t\t'ZxjGG34s'" + (inc?"":" # password for USER") + "\n";
s += " HOST" + inc + "=\t\t'localhost'" + (inc?"":" # host on which the database is running") + "\n";
s += "\n";
- s += " $db" + inc + " = Qt::SqlDatabase.addDatabase( DRIVER" + inc;
+ s += " $db" + inc + " = TQt::SqlDatabase.addDatabase( DRIVER" + inc;
if (inc)
s+= ", '" + (*it) + "'";
s += " )\n";
@@ -281,7 +281,7 @@ void getDBConnections( Uic& uic, TQString& s)
s += " $db" + inc + ".hostName = HOST" + inc + "\n";
s += "\n";
s += " if !$db" + inc + ".open\n";
- s += " Qt::MessageBox.information( nil, 'Unable to open database',\n";
+ s += " TQt::MessageBox.information( nil, 'Unable to open database',\n";
s += " $db" + inc + ".lastError().databaseText() + \"\\n\")\n";
s += " exit 1\n";
s += " end\n";
diff --git a/qtruby/rubylib/designer/rbuic/object.cpp b/qtruby/rubylib/designer/rbuic/object.cpp
index 2d05e0b6..bb1422b1 100644
--- a/qtruby/rubylib/designer/rbuic/object.cpp
+++ b/qtruby/rubylib/designer/rbuic/object.cpp
@@ -41,19 +41,19 @@
\sa createObjectImpl()
*/
-void Uic::createObjectDecl( const TQDomElement& e )
+void Uic::createObjectDecl( const TTQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
@@ -68,27 +68,27 @@ void Uic::createObjectDecl( const TQDomElement& e )
Children are not traversed recursively.
*/
-void Uic::createAttrDecl( const TQDomElement& e )
+void Uic::createAttrDecl( const TTQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
// out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
objName = registerObject( objName );
- TQString attr(objName);
- attr.replace(TQChar('@'), "attr_reader :");
+ TTQString attr(objName);
+ attr.replace(TTQChar('@'), "attr_reader :");
out << indent << attr << endl;
- TQDomElement n = getObjectProperty( e, "font");
+ TTQDomElement n = getObjectProperty( e, "font");
// if ( !n.isNull() )
// out << indent << objName + "_font" << endl;
}
@@ -107,17 +107,17 @@ void Uic::createAttrDecl( const TQDomElement& e )
static bool createdCentralWidget = false;
-TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout )
+TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& par, const TTQString& layout )
{
- TQString parent( par );
+ TTQString parent( par );
if ( parent == "self" && isMainWindow ) {
if ( !createdCentralWidget )
- out << indent << "setCentralWidget(Qt::Widget.new(self, \"qt_central_widget\"))" << endl;
+ out << indent << "setCentralWidget(TQt::Widget.new(self, \"qt_central_widget\"))" << endl;
createdCentralWidget = true;
parent = "centralWidget()";
}
- TQDomElement n;
- TQString objClass, objName, fullObjName;
+ TTQDomElement n;
+ TTQString objClass, objName, fullObjName;
int numItems = 0;
int numColumns = 0;
int numRows = 0;
@@ -130,8 +130,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
return objName;
objName = getObjectName( e );
- TQString definedName = objName;
- bool isTmpObject = objName.isEmpty() || objClass == "Qt::LayoutWidget";
+ TTQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
objName = objClass.mid( 4 );
@@ -141,17 +141,17 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
bool isLine = objClass == "Line";
if ( isLine )
- objClass = "Qt::Frame";
+ objClass = "TQt::Frame";
out << endl;
- if ( objClass == "Qt::LayoutWidget" ) {
+ if ( objClass == "TQt::LayoutWidget" ) {
if ( layout.isEmpty() ) {
// register the object and unify its name
objName = registerObject( objName );
- out << indent << (isTmpObject ? TQString::fromLatin1("") : TQString::null) << objName << " = Qt::Widget.new(" << parent << ", '" << objName << "')" << endl;
+ out << indent << (isTmpObject ? TTQString::fromLatin1("") : TTQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl;
} else {
// the layout widget is not necessary, hide it by creating its child in the parent
- TQString result;
+ TTQString result;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if (tags.contains( n.tagName() ) )
result = createObjectImpl( n, parentClass, parent, layout );
@@ -162,7 +162,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
// Layouts don't go into the class instance dictionary.
// FIXME PerlQt: fullObjName isn't used anymore => remove
fullObjName = objName;
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) {
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) {
// register the object and unify its name
objName = registerObject( objName );
@@ -174,8 +174,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
else
fullObjName = objName;
- if ( objClass == "Qt::AxWidget" ) {
- TQString controlId;
+ if ( objClass == "TQt::AxWidget" ) {
+ TTQString 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 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- TQString prop = n.attribute("name");
+ TTQString prop = n.attribute("name");
if ( prop == "database" )
continue;
- TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
if ( prop == "name" )
@@ -210,26 +210,26 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
if ( isLine && prop == "orientation" ) {
prop = "frameShape";
if ( value.right(10) == "Horizontal" )
- value = "Qt::Frame::HLine";
+ value = "TQt::Frame::HLine";
else
- value = "Qt::Frame::VLine";
+ value = "TQt::Frame::VLine";
if ( !hadFrameShadow ) {
prop = "frameStyle";
- value += " | Qt::Frame::Sunken";
+ value += " | TQt::Frame::Sunken";
}
}
if ( prop == "buttonGroupId" ) {
- if ( parentClass == "Qt::ButtonGroup" )
+ if ( parentClass == "TQt::ButtonGroup" )
out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl;
continue;
}
if ( prop == "frameworkCode" )
continue;
- if ( objClass == "Qt::MultiLineEdit" &&
- TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ if ( objClass == "TQt::MultiLineEdit" &&
+ TTQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
continue;
- TQString call = fullObjName + ".";
+ TTQString call = fullObjName + ".";
if (! call.startsWith("@")) {
call.prepend("@");
}
@@ -238,7 +238,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
call += mkStdSet( prop ) + "( ";
call += value + " )";
} else {
- call += "setProperty( \"" + prop + "\", Qt::Variant.new(" ;
+ call += "setProperty( \"" + prop + "\", TQt::Variant.new(" ;
call += value + " ) )";
}
@@ -249,8 +249,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
out << indent << call << endl;
}
} else if ( n.tagName() == "item" ) {
- TQString call;
- TQString value;
+ TTQString call;
+ TTQString value;
if ( objClass.mid( 4 ) == "ListBox" ) {
call = createListBoxItemImpl( n, fullObjName, &value );
@@ -274,7 +274,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
trout << indent << call << endl;
}
} else if ( objClass.mid( 4 ) == "ListView" ) {
- call = createListViewItemImpl( n, fullObjName, TQString::null );
+ call = createListViewItemImpl( n, fullObjName, TTQString::null );
if ( !call.isEmpty() ) {
if ( numItems == 0 )
trout << indent << fullObjName << ".clear()" << endl;
@@ -284,8 +284,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
if ( !call.isEmpty() )
numItems++;
} else if ( n.tagName() == "column" || n.tagName() == "row" ) {
- TQString call;
- TQString value;
+ TTQString call;
+ TTQString value;
if ( objClass.mid( 4 ) == "ListView" ) {
call = createListViewColumnImpl( n, fullObjName, &value );
@@ -294,7 +294,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
trout << indent << fullObjName << ".header().setLabel( "
<< numColumns++ << ", " << value << " )\n";
}
- } else if ( objClass == "Qt::Table" || objClass == "Qt::DataTable" ) {
+ } else if ( objClass == "TQt::Table" || objClass == "TQt::DataTable" ) {
bool isCols = ( n.tagName() == "column" );
call = createTableRowColumnImpl( n, fullObjName, &value );
if ( !call.isEmpty() ) {
@@ -309,40 +309,40 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
}
}
- // create all children, some widgets have special requirements
+ // create all children, some widgets have special retquirements
- if ( objClass == "Qt::TabWidget" ) {
+ if ( objClass == "TQt::TabWidget" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- TQString page = createObjectImpl( n, objClass, fullObjName );
- TQString comment;
- TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TTQString page = createObjectImpl( n, objClass, fullObjName );
+ TTQString comment;
+ TTQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << fullObjName << ".insertTab(" << page << ", " << trcall( label ) << ")" << endl;
trout << indent << fullObjName << ".changeTab( " << page << ", "
<< trcall( label, comment ) << " )" << endl;
}
}
- } else if ( objClass == "Qt::WidgetStack" ) {
+ } else if ( objClass == "TQt::WidgetStack" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- TQString page = createObjectImpl( n, objClass, objName );
+ TTQString page = createObjectImpl( n, objClass, objName );
int id = DomTool::readAttribute( n, "id", "" ).toInt();
out << indent << fullObjName << ".addWidget( " << page << ", " << id << " )" << endl;
}
}
- } else if ( objClass == "Qt::ToolBox" ) {
+ } else if ( objClass == "TQt::ToolBox" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- TQString page = createObjectImpl( n, objClass, objName );
- TQString comment;
- TQString label = DomTool::readAttribute( n, "label", comment ).toString();
+ TTQString page = createObjectImpl( n, objClass, objName );
+ TTQString comment;
+ TTQString label = DomTool::readAttribute( n, "label", comment ).toString();
out << indent << fullObjName << ".addItem( " << page << ", \"\" )" << endl;
trout << indent << fullObjName << ".setItemLabel( " << fullObjName
<< ".indexOf(" << page << "), " << trcall( label, comment )
<< " )" << endl;
}
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) { // standard widgets
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) { // standard widgets
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) )
createObjectImpl( n, objClass, fullObjName );
@@ -364,13 +364,13 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
application font or palette change handlers in createFormImpl().
*/
-void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp )
+void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp )
{
- TQDomElement n;
- TQString objClass = getClassName( e );
+ TTQDomElement n;
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if ( objClass.isEmpty() )
return;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
@@ -378,13 +378,13 @@ void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclu
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- TQString prop = n.attribute("name");
+ TTQString prop = n.attribute("name");
if ( prop != exclusiveProp )
continue;
- TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
- out << indent << indent << objName << ".setProperty(\"" << prop << "\", Qt::Variant.new(" << value << "))" << endl;
+ out << indent << indent << objName << ".setProperty(\"" << prop << "\", TQt::Variant.new(" << value << "))" << endl;
}
}
}
@@ -394,11 +394,11 @@ void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclu
Resource::saveProperty() and DomTool::elementToVariant. If you
change one, change all.
*/
-TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset )
+TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset )
{
- TQString v;
+ TTQString v;
if ( e.tagName() == "rect" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -411,11 +411,11 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Rect.new(%1, %2, %3, %4)";
+ v = "TQt::Rect.new(%1, %2, %3, %4)";
v = v.arg(x).arg(y).arg(w).arg(h);
} else if ( e.tagName() == "point" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -424,10 +424,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Point.new(%1, %2)";
+ v = "TQt::Point.new(%1, %2)";
v = v.arg(x).arg(y);
} else if ( e.tagName() == "size" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -436,10 +436,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Size.new(%1, %2)";
+ v = "TQt::Size.new(%1, %2)";
v = v.arg(w).arg(h);
} else if ( e.tagName() == "color" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int r= 0, g = 0, b = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "red" )
@@ -450,17 +450,17 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
b = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Color.new(%1, %2, %3)";
+ v = "TQt::Color.new(%1, %2, %3)";
v = v.arg(r).arg(g).arg(b);
} else if ( e.tagName() == "font" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQString fontname;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQString fontname;
if ( !obj.isEmpty() ) {
fontname = obj + "_font";
- out << indent << fontname << " = Qt::Font.new(" << obj << ".font())" << endl;
+ out << indent << fontname << " = TQt::Font.new(" << obj << ".font())" << endl;
} else {
fontname = registerObject( "f" );
- out << indent << fontname << " = Qt::Font.new(font())" << endl;
+ out << indent << fontname << " = TQt::Font.new(font())" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -487,23 +487,23 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = fontname;
}
} else if ( e.tagName() == "string" ) {
- TQString txt = e.firstChild().toText().data();
- TQString com = getComment( e.parentNode() );
+ TTQString txt = e.firstChild().toText().data();
+ TTQString com = getComment( e.parentNode() );
- if ( prop == "toolTip" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ if ( prop == "toolTip" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::ToolTip.add( " << obj << ", "
+ trout << indent << "TQt::ToolTip.add( " << obj << ", "
<< trcall( txt, com ) << " )" << endl;
else
- trout << indent << "Qt::ToolTip.add( self, "
+ trout << indent << "TQt::ToolTip.add( self, "
<< trcall( txt, com ) << " )" << endl;
- } else if ( prop == "whatsThis" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ } else if ( prop == "whatsThis" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::WhatsThis.add(" << obj << ", " << trcall( txt, com ) << ")" << endl;
+ trout << indent << "TQt::WhatsThis.add(" << obj << ", " << trcall( txt, com ) << ")" << endl;
else
- trout << indent << "Qt::WhatsThis.add(self," << trcall( txt, com ) << ")" << endl;
+ trout << indent << "TQt::WhatsThis.add(self," << trcall( txt, com ) << ")" << endl;
} else if (e.parentNode().toElement().attribute("name") == "accel") {
- v = "Qt::KeySequence.new(" + trcall( txt, com ) + ")";
+ v = "TQt::KeySequence.new(" + trcall( txt, com ) + ")";
} else {
v = trcall( txt, com );
}
@@ -511,9 +511,9 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = "\"%1\"";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "number" ) {
- // FIXME: hack. QtRuby needs a TQKeySequence to build an accel
+ // FIXME: hack. QtRuby needs a TTQKeySequence to build an accel
if( e.parentNode().toElement().attribute("name") == "accel" )
- v = "Qt::KeySequence.new(%1)";
+ v = "TQt::KeySequence.new(%1)";
else
v = "%1";
v = v.arg( e.firstChild().toText().data() );
@@ -521,22 +521,22 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
if ( stdset )
v = "%1";
else
- v = "Qt::Variant.new(%1, 0)";
+ v = "TQt::Variant.new(%1, 0)";
v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data();
if( !externPixmaps )
v.prepend( '@' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- v.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ v.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ v.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( e.tagName() == "iconset" ) {
- v = "Qt::IconSet.new(%1)";
- TQString s = e.firstChild().toText().data();
+ v = "TQt::IconSet.new(%1)";
+ TTQString s = e.firstChild().toText().data();
if ( !pixmapLoaderFunction.isEmpty() ) {
- s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- s.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ s.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ s.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
} else {
s.prepend("@");
}
@@ -545,22 +545,22 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = e.firstChild().toText().data() + ".convertToImage()";
} else if ( e.tagName() == "enum" ) {
v = "%1::%2";
- TQString oc = objClass;
- TQString ev = e.firstChild().toText().data();
- if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0
- oc = "Qt::ScrollView";
+ 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
+ oc = "TQt::ScrollView";
v = v.arg( oc ).arg( ev );
} else if ( e.tagName() == "set" ) {
- TQString keys( e.firstChild().toText().data() );
- TQStringList lst = TQStringList::split( '|', keys );
+ TTQString keys( e.firstChild().toText().data() );
+ TTQStringList lst = TTQStringList::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
- TQStringList::Iterator it = lst.begin();
+ TTQStringList::Iterator it = lst.begin();
for ( ; it != lst.end(); ++it ) {
#else
- for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ for ( TTQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
#endif
v += objClass + "::" + *it;
if ( it != lst.fromLast() )
@@ -568,30 +568,30 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
}
v += "";
} else if ( e.tagName() == "sizepolicy" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQSizePolicy sp;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TTQSizePolicy::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();
}
- TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("self") : obj) + ".";
- v = "Qt::SizePolicy.new(%1, %2, %3, %4, " + tmp + "sizePolicy().hasHeightForWidth())";
+ TTQString tmp = (obj.isEmpty() ? TTQString::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" ) {
- TQPalette pal;
+ TTQPalette pal;
bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0;
- TQDomElement n;
+ TTQDomElement n;
if ( no_pixmaps ) {
n = e.firstChild().toElement();
while ( !n.isNull() ) {
- TQColorGroup cg;
+ TTQColorGroup cg;
if ( n.tagName() == "active" ) {
cg = loadColorGroup( n );
pal.setActive( cg );
@@ -605,19 +605,19 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
n = n.nextSibling().toElement();
}
}
- if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
- v = "Qt::Palette.new(Qt::Color.new(%1,%2,%3), Qt::Color.new(%1,%2,%3))";
+ if ( no_pixmaps && pal == TTQPalette( 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 {
- TQString palette = "pal";
+ TTQString palette = "pal";
if ( !pal_used ) {
- out << indent << palette << " = Qt::Palette.new()" << endl;
+ out << indent << palette << " = TQt::Palette.new()" << endl;
pal_used = true;
}
- TQString cg = "cg";
+ TTQString cg = "cg";
if ( !cg_used ) {
- out << indent << cg << " = Qt::ColorGroup.new()" << endl;
+ out << indent << cg << " = TQt::ColorGroup.new()" << endl;
cg_used = true;
}
n = e.firstChild().toElement();
@@ -640,10 +640,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = palette;
}
} else if ( e.tagName() == "cursor" ) {
- v = "Qt::Cursor.new(%1)";
+ v = "TQt::Cursor.new(%1)";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "date" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -655,10 +655,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Date.new(%1,%2,%3)";
+ v = "TQt::Date.new(%1,%2,%3)";
v = v.arg(y).arg(m).arg(d);
} else if ( e.tagName() == "time" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -670,10 +670,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Time.new(%1, %2, %3)";
+ v = "TQt::Time.new(%1, %2, %3)";
v = v.arg(h).arg(m).arg(s);
} else if ( e.tagName() == "datetime" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int h, mi, s, y, mo, d;
h = mi = s = y = mo = d = 0;
while ( !n3.isNull() ) {
@@ -691,12 +691,12 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::DateTime.new(Qt::Date.new(%1, %2, %3), Qt::Time.new(%4, %5, %6))";
+ 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" ) {
- TQStringList l;
- TQDomElement n3 = e.firstChild().toElement();
- TQString listname;
+ TTQStringList l;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQString listname;
if ( !obj.isEmpty() ) {
listname = obj + "_strlist";
out << indent << listname << " = [";
@@ -736,9 +736,9 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
/*! Extracts a named object property from \a e.
*/
-TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name )
+TTQDomElement Uic::getObjectProperty( const TTQDomElement& e, const TTQString& name )
{
- TQDomElement n;
+ TTQDomElement 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 11dfe060..8cfe5da4 100644
--- a/qtruby/rubylib/designer/rbuic/parser.cpp
+++ b/qtruby/rubylib/designer/rbuic/parser.cpp
@@ -27,25 +27,25 @@
#include <tqobject.h>
#include <tqstringlist.h>
-class NormalizeObject : public QObject
+class NormalizeObject : public TQObject
{
public:
- NormalizeObject() : TQObject() {}
- static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); }
+ NormalizeObject() : TTQObject() {}
+ static TTQCString normalizeSignalSlot( const char *signalSlot ) { return TTQObject::normalizeSignalSlot( signalSlot ); }
};
-TQString Parser::cleanArgs( const TQString &func )
+TTQString Parser::cleanArgs( const TTQString &func )
{
- TQString slot( func );
+ TTQString slot( func );
int begin = slot.find( "(" ) + 1;
- TQString args = slot.mid( begin );
+ TTQString args = slot.mid( begin );
args = args.left( args.find( ")" ) );
- TQStringList lst = TQStringList::split( ',', args );
- TQString res = slot.left( begin );
- for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TTQStringList lst = TTQStringList::split( ',', args );
+ TTQString res = slot.left( begin );
+ for ( TTQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
if ( it != lst.begin() )
res += ",";
- TQString arg = *it;
+ TTQString arg = *it;
int pos = 0;
if ( ( pos = arg.find( "&" ) ) != -1 ) {
arg = arg.left( pos + 1 );
@@ -55,7 +55,7 @@ TQString Parser::cleanArgs( const TQString &func )
arg = arg.simplifyWhiteSpace();
if ( ( pos = arg.find( ':' ) ) != -1 )
arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace();
- TQStringList l = TQStringList::split( ' ', arg );
+ TTQStringList l = TTQStringList::split( ' ', arg );
if ( l.count() == 2 ) {
if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" )
arg = l[ 0 ];
@@ -67,5 +67,5 @@ TQString Parser::cleanArgs( const TQString &func )
}
res += ")";
- return TQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
+ return TTQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
}
diff --git a/qtruby/rubylib/designer/rbuic/parser.h b/qtruby/rubylib/designer/rbuic/parser.h
index ace96d9e..e03f1b1c 100644
--- a/qtruby/rubylib/designer/rbuic/parser.h
+++ b/qtruby/rubylib/designer/rbuic/parser.h
@@ -26,7 +26,7 @@
class Parser
{
public:
- static TQString cleanArgs( const TQString &func );
+ static TTQString cleanArgs( const TTQString &func );
};
diff --git a/qtruby/rubylib/designer/rbuic/subclassing.cpp b/qtruby/rubylib/designer/rbuic/subclassing.cpp
index e6a876f0..ef19cf53 100644
--- a/qtruby/rubylib/designer/rbuic/subclassing.cpp
+++ b/qtruby/rubylib/designer/rbuic/subclassing.cpp
@@ -39,20 +39,20 @@
\sa createSubDecl()
*/
-void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
+void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass )
{
- TQDomElement n;
- TQDomNodeList nl;
+ TTQDomElement n;
+ TTQDomNodeList nl;
int i;
- TQStringList::Iterator it, it2, it3;
+ TTQStringList::Iterator it, it2, it3;
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
if (hasKDEwidget) {
- out << indent << "require 'Korundum'" << endl;
+ out << indent << "retquire 'Korundum'" << endl;
} else {
- out << indent << "require 'Qt'" << endl;
+ out << indent << "retquire 'Qt'" << endl;
}
out << endl;
out << indent << "class " << subClass << " < " << nameOfClass << endl;
@@ -61,7 +61,7 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
++indent;
// constructor
- if ( objClass == "Qt::Dialog" || objClass == "Qt::Wizard" ) {
+ if ( objClass == "TQt::Dialog" || objClass == "TQt::Wizard" ) {
out << indent << "# Constructs a " << subClass << " which is a child of 'parent', with the " << endl;
out << indent << "# name 'name' and widget flags set to 'fl' " << endl;
out << indent << "# " << endl;
@@ -82,10 +82,10 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
out << endl;
// find additional slots
- TQStringList publicSlots, protectedSlots, privateSlots;
- TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
- TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
- TQMap<TQString, TQString> functionImpls;
+ TTQStringList publicSlots, protectedSlots, privateSlots;
+ TTQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes;
+ TTQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier;
+ TTQMap<TTQString, TTQString> 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 TQDomElement &e, const TQString& subClass )
continue;
if ( n.attribute( "language", "C++" ) != "C++" )
continue;
- TQString returnType = n.attribute( "returnType", "void" );
- TQString slotName = n.firstChild().toText().data().stripWhiteSpace();
+ TTQString returnType = n.attribute( "returnType", "void" );
+ TTQString slotName = n.firstChild().toText().data().stripWhiteSpace();
if ( slotName.endsWith( ";" ) )
slotName = slotName.left( slotName.length() - 1 );
- TQString specifier = n.attribute( "specifier" );
- TQString access = n.attribute( "access" );
+ TTQString specifier = n.attribute( "specifier" );
+ TTQString access = n.attribute( "access" );
if ( access == "protected" ) {
protectedSlots += slotName;
protectedSlotTypes += returnType;
@@ -119,7 +119,7 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
// compatibility with early 3.0 betas
nl = e.parentNode().toElement().elementsByTagName( "function" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- TQString fname = n.attribute( "name" );
+ TTQString fname = n.attribute( "name" );
fname = Parser::cleanArgs( fname );
functionImpls.insert( fname, n.firstChild().toText().data() );
}
@@ -127,8 +127,8 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
if ( !publicSlots.isEmpty() ) {
for ( it = publicSlots.begin(), it2 = publicSlotTypes.begin(), it3 = publicSlotSpecifier.begin();
it != publicSlots.end(); ++it, ++it2, ++it3 ) {
- TQString pure;
- TQString type = *it2;
+ TTQString pure;
+ TTQString type = *it2;
if ( type.isEmpty() )
type = "void";
if ( *it3 == "non virtual" )
@@ -149,8 +149,8 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
if ( !protectedSlots.isEmpty() ) {
for ( it = protectedSlots.begin(), it2 = protectedSlotTypes.begin(), it3 = protectedSlotSpecifier.begin();
it != protectedSlots.end(); ++it, ++it2, ++it3 ) {
- TQString pure;
- TQString type = *it2;
+ TTQString pure;
+ TTQString type = *it2;
if ( type.isEmpty() )
type = "void";
if ( *it3 == "non virtual" )
@@ -173,8 +173,8 @@ void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass )
if ( !privateSlots.isEmpty() ) {
for ( it = privateSlots.begin(), it2 = privateSlotTypes.begin(), it3 = privateSlotSpecifier.begin();
it != privateSlots.end(); ++it, ++it2, ++it3 ) {
- TQString pure;
- TQString type = *it2;
+ TTQString pure;
+ TTQString 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 07fb377a..106e9879 100644
--- a/qtruby/rubylib/designer/rbuic/uic.cpp
+++ b/qtruby/rubylib/designer/rbuic/uic.cpp
@@ -67,42 +67,42 @@ void RubyIndent::calc()
}
-TQString Uic::getComment( const TQDomNode& n )
+TTQString Uic::getComment( const TTQDomNode& n )
{
- TQDomNode child = n.firstChild();
+ TTQDomNode child = n.firstChild();
while ( !child.isNull() ) {
if ( child.toElement().tagName() == "comment" )
return child.toElement().firstChild().toText().data();
child = child.nextSibling();
}
- return TQString::null;
+ return TTQString::null;
}
-TQString Uic::mkBool( bool b )
+TTQString Uic::mkBool( bool b )
{
return b? "true" : "false";
}
-TQString Uic::mkBool( const TQString& s )
+TTQString Uic::mkBool( const TTQString& s )
{
return mkBool( s == "true" || s == "1" );
}
-bool Uic::toBool( const TQString& s )
+bool Uic::toBool( const TTQString& s )
{
return s == "true" || s.toInt() != 0;
}
-TQString Uic::fixString( const TQString &str )
+TTQString Uic::fixString( const TTQString &str )
{
- TQString s( str );
- s.replace( TQRegExp( "\\\\" ), "\\\\" );
- s.replace( TQRegExp( "\"" ), "\\\"" );
- s.replace( TQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" );
+ TTQString s( str );
+ s.replace( TTQRegExp( "\\\\" ), "\\\\" );
+ s.replace( TTQRegExp( "\"" ), "\\\"" );
+ s.replace( TTQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" );
return "\"" + s + "\"";
}
-TQString Uic::trcall( const TQString& sourceText, const TQString& comment )
+TTQString Uic::trcall( const TTQString& sourceText, const TTQString& comment )
{
if ( sourceText.isEmpty() && comment.isEmpty() )
return "nil";
@@ -112,19 +112,19 @@ TQString Uic::trcall( const TQString& sourceText, const TQString& comment )
return trmacro + "(" + fixString( sourceText ) + "," + fixString( comment ) + ")";
}
-TQString Uic::mkStdSet( const TQString& prop )
+TTQString Uic::mkStdSet( const TTQString& prop )
{
- return TQString( "set" ) + prop[0].upper() + prop.mid(1);
+ return TTQString( "set" ) + prop[0].upper() + prop.mid(1);
}
-bool Uic::isEmptyFunction( const TQString& fname )
+bool Uic::isEmptyFunction( const TTQString& fname )
{
- TQMap<TQString, TQString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) );
+ TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) );
if ( fit != functionImpls.end() ) {
int begin = (*fit).find( "{" );
- TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
+ TTQString 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 TQString& fname )
The class Uic encapsulates the user interface compiler (uic).
*/
-Uic::Uic( const TQString &fn, TQTextStream &outStream, TQDomDocument doc,
- bool subcl, const TQString &trm, const TQString& subClass,
- bool omitForwardDecls, TQString &uicClass, bool useKDE )
+Uic::Uic( const TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc,
+ bool subcl, const TTQString &trm, const TTQString& subClass,
+ bool omitForwardDecls, TTQString &uicClass, bool useKDE )
: out( outStream ), trout( &languageChangeBody ),
trmacro( trm ), nofwd( omitForwardDecls )
{
@@ -164,16 +164,16 @@ Uic::Uic( const TQString &fn, TQTextStream &outStream, TQDomDocument doc,
uiFileVersion = doc.firstChild().toElement().attribute("version");
stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") );
- TQDomElement e = doc.firstChild().firstChild().toElement();
- TQDomElement widget;
+ TTQDomElement e = doc.firstChild().firstChild().toElement();
+ TTQDomElement 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", TQString::number( defSpacing ) ).toInt();
- defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt();
+ defSpacing = e.attribute( "spacing", TTQString::number( defSpacing ) ).toInt();
+ defMargin = e.attribute( "margin", TTQString::number( defMargin ) ).toInt();
}
e = e.nextSibling().toElement();
}
@@ -193,26 +193,26 @@ Uic::Uic( const TQString &fn, TQTextStream &outStream, TQDomDocument doc,
/*! Extracts a pixmap loader function from \a e
*/
-TQString Uic::getPixmapLoaderFunction( const TQDomElement& e )
+TTQString Uic::getPixmapLoaderFunction( const TTQDomElement& e )
{
- TQDomElement n;
+ TTQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "pixmapfunction" )
return n.firstChild().toText().data();
}
- return TQString::null;
+ return TTQString::null;
}
/*! Extracts the forms class name from \a e
*/
-TQString Uic::getFormClassName( const TQDomElement& e )
+TTQString Uic::getFormClassName( const TTQDomElement& e )
{
- TQDomElement n;
- TQString cn;
+ TTQDomElement n;
+ TTQString cn;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "class" ) {
- TQString s = n.firstChild().toText().data();
+ TTQString s = n.firstChild().toText().data();
int i;
while ( ( i = s.find(' ' )) != -1 )
s[i] = '_';
@@ -224,16 +224,16 @@ TQString Uic::getFormClassName( const TQDomElement& e )
/*! Extracts a Ruby class name from \a e.
*/
-TQString Uic::getClassName( const TQDomElement& e )
+TTQString Uic::getClassName( const TTQDomElement& e )
{
- TQString s = e.attribute( "class" );
+ TTQString s = e.attribute( "class" );
if ( s.isEmpty() && e.tagName() == "toolbar" )
- s = "Qt::ToolBar";
+ s = "TQt::ToolBar";
else if ( s.isEmpty() && e.tagName() == "menubar" )
- s = "Qt::MenuBar";
+ s = "TQt::MenuBar";
else
{
- TQRegExp r("^([QK])(\\S+)");
+ TTQRegExp r("^([QK])(\\S+)");
if( r.search( s ) != -1 ) {
if (r.cap(1) == "K") {
hasKDEwidget = true;
@@ -242,7 +242,7 @@ TQString Uic::getClassName( const TQDomElement& e )
if (s.startsWith("Qext")) {
s = "Qext::" + r.cap(2).mid(4);
} else {
- s = "Qt::" + r.cap(2);
+ s = "TQt::" + r.cap(2);
}
}
}
@@ -255,11 +255,11 @@ TQString Uic::getClassName( const TQDomElement& e )
/*! Returns TRUE if database framework code is generated, else FALSE.
*/
-bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
+bool Uic::isFrameworkCodeGenerated( const TTQDomElement& e )
{
- TQDomElement n = getObjectProperty( e, "frameworkCode" );
+ TTQDomElement n = getObjectProperty( e, "frameworkCode" );
if ( n.attribute("name") == "frameworkCode" &&
- !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true, 0 ) ).toBool() )
+ !DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant( true, 0 ) ).toBool() )
return false;
return true;
}
@@ -267,36 +267,36 @@ bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
/*! Extracts an object name from \a e. It's stored in the 'name'
property.
*/
-TQString Uic::getObjectName( const TQDomElement& e )
+TTQString Uic::getObjectName( const TTQDomElement& e )
{
- TQDomElement n = getObjectProperty( e, "name" );
+ TTQDomElement n = getObjectProperty( e, "name" );
if ( n.firstChild().toElement().tagName() == "cstring" )
return n.firstChild().toElement().firstChild().toText().data();
- return TQString::null;
+ return TTQString::null;
}
/*! Extracts an layout name from \a e. It's stored in the 'name'
- property of the preceeding sibling (the first child of a QLayoutWidget).
+ property of the preceeding sibling (the first child of a TQLayoutWidget).
*/
-TQString Uic::getLayoutName( const TQDomElement& e )
+TTQString Uic::getLayoutName( const TTQDomElement& e )
{
- TQDomElement p = e.parentNode().toElement();
- TQString tail = TQString::null;
+ TTQDomElement p = e.parentNode().toElement();
+ TTQString tail = TTQString::null;
- if ( getClassName(p) != "Qt::LayoutWidget" )
+ if ( getClassName(p) != "TQt::LayoutWidget" )
tail = "Layout";
- TQDomElement n = getObjectProperty( p, "name" );
+ TTQDomElement n = getObjectProperty( p, "name" );
if ( n.firstChild().toElement().tagName() == "cstring" )
return n.firstChild().toElement().firstChild().toText().data() + tail;
return e.tagName();
}
-TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag )
+TTQString Uic::getDatabaseInfo( const TTQDomElement& e, const TTQString& tag )
{
- TQDomElement n;
- TQDomElement n1;
+ TTQDomElement n;
+ TTQDomElement n1;
int child = 0;
// database info is a stringlist stored in this order
if ( tag == "connection" )
@@ -306,27 +306,27 @@ TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag )
else if ( tag == "field" )
child = 2;
else
- return TQString::null;
+ return TTQString::null;
n = getObjectProperty( e, "database" );
if ( n.firstChild().toElement().tagName() == "stringlist" ) {
// find correct stringlist entry
- TQDomElement n1 = n.firstChild().firstChild().toElement();
+ TTQDomElement n1 = n.firstChild().firstChild().toElement();
for ( int i = 0; i < child && !n1.isNull(); ++i )
n1 = n1.nextSibling().toElement();
if ( n1.isNull() )
- return TQString::null;
+ return TTQString::null;
return n1.firstChild().toText().data();
}
- return TQString::null;
+ return TTQString::null;
}
-void Uic::registerLayouts( const TQDomElement &e )
+void Uic::registerLayouts( const TTQDomElement &e )
{
if ( layouts.contains(e.tagName()) )
createObjectDecl(e);
- TQDomNodeList nl = e.childNodes();
+ TTQDomNodeList nl = e.childNodes();
for ( int i = 0; i < (int) nl.length(); ++i )
registerLayouts( nl.item(i).toElement() );
}
@@ -335,59 +335,59 @@ void Uic::registerLayouts( const TQDomElement &e )
/*!
Returns include file for class \a className or a null string.
*/
-TQString Uic::getInclude( const TQString& className )
+TTQString Uic::getInclude( const TTQString& className )
{
int wid = WidgetDatabase::idFromClassName( className );
if ( wid != -1 )
return WidgetDatabase::includeFile( wid );
- return TQString::null;
+ return TTQString::null;
}
-void Uic::createActionDecl( const TQDomElement& e )
+void Uic::createActionDecl( const TTQDomElement& e )
{
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
out << indent << objName << endl;
if ( e.tagName() == "actiongroup" ) {
- for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ for ( TTQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "action" || n.tagName() == "actiongroup" )
createActionDecl( n );
}
}
}
-void Uic::createActionImpl( const TQDomElement &n, const TQString &parent )
+void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent )
{
- for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) {
- TQString objName = registerObject( getObjectName( ae ) );
+ for ( TTQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) {
+ TTQString objName = registerObject( getObjectName( ae ) );
if ( ae.tagName() == "action" )
- out << indent << objName << "= Qt::Action.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl;
+ out << indent << objName << "= TQt::Action.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl;
else if ( ae.tagName() == "actiongroup" )
- out << indent << objName << "= Qt::ActionGroup.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl;
+ out << indent << objName << "= TQt::ActionGroup.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl;
else
continue;
bool subActionsDone = false;
bool hasMenuText = false;
- TQString actionText;
- for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ TTQString actionText;
+ for ( TTQDomElement 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" ) );
- TQString prop = n2.attribute("name");
+ TTQString prop = n2.attribute("name");
if ( prop == "name" )
continue;
- TQString value = setObjectProperty( "Qt::Action", objName, prop, n2.firstChild().toElement(), stdset );
+ TTQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
- TQString call = objName + ".";
+ TTQString call = objName + ".";
if ( stdset ) {
call += mkStdSet( prop ) + "(" + value + ")";
} else {
call += "setProperty( \"" + prop + "\", ";
- call += "Qt::Variant.new(" + value + "))";
+ call += "TQt::Variant.new(" + value + "))";
}
if (prop == "menuText")
@@ -405,13 +405,13 @@ void Uic::createActionImpl( const TQDomElement &n, const TQString &parent )
subActionsDone = true;
}
}
- // workaround for loading pre-3.3 files expecting bogus TQAction behavior
+ // workaround for loading pre-3.3 files expecting bogus TTQAction behavior
if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3")
trout << indent << objName << ".setMenuText(" << actionText << ")" << endl;
}
}
-TQString get_dock( const TQString &d )
+TTQString get_dock( const TTQString &d )
{
if ( d == "0" )
return "DockUnmanaged";
@@ -430,27 +430,27 @@ TQString get_dock( const TQString &d )
return "";
}
-void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent )
+void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent )
{
- TQDomNodeList nl = n.elementsByTagName( "toolbar" );
+ TTQDomNodeList nl = n.elementsByTagName( "toolbar" );
for ( int i = 0; i < (int) nl.length(); i++ ) {
- TQDomElement ae = nl.item( i ).toElement();
- TQString dock = get_dock( ae.attribute( "dock" ) );
- TQString objName = "@" + getObjectName( ae );
- out << indent << objName << " = Qt::ToolBar.new(\"\", self, " << dock << ")" << endl;
+ TTQDomElement ae = nl.item( i ).toElement();
+ TTQString dock = get_dock( ae.attribute( "dock" ) );
+ TTQString objName = "@" + getObjectName( ae );
+ out << indent << objName << " = TQt::ToolBar.new(\"\", self, " << dock << ")" << endl;
createObjectImpl( ae, parentClass, parent );
- for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ for ( TTQDomElement 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" ) {
out << indent << objName << ".addSeparator;" << endl;
} else if ( n2.tagName() == "widget" ) {
if ( n2.attribute( "class" ) != "Spacer" ) {
- createObjectImpl( n2, "Qt::ToolBar", objName );
+ createObjectImpl( n2, "TQt::ToolBar", objName );
} else {
- TQString child = createSpacerImpl( n2, parentClass, parent, objName );
- out << indent << "Qt::Application.sendPostedEvents( " << objName
- << ", Qt::Event::ChildInserted)" << endl;
+ TTQString 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 TQDomElement &n, const TQString &parentClass,
}
}
-void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent )
+void Uic::createMenuBarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent )
{
- TQString objName = "@" + getObjectName( n );
- out << indent << objName << " = Qt::MenuBar.new( self, \"" << objName.mid(1) << "\" )" << endl;
+ TTQString objName = "@" + getObjectName( n );
+ out << indent << objName << " = TQt::MenuBar.new( self, \"" << objName.mid(1) << "\" )" << endl;
createObjectImpl( n, parentClass, parent );
int i = 0;
- TQDomElement c = n.firstChild().toElement();
+ TTQDomElement c = n.firstChild().toElement();
while ( !c.isNull() ) {
if ( c.tagName() == "item" ) {
- TQString itemName = "@" + c.attribute( "name" );
+ TTQString itemName = "@" + c.attribute( "name" );
out << endl;
- out << indent << itemName << " = Qt::PopupMenu.new( self )" << endl;
+ out << indent << itemName << " = TQt::PopupMenu.new( self )" << endl;
createPopupMenuImpl( c, parentClass, itemName );
out << indent << objName << ".insertItem( \"\", " << itemName << ", " << i << " )" << endl;
- TQString findItem(objName + ".findItem(%1)");
+ TTQString 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,16 +486,16 @@ void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass,
}
}
-void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent )
+void Uic::createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent )
{
int i = 0;
- for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ for ( TTQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) {
- TQDomElement n2 = n.nextSibling().toElement();
+ TTQDomElement n2 = n.nextSibling().toElement();
if ( n2.tagName() == "item" ) { // the action has a sub menu
- TQString itemName = "@" + n2.attribute( "name" );
- TQString itemText = n2.attribute( "text" );
- out << indent << itemName << " = Qt::PopupMenu.new( self )" << endl;
+ TTQString itemName = "@" + n2.attribute( "name" );
+ TTQString 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;
trout << indent << parent << ".changeItem( " << parent << ".idAt( " << i << " ), ";
@@ -516,17 +516,17 @@ void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClas
Creates implementation of an listbox item tag.
*/
-TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent,
- TQString *value )
+TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &parent,
+ TTQString *value )
{
- TQDomElement n = e.firstChild().toElement();
- TQString txt;
- TQString com;
- TQString pix;
+ TTQDomElement n = e.firstChild().toElement();
+ TTQString txt;
+ TTQString com;
+ TTQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- TQString attrib = n.attribute("name");
- TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ TTQString attrib = n.attribute("name");
+ TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -536,8 +536,8 @@ TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &pare
pix.prepend("@");
}
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
}
@@ -557,16 +557,16 @@ TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &pare
Creates implementation of an iconview item tag.
*/
-TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent )
+TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString &parent )
{
- TQDomElement n = e.firstChild().toElement();
- TQString txt;
- TQString com;
- TQString pix;
+ TTQDomElement n = e.firstChild().toElement();
+ TTQString txt;
+ TTQString com;
+ TTQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- TQString attrib = n.attribute("name");
- TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ TTQString attrib = n.attribute("name");
+ TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -576,8 +576,8 @@ TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &par
pix.prepend("@");
}
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
}
@@ -585,24 +585,24 @@ TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &par
}
if ( pix.isEmpty() )
- return "Qt::IconViewItem.new(" + parent + ", " + trcall( txt, com ) + ")";
+ return "TQt::IconViewItem.new(" + parent + ", " + trcall( txt, com ) + ")";
else
- return "Qt::IconViewItem.new(" + parent + ", " + trcall( txt, com ) + ", " + pix + ")";
+ return "TQt::IconViewItem.new(" + parent + ", " + trcall( txt, com ) + ", " + pix + ")";
}
/*!
Creates implementation of an listview item tag.
*/
-TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent,
- const TQString &parentItem )
+TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString &parent,
+ const TTQString &parentItem )
{
- TQString s;
+ TTQString s;
- TQDomElement n = e.firstChild().toElement();
+ TTQDomElement n = e.firstChild().toElement();
bool hasChildren = e.elementsByTagName( "item" ).count() > 0;
- TQString item;
+ TTQString item;
if ( hasChildren ) {
item = registerObject( "item" );
@@ -619,26 +619,26 @@ TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &par
}
if ( !parentItem.isEmpty() )
- s += "Qt::ListViewItem.new(" + parentItem + ", " + lastItem + ")\n";
+ s += "TQt::ListViewItem.new(" + parentItem + ", " + lastItem + ")\n";
else
- s += "Qt::ListViewItem.new(" + parent + ", " + lastItem + ")\n";
+ s += "TQt::ListViewItem.new(" + parent + ", " + lastItem + ")\n";
- TQStringList textes;
- TQStringList pixmaps;
+ TTQStringList textes;
+ TTQStringList pixmaps;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- TQString attrib = n.attribute("name");
- TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ TTQString attrib = n.attribute("name");
+ TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() );
if ( attrib == "text" )
textes << v.toString();
else if ( attrib == "pixmap" ) {
- TQString pix = v.toString();
+ TTQString pix = v.toString();
if (!pix.isEmpty()) {
pix.prepend("@");
}
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
pixmaps << pix;
}
@@ -651,9 +651,9 @@ TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &par
for ( int i = 0; i < (int)textes.count(); ++i ) {
if ( !textes[ i ].isEmpty() )
- s += indent + item + ".setText(" + TQString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n";
+ s += indent + item + ".setText(" + TTQString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n";
if ( !pixmaps[ i ].isEmpty() )
- s += indent + item + ".setPixmap(" + TQString::number( i ) + ", " + pixmaps[ i ] + ")\n";
+ s += indent + item + ".setPixmap(" + TTQString::number( i ) + ", " + pixmaps[ i ] + ")\n";
}
lastItem = item;
@@ -664,18 +664,18 @@ TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &par
Creates implementation of an listview column tag.
*/
-TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent,
- TQString *value )
+TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString &parent,
+ TTQString *value )
{
- TQDomElement n = e.firstChild().toElement();
- TQString txt;
- TQString com;
- TQString pix;
+ TTQDomElement n = e.firstChild().toElement();
+ TTQString txt;
+ TTQString com;
+ TTQString pix;
bool clickable = false, resizeable = false;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- TQString attrib = n.attribute("name");
- TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ TTQString attrib = n.attribute("name");
+ TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
@@ -685,8 +685,8 @@ TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &p
pix.prepend("@");
}
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( attrib == "clickable" )
clickable = v.toBool();
@@ -699,7 +699,7 @@ TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &p
if ( value )
*value = trcall( txt, com );
- TQString s;
+ TTQString 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 @@ TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &p
return s;
}
-TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent,
- TQString *value )
+TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString &parent,
+ TTQString *value )
{
- TQString objClass = getClassName( e.parentNode().toElement() );
- TQDomElement n = e.firstChild().toElement();
- TQString txt;
- TQString com;
- TQString pix;
- TQString field;
+ TTQString objClass = getClassName( e.parentNode().toElement() );
+ TTQDomElement n = e.firstChild().toElement();
+ TTQString txt;
+ TTQString com;
+ TTQString pix;
+ TTQString field;
bool isRow = e.tagName() == "row";
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- TQString attrib = n.attribute("name");
- TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
+ TTQString attrib = n.attribute("name");
+ TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() );
if ( attrib == "text" ) {
txt = v.toString();
com = getComment( n );
} else if ( attrib == "pixmap" ) {
pix = v.toString();
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
- pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( attrib == "field" )
field = v.toString();
@@ -745,32 +745,32 @@ TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &p
// ### This generated code sucks! We have to set the number of
// rows/cols before and then only do setLabel/()
- // ### careful, though, since TQDataTable has an API which makes this code pretty good
+ // ### careful, though, since TTQDataTable has an API which makes this code pretty good
- TQString s;
+ TTQString s;
if ( isRow ) {
s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1 )\n";
if ( pix.isEmpty() )
s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1, "
+ trcall( txt, com ) + ")\n";
else
- s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1, Qt::IconSet.new(@"
+ s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1, TQt::IconSet.new(@"
+ pix + " ), " + trcall( txt, com ) + ")\n";
} else {
- if ( objClass == "Qt::Table" ) {
+ if ( objClass == "TQt::Table" ) {
s = indent + parent + ".setNumCols(" + parent + ".numCols() + 1)\n";
if ( pix.isEmpty() )
s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1, "
+ trcall( txt, com ) + ")\n";
else
- s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1, Qt::IconSet.new(@"
+ s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1, TQt::IconSet.new(@"
+ pix + " ), " + trcall( txt, com ) + ")\n";
- } else if ( objClass == "Qt::DataTable" ) {
+ } else if ( objClass == "TQt::DataTable" ) {
if ( !txt.isEmpty() && !field.isEmpty() ) {
if ( pix.isEmpty() )
out << indent << parent << ".addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ")" << endl;
else
- out << indent << parent << ".addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ", Qt::IconSet.new(@" << pix << "))" << endl;
+ out << indent << parent << ".addColumn(" << fixString( field ) << ", " << trcall( txt, com ) << ", TQt::IconSet.new(@" << pix << "))" << endl;
}
}
}
@@ -780,32 +780,32 @@ TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &p
/*!
Creates the implementation of a layout tag. Called from createObjectImpl().
*/
-TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout )
+TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout )
{
- TQDomElement n;
- TQString objClass, objName;
+ TTQDomElement n;
+ TTQString objClass, objName;
objClass = e.tagName();
- TQString qlayout = "Qt::VBoxLayout.new";
+ TTQString qlayout = "TQt::VBoxLayout.new";
if ( objClass == "hbox" )
- qlayout = "Qt::HBoxLayout.new";
+ qlayout = "TQt::HBoxLayout.new";
else if ( objClass == "grid" )
- qlayout = "Qt::GridLayout.new";
+ qlayout = "TQt::GridLayout.new";
bool isGrid = e.tagName() == "grid" ;
objName = registerObject( getLayoutName( e ) );
layoutObjects += objName;
- 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 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 optcells;
+ TTQString optcells;
if ( isGrid )
optcells = "1, 1, ";
- if ( (parentClass == "Qt::GroupBox" || parentClass == "Qt::ButtonGroup") && layout.isEmpty() ) {
+ if ( (parentClass == "TQt::GroupBox" || parentClass == "TQt::ButtonGroup") && layout.isEmpty() ) {
// special case for group box
- out << indent << parent << ".setColumnLayout( 0, Qt::Vertical )" << endl;
+ out << indent << parent << ".setColumnLayout( 0, TQt::Vertical )" << endl;
out << indent << parent << ".layout().setSpacing(" << spacing << ")" << endl;
out << indent << parent << ".layout().setMargin(" << margin << ")" << endl;
out << indent << objName << " = " << qlayout << "(" << parent << ".layout() )" << endl;
@@ -822,15 +822,15 @@ TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentCla
out << ", " << optcells << margin << ", " << spacing << ", '" << objName.mid(1) << "')" << endl;
}
if ( !resizeMode.isEmpty() )
- out << indent << objName << ".setResizeMode( Qt::Layout::" << resizeMode << " )" << endl;
+ out << indent << objName << ".setResizeMode( TQt::Layout::" << resizeMode << " )" << endl;
if ( !isGrid ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "spacer" ) {
- TQString child = createSpacerImpl( n, parentClass, parent, objName );
+ TTQString child = createSpacerImpl( n, parentClass, parent, objName );
out << indent << objName << ".addItem(" << child << ")" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- TQString child = createObjectImpl( n, parentClass, parent, objName );
+ TTQString child = createObjectImpl( n, parentClass, parent, objName );
if ( isLayout( child ) )
out << indent << objName << ".addLayout(" << child << ")" << endl;
else
@@ -839,7 +839,7 @@ TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentCla
}
} else {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
- TQDomElement ae = n;
+ TTQDomElement ae = n;
int row = ae.attribute( "row" ).toInt();
int col = ae.attribute( "column" ).toInt();
int rowspan = ae.attribute( "rowspan" ).toInt();
@@ -849,7 +849,7 @@ TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentCla
if ( colspan < 1 )
colspan = 1;
if ( n.tagName() == "spacer" ) {
- TQString child = createSpacerImpl( n, parentClass, parent, objName );
+ TTQString 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 @@ TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentCla
out << indent << objName << ".addItem(" << child << ", "
<< row << ", " << col << ")" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- TQString child = createObjectImpl( n, parentClass, parent, objName );
+ TTQString child = createObjectImpl( n, parentClass, parent, objName );
out << endl;
- TQString o = "Widget";
+ TTQString o = "Widget";
if ( isLayout( child ) )
o = "Layout";
if ( rowspan * colspan != 1 )
@@ -877,31 +877,31 @@ TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentCla
-TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/)
+TTQString Uic::createSpacerImpl( const TTQDomElement &e, const TTQString& /*parentClass*/, const TTQString& /*parent*/, const TTQString& /*layout*/)
{
- TQDomElement n;
- TQString objClass, objName;
+ TTQDomElement n;
+ TTQString objClass, objName;
objClass = e.tagName();
objName = registerObject( getObjectName( e ) );
- TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize();
- TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
+ TTQSize size = DomTool::readProperty( e, "sizeHint", TTQSize( 0, 0 ) ).toSize();
+ TTQString 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
- TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect();
+ TTQRect geom = DomTool::readProperty( e, "geometry", TTQRect(0,0,0,0) ).toRect();
size = geom.size();
}
if ( isVspacer )
- out << indent << objName << " = Qt::SpacerItem.new("
+ out << indent << objName << " = TQt::SpacerItem.new("
<< size.width() << ", " << size.height()
- << ", Qt::SizePolicy::Minimum, Qt::SizePolicy::" << sizeType << ")" << endl;
+ << ", TQt::SizePolicy::Minimum, TQt::SizePolicy::" << sizeType << ")" << endl;
else
- out << indent << objName << " = Qt::SpacerItem.new("
+ out << indent << objName << " = TQt::SpacerItem.new("
<< size.width() << ", " << size.height()
- << ", Qt::SizePolicy::" << sizeType << ", Qt::SizePolicy::Minimum)" << endl;
+ << ", TQt::SizePolicy::" << sizeType << ", TQt::SizePolicy::Minimum)" << endl;
return objName;
}
@@ -916,34 +916,34 @@ static const char* const ColorRole[] = {
/*!
Creates a colorgroup with name \a name from the color group \a cg
*/
-void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e )
+void Uic::createColorGroupImpl( const TTQString& name, const TTQDomElement& e )
{
- TQColorGroup cg;
+ TTQColorGroup cg;
int r = -1;
- TQDomElement n = e.firstChild().toElement();
- TQString color;
+ TTQDomElement n = e.firstChild().toElement();
+ TTQString color;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- TQColor col = DomTool::readColor( n );
- color = "Qt::Color.new(%1,%2,%3)";
+ TTQColor 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 )
color = "white";
else if ( col == black )
color = "black";
if ( n.nextSibling().toElement().tagName() != "pixmap" ) {
- out << indent << name << ".setColor(Qt::ColorGroup::" << ColorRole[r] << ", " << color << ")" << endl;
+ out << indent << name << ".setColor(TQt::ColorGroup::" << ColorRole[r] << ", " << color << ")" << endl;
}
} else if ( n.tagName() == "pixmap" ) {
- TQString pixmap = n.firstChild().toText().data();
+ TTQString pixmap = n.firstChild().toText().data();
pixmap.prepend("@");
if ( !pixmapLoaderFunction.isEmpty() ) {
- pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ pixmap.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ pixmap.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
- out << indent << name << ".setBrush(Qt::ColorGroup::"
- << ColorRole[r] << ", Qt::Brush.new(" << color << ", " << pixmap << "))" << endl;
+ out << indent << name << ".setBrush(TQt::ColorGroup::"
+ << ColorRole[r] << ", TQt::Brush.new(" << color << ", " << pixmap << "))" << endl;
}
n = n.nextSibling().toElement();
}
@@ -953,16 +953,16 @@ void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e )
Auxiliary function to load a color group. The colorgroup must not
contain pixmaps.
*/
-TQColorGroup Uic::loadColorGroup( const TQDomElement &e )
+TTQColorGroup Uic::loadColorGroup( const TTQDomElement &e )
{
- TQColorGroup cg;
+ TTQColorGroup cg;
int r = -1;
- TQDomElement n = e.firstChild().toElement();
- TQColor col;
+ TTQDomElement n = e.firstChild().toElement();
+ TTQColor col;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ cg.setColor( (TTQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
}
n = n.nextSibling().toElement();
}
@@ -973,10 +973,10 @@ TQColorGroup Uic::loadColorGroup( const TQDomElement &e )
the database \a connection and \a table.
*/
-bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table )
+bool Uic::isWidgetInTable( const TTQDomElement& e, const TTQString& connection, const TTQString& table )
{
- TQString conn = getDatabaseInfo( e, "connection" );
- TQString tab = getDatabaseInfo( e, "table" );
+ TTQString conn = getDatabaseInfo( e, "connection" );
+ TTQString tab = getDatabaseInfo( e, "table" );
if ( conn == connection && tab == table )
return true;
return false;
@@ -986,17 +986,17 @@ bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, co
Registers all database connections, cursors and forms.
*/
-void Uic::registerDatabases( const TQDomElement& e )
+void Uic::registerDatabases( const TTQDomElement& e )
{
- TQDomElement n;
- TQDomNodeList nl;
+ TTQDomElement n;
+ TTQDomNodeList nl;
int i;
nl = e.parentNode().toElement().elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); ++i ) {
n = nl.item(i).toElement();
- TQString conn = getDatabaseInfo( n, "connection" );
- TQString tab = getDatabaseInfo( n, "table" );
- TQString fld = getDatabaseInfo( n, "field" );
+ TTQString conn = getDatabaseInfo( n, "connection" );
+ TTQString tab = getDatabaseInfo( n, "table" );
+ TTQString fld = getDatabaseInfo( n, "field" );
if ( !conn.isNull() ) {
dbConnections += conn;
if ( !tab.isNull() ) {
@@ -1016,7 +1016,7 @@ void Uic::registerDatabases( const TQDomElement& e )
\sa registeredName(), isObjectRegistered()
*/
-TQString Uic::registerObject( const TQString& name )
+TTQString Uic::registerObject( const TTQString& name )
{
if ( objectNames.isEmpty() ) {
// some temporary variables we need
@@ -1025,7 +1025,7 @@ TQString Uic::registerObject( const TQString& name )
objectNames += "cg";
objectNames += "pal";
}
- TQString result("@");
+ TTQString result("@");
result += name;
int i;
while ( ( i = result.find(' ' )) != -1 ) {
@@ -1034,10 +1034,10 @@ TQString Uic::registerObject( const TQString& name )
if ( objectNames.contains( result ) ) {
int i = 2;
- while ( objectNames.contains( result + "_" + TQString::number(i) ) )
+ while ( objectNames.contains( result + "_" + TTQString::number(i) ) )
i++;
result += "_";
- result += TQString::number(i);
+ result += TTQString::number(i);
}
objectNames += result;
objectMapper.insert( name, result );
@@ -1050,7 +1050,7 @@ TQString Uic::registerObject( const TQString& name )
\sa registerObject(), isObjectRegistered()
*/
-TQString Uic::registeredName( const TQString& name )
+TTQString Uic::registeredName( const TTQString& name )
{
if ( !objectMapper.contains( name ) )
return name;
@@ -1060,24 +1060,24 @@ TQString Uic::registeredName( const TQString& name )
/*!
Returns whether the object \a name was registered yet or not.
*/
-bool Uic::isObjectRegistered( const TQString& name )
+bool Uic::isObjectRegistered( const TTQString& name )
{
return objectMapper.contains( name );
}
/*!
- Unifies the entries in stringlist \a list. Should really be a TQStringList feature.
+ Unifies the entries in stringlist \a list. Should really be a TTQStringList feature.
*/
-TQStringList Uic::unique( const TQStringList& list )
+TTQStringList Uic::unique( const TTQStringList& list )
{
- TQStringList result;
+ TTQStringList result;
if ( list.isEmpty() )
return result;
- TQStringList l = list;
+ TTQStringList l = list;
l.sort();
result += l.first();
- for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
+ for ( TTQStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
if ( *it != result.last() )
result += *it;
}
@@ -1089,7 +1089,7 @@ TQStringList Uic::unique( const TQStringList& list )
/*!
Creates an instance of class \a objClass, with parent \a parent and name \a objName
*/
-TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName )
+TTQString Uic::createObjectInstance( const TTQString& objClass, const TTQString& parent, const TTQString& objName )
{
if ( objClass.mid( 4 ) == "ComboBox" ) {
@@ -1098,7 +1098,7 @@ TQString Uic::createObjectInstance( const TQString& objClass, const TQString& pa
return objClass + ".new(" + parent + ", \"" + objName.mid(1) + "\")";
}
-bool Uic::isLayout( const TQString& name ) const
+bool Uic::isLayout( const TTQString& name ) const
{
return layoutObjects.contains( name );
}
diff --git a/qtruby/rubylib/designer/rbuic/uic.h b/qtruby/rubylib/designer/rbuic/uic.h
index ddfcc1be..18177ee7 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 TQString() {return indstr;}
+ operator TTQString() {return indstr;}
private:
uint tabStop;
uint current;
- TQString indstr;
+ TTQString indstr;
void calc();
};
@@ -51,95 +51,95 @@ private:
class Uic : public Qt
{
public:
- Uic( const TQString &fn, TQTextStream& out, TQDomDocument doc, bool subcl,
- const TQString &trm, const TQString& subclname, bool omitForwardDecls,
- TQString &uicClass, bool useKDE );
+ Uic( const TTQString &fn, TTQTextStream& out, TTQDomDocument doc, bool subcl,
+ const TTQString &trm, const TTQString& subclname, bool omitForwardDecls,
+ TTQString &uicClass, bool useKDE );
static void setIndent(const RubyIndent &rubyind) {indent = rubyind;}
- 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);
+ 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);
static bool hasKDEwidget;
private:
- 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;
+ 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;
bool nofwd;
static RubyIndent indent;
struct Buddy
{
- Buddy( const TQString& k, const TQString& b )
+ Buddy( const TTQString& k, const TTQString& b )
: key( k ), buddy( b ) {}
Buddy(){} // for valuelist
- TQString key;
- TQString buddy;
+ TTQString key;
+ TTQString buddy;
bool operator==( const Buddy& other ) const
{ return (key == other.key); }
};
struct CustomInclude
{
- TQString header;
- TQString location;
+ TTQString header;
+ TTQString location;
};
- TQValueList<Buddy> buddies;
+ TTQValueList<Buddy> buddies;
- TQStringList layoutObjects;
- bool isLayout( const TQString& name ) const;
+ TTQStringList layoutObjects;
+ bool isLayout( const TTQString& name ) const;
uint item_used : 1;
uint cg_used : 1;
@@ -147,35 +147,35 @@ private:
uint stdsetdef : 1;
uint externPixmaps : 1;
- TQString uiFileVersion;
- TQString nameOfClass;
- TQString pixmapLoaderFunction;
+ TTQString uiFileVersion;
+ TTQString nameOfClass;
+ TTQString pixmapLoaderFunction;
- 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;
+ 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;
static bool isMainWindow;
- static TQString mkBool( bool b );
- static TQString mkBool( const TQString& s );
- bool toBool( const TQString& s );
- static TQString fixString( const TQString &str );
+ static TTQString mkBool( bool b );
+ static TTQString mkBool( const TTQString& s );
+ bool toBool( const TTQString& s );
+ static TTQString fixString( const TTQString &str );
static bool onlyAscii;
- static TQString mkStdSet( const TQString& prop );
- static TQString getComment( const TQDomNode& n );
+ static TTQString mkStdSet( const TTQString& prop );
+ static TTQString getComment( const TTQDomNode& n );
int defSpacing, defMargin;
- TQString fileName;
+ TTQString fileName;
bool writeSlotImpl;
- bool isEmptyFunction( const TQString& fname );
- TQMap<TQString, TQString> functionImpls;
+ bool isEmptyFunction( const TTQString& fname );
+ TTQMap<TTQString, TTQString> functionImpls;
- void rubySlot(TQStringList::Iterator &it);
+ void rubySlot(TTQStringList::Iterator &it);
};
#endif
diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp
index 2538d0ae..cc4779a2 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 TQDict<int> *className2Id = 0;
+static TTQDict<int> *className2Id = 0;
static int dbcount = 0;
static int dbcustomcount = 200;
-static TQStrList *wGroups;
-static TQStrList *invisibleGroups;
+static TTQStrList *wGroups;
+static TTQStrList *invisibleGroups;
static bool whatsThisLoaded = false;
-static QPluginManager<WidgetInterface> *widgetPluginManager = 0;
+static TQPluginManager<WidgetInterface> *widgetPluginManager = 0;
static bool plugins_set_up = false;
static bool was_in_setup = false;
-TQCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
+TTQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager;
WidgetDatabaseRecord::WidgetDatabaseRecord()
{
@@ -113,18 +113,18 @@ void WidgetDatabase::setupDataBase( int id )
return;
#endif
- wGroups = new QStrList;
- invisibleGroups = new QStrList;
+ wGroups = new TQStrList;
+ invisibleGroups = new TQStrList;
invisibleGroups->append( "Forms" );
invisibleGroups->append( "Temp" );
- className2Id = new TQDict<int>( dbdictsize );
+ className2Id = new TTQDict<int>( dbdictsize );
className2Id->setAutoDelete( true );
WidgetDatabaseRecord *r = 0;
r = new WidgetDatabaseRecord;
r->iconSet = "pushbutton.xpm";
- r->name = "TQPushButton";
+ r->name = "TTQPushButton";
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 = "TQToolButton";
+ r->name = "TTQToolButton";
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 = "TQRadioButton";
+ r->name = "TTQRadioButton";
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 = "TQCheckBox";
+ r->name = "TTQCheckBox";
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 = "TQGroupBox";
+ r->name = "TTQGroupBox";
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 = "TQButtonGroup";
+ r->name = "TTQButtonGroup";
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 = "TQFrame";
+ r->name = "TTQFrame";
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 = "TQTabWidget";
+ r->name = "TTQTabWidget";
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 = "TQListBox";
+ r->name = "TTQListBox";
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 = "TQListView";
+ r->name = "TTQListView";
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 = "TQIconView";
+ r->name = "TTQIconView";
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 = "TQTable";
+ r->name = "TTQTable";
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 = "TQDataTable";
+ r->name = "TTQDataTable";
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 = "TQLineEdit";
+ r->name = "TTQLineEdit";
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 = "TQSpinBox";
+ r->name = "TTQSpinBox";
r->group = widgetGroup( "Input" );
r->toolTip = "Spin Box";
@@ -256,7 +256,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "dateedit.xpm";
- r->name = "QDateEdit";
+ r->name = "TQDateEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date Edit";
r->includeFile = "tqdatetimeedit.h";
@@ -265,7 +265,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "timeedit.xpm";
- r->name = "QTimeEdit";
+ r->name = "TQTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Time Edit";
r->includeFile = "tqdatetimeedit.h";
@@ -274,7 +274,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "datetimeedit.xpm";
- r->name = "QDateTimeEdit";
+ r->name = "TQDateTimeEdit";
r->group = widgetGroup( "Input" );
r->toolTip = "Date-Time Edit";
r->includeFile = "tqdatetimeedit.h";
@@ -283,7 +283,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "multilineedit.xpm";
- r->name = "TQMultiLineEdit";
+ r->name = "TTQMultiLineEdit";
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 = "TQTextEdit";
+ r->name = "TTQTextEdit";
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 = "TQComboBox";
+ r->name = "TTQComboBox";
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 = "TQSlider";
+ r->name = "TTQSlider";
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 = "TQScrollBar";
+ r->name = "TTQScrollBar";
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 = "TQDial";
+ r->name = "TTQDial";
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 = "TQLabel";
+ r->name = "TTQLabel";
r->group = widgetGroup( "Temp" );
r->toolTip = "Label";
@@ -357,7 +357,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "lcdnumber.xpm";
- r->name = "QLCDNumber";
+ r->name = "TQLCDNumber";
r->group = widgetGroup( "Display" );
r->toolTip = "LCD Number";
@@ -375,7 +375,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "progress.xpm";
- r->name = "TQProgressBar";
+ r->name = "TTQProgressBar";
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 = "TQTextView";
+ r->name = "TTQTextView";
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 = "TQTextBrowser";
+ r->name = "TTQTextBrowser";
r->group = widgetGroup( "Display" );
r->toolTip = "Text Browser";
@@ -407,35 +407,35 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "TQWidget";
+ r->name = "TTQWidget";
r->isForm = true;
r->group = widgetGroup( "Forms" );
append( r );
r = new WidgetDatabaseRecord;
- r->name = "TQDialog";
+ r->name = "TTQDialog";
r->group = widgetGroup( "Forms" );
r->isForm = true;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "TQWizard";
+ r->name = "TTQWizard";
r->group = widgetGroup( "Forms" );
r->isContainer = true;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QDesignerWizard";
+ r->name = "TQDesignerWizard";
r->group = widgetGroup( "Forms" );
r->isContainer = true;
append( r );
r = new WidgetDatabaseRecord;
- r->name = "QLayoutWidget";
+ r->name = "TQLayoutWidget";
r->group = widgetGroup( "Temp" );
r->includeFile = "";
r->isContainer = true;
@@ -443,7 +443,7 @@ void WidgetDatabase::setupDataBase( int id )
append( r );
r = new WidgetDatabaseRecord;
- r->name = "TQSplitter";
+ r->name = "TTQSplitter";
r->group = widgetGroup( "Temp" );
r->includeFile = "tqsplitter.h";
r->isContainer = true;
@@ -452,7 +452,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "tabwidget.xpm";
- r->name = "QDesignerTabWidget";
+ r->name = "TQDesignerTabWidget";
r->group = widgetGroup( "Temp" );
r->isContainer = true;
@@ -460,7 +460,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "tabwidget.xpm";
- r->name = "QDesignerWidget";
+ r->name = "TQDesignerWidget";
r->group = widgetGroup( "Temp" );
r->isContainer = true;
@@ -468,7 +468,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "tabwidget.xpm";
- r->name = "QDesignerDialog";
+ r->name = "TQDesignerDialog";
r->group = widgetGroup( "Temp" );
r->isContainer = true;
@@ -476,7 +476,7 @@ void WidgetDatabase::setupDataBase( int id )
r = new WidgetDatabaseRecord;
r->iconSet = "";
- r->name = "TQMainWindow";
+ r->name = "TTQMainWindow";
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 = "TQDataBrowser";
+ r->name = "TTQDataBrowser";
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 = "TQDataView";
+ r->name = "TTQDataView";
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;
- TQStringList widgets = widgetManager()->featureList();
- for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
+ TTQStringList widgets = widgetManager()->featureList();
+ for ( TTQStringList::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
- TQIconSet icon = iface->iconSet( *it );
+ TTQIconSet icon = iface->iconSet( *it );
if ( !icon.pixmap().isNull() )
- r->icon = new TQIconSet( icon );
+ r->icon = new TTQIconSet( icon );
#endif
- TQString grp = iface->group( *it );
+ TTQString 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.
*/
-TQIconSet WidgetDatabase::iconSet( int id )
+TTQIconSet WidgetDatabase::iconSet( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQIconSet();
+ return TTQIconSet();
#if !defined(UIC) && !defined(RESOURCE)
if ( !r->icon )
- r->icon = new TQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ),
+ r->icon = new TTQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ),
PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) );
return *r->icon;
#else
- return TQIconSet();
+ return TTQIconSet();
#endif
}
@@ -590,12 +590,12 @@ TQIconSet WidgetDatabase::iconSet( int id )
Returns the classname of the widget which is registered as \a id.
*/
-TQString WidgetDatabase::className( int id )
+TTQString WidgetDatabase::className( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQString::null;
+ return TTQString::null;
return r->name;
}
@@ -603,12 +603,12 @@ TQString WidgetDatabase::className( int id )
Returns the group to which the widget registered as \a id belongs.
*/
-TQString WidgetDatabase::group( int id )
+TTQString WidgetDatabase::group( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQString::null;
+ return TTQString::null;
return r->group;
}
@@ -616,12 +616,12 @@ TQString WidgetDatabase::group( int id )
id.
*/
-TQString WidgetDatabase::toolTip( int id )
+TTQString WidgetDatabase::toolTip( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQString::null;
+ return TTQString::null;
return r->toolTip;
}
@@ -629,12 +629,12 @@ TQString WidgetDatabase::toolTip( int id )
as \a id.
*/
-TQString WidgetDatabase::whatsThis( int id )
+TTQString WidgetDatabase::whatsThis( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQString::null;
+ return TTQString::null;
return r->whatsThis;
}
@@ -642,12 +642,12 @@ TQString WidgetDatabase::whatsThis( int id )
Returns the include file if the widget which is registered as \a id.
*/
-TQString WidgetDatabase::includeFile( int id )
+TTQString WidgetDatabase::includeFile( int id )
{
setupDataBase( id );
WidgetDatabaseRecord *r = at( id );
if ( !r )
- return TQString::null;
+ return TTQString::null;
if ( r->includeFile.isNull() )
return r->name.lower() + ".h";
return r->includeFile;
@@ -677,24 +677,24 @@ bool WidgetDatabase::isContainer( int id )
return r->isContainer || r->isForm;
}
-TQString WidgetDatabase::createWidgetName( int id )
+TTQString WidgetDatabase::createWidgetName( int id )
{
setupDataBase( id );
- TQString n = className( id );
- if ( n == "QLayoutWidget" )
+ TTQString n = className( id );
+ if ( n == "TQLayoutWidget" )
n = "Layout";
if ( n[ 0 ] == 'Q' )
n = n.mid( 1 );
WidgetDatabaseRecord *r = at( id );
if ( !r )
return n;
- n += TQString::number( ++r->nameCounter );
+ n += TTQString::number( ++r->nameCounter );
return n;
}
/*! Returns the id for \a name or -1 if \a name is unknown.
*/
-int WidgetDatabase::idFromClassName( const TQString &name )
+int WidgetDatabase::idFromClassName( const TTQString &name )
{
setupDataBase( -1 );
if ( name.isEmpty() )
@@ -703,7 +703,7 @@ int WidgetDatabase::idFromClassName( const TQString &name )
if ( i )
return *i;
if ( name == "FormWindow" )
- return idFromClassName( "QLayoutWidget" );
+ return idFromClassName( "TQLayoutWidget" );
#ifdef UIC
#ifndef NO_UI_PLUGINS
setupDataBase( -2 );
@@ -715,7 +715,7 @@ int WidgetDatabase::idFromClassName( const TQString &name )
return -1;
}
-bool WidgetDatabase::hasWidget( const TQString &name )
+bool WidgetDatabase::hasWidget( const TTQString &name )
{
return className2Id->find( name ) != 0;
}
@@ -738,7 +738,7 @@ void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r )
db[ index ] = r;
className2Id->insert( r->name, new int( index ) );
if ( index < dbcustom )
- dbcount = QMAX( dbcount, index );
+ dbcount = TQMAX( dbcount, index );
}
void WidgetDatabase::append( WidgetDatabaseRecord *r )
@@ -748,14 +748,14 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r )
insert( dbcount++, r );
}
-TQString WidgetDatabase::widgetGroup( const TQString &g )
+TTQString WidgetDatabase::widgetGroup( const TTQString &g )
{
if ( wGroups->find( g ) == -1 )
wGroups->append( g );
return g;
}
-bool WidgetDatabase::isGroupEmpty( const TQString &grp )
+bool WidgetDatabase::isGroupEmpty( const TTQString &grp )
{
WidgetDatabaseRecord *r = 0;
for ( int i = 0; i < dbcount; ++i ) {
@@ -767,12 +767,12 @@ bool WidgetDatabase::isGroupEmpty( const TQString &grp )
return true;
}
-TQString WidgetDatabase::widgetGroup( int i )
+TTQString WidgetDatabase::widgetGroup( int i )
{
setupDataBase( -1 );
if ( i >= 0 && i < (int)wGroups->count() )
return wGroups->at( i );
- return TQString::null;
+ return TTQString::null;
}
int WidgetDatabase::numWidgetGroups()
@@ -781,7 +781,7 @@ int WidgetDatabase::numWidgetGroups()
return wGroups->count();
}
-bool WidgetDatabase::isGroupVisible( const TQString &g )
+bool WidgetDatabase::isGroupVisible( const TTQString &g )
{
setupDataBase( -1 );
return invisibleGroups->find( g ) == -1;
@@ -805,16 +805,16 @@ bool WidgetDatabase::isWhatsThisLoaded()
return whatsThisLoaded;
}
-void WidgetDatabase::loadWhatsThis( const TQString &docPath )
+void WidgetDatabase::loadWhatsThis( const TTQString &docPath )
{
- TQString whatsthisFile = docPath + "/whatsthis";
- TQFile f( whatsthisFile );
+ TTQString whatsthisFile = docPath + "/whatsthis";
+ TTQFile f( whatsthisFile );
if ( !f.open( IO_ReadOnly ) )
return;
- TQTextStream ts( &f );
+ TTQTextStream ts( &f );
while ( !ts.atEnd() ) {
- TQString s = ts.readLine();
- TQStringList l = TQStringList::split( " | ", s );
+ TTQString s = ts.readLine();
+ TTQStringList l = TTQStringList::split( " | ", s );
int id = idFromClassName( l[ 1 ] );
WidgetDatabaseRecord *r = at( id );
if ( r )
@@ -823,10 +823,10 @@ void WidgetDatabase::loadWhatsThis( const TQString &docPath )
whatsThisLoaded = true;
}
-QPluginManager<WidgetInterface> *widgetManager()
+TTQPluginManager<WidgetInterface> *widgetManager()
{
if ( !widgetPluginManager ) {
- widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "/designer" );
+ widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TTQApplication::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 acfe10c2..ebcfc00d 100644
--- a/qtruby/rubylib/designer/rbuic/widgetdatabase.h
+++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.h
@@ -27,16 +27,16 @@
#include <private/qpluginmanager_p.h>
-extern QPluginManager<WidgetInterface> *widgetManager();
+extern TQPluginManager<WidgetInterface> *widgetManager();
struct WidgetDatabaseRecord
{
WidgetDatabaseRecord();
~WidgetDatabaseRecord();
- TQString iconSet, name, group, toolTip, whatsThis, includeFile;
+ TTQString iconSet, name, group, toolTip, whatsThis, includeFile;
uint isContainer : 1;
uint isForm : 1;
- TQIconSet *icon;
+ TTQIconSet *icon;
int nameCounter;
};
@@ -50,35 +50,35 @@ public:
static int count();
static int startCustom();
- 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 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 bool isForm( int id );
static bool isContainer( int id );
- static int idFromClassName( const TQString &name );
- static TQString createWidgetName( int id );
+ static int idFromClassName( const TTQString &name );
+ static TTQString createWidgetName( int id );
static WidgetDatabaseRecord *at( int index );
static void insert( int index, WidgetDatabaseRecord *r );
static void append( WidgetDatabaseRecord *r );
- static TQString widgetGroup( const TQString &g );
- static TQString widgetGroup( int i );
+ static TTQString widgetGroup( const TTQString &g );
+ static TTQString widgetGroup( int i );
static int numWidgetGroups();
- static bool isGroupVisible( const TQString &g );
- static bool isGroupEmpty( const TQString &grp );
+ static bool isGroupVisible( const TTQString &g );
+ static bool isGroupEmpty( const TTQString &grp );
static int addCustomWidget( WidgetDatabaseRecord *r );
static bool isCustomWidget( int id );
static bool isWhatsThisLoaded();
- static void loadWhatsThis( const TQString &docPath );
+ static void loadWhatsThis( const TTQString &docPath );
- static bool hasWidget( const TQString &name );
+ static bool hasWidget( const TTQString &name );
};
diff --git a/qtruby/rubylib/designer/rbuic/widgetinterface.h b/qtruby/rubylib/designer/rbuic/widgetinterface.h
index bf6bcd55..1296f162 100644
--- a/qtruby/rubylib/designer/rbuic/widgetinterface.h
+++ b/qtruby/rubylib/designer/rbuic/widgetinterface.h
@@ -23,7 +23,7 @@
#include <private/qwidgetinterface_p.h>
-#define WidgetInterface QWidgetFactoryInterface
+#define WidgetInterface TQWidgetFactoryInterface
#define IID_Widget IID_QWidgetFactory
#endif