summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/form.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/form.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/form.cpp286
1 files changed, 143 insertions, 143 deletions
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) << "'";
}