summaryrefslogtreecommitdiffstats
path: root/python/pyqt/pyuic3/form.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyqt/pyuic3/form.cpp')
-rw-r--r--python/pyqt/pyuic3/form.cpp290
1 files changed, 145 insertions, 145 deletions
diff --git a/python/pyqt/pyuic3/form.cpp b/python/pyqt/pyuic3/form.cpp
index aedb4ac2..ca68db39 100644
--- a/python/pyqt/pyuic3/form.cpp
+++ b/python/pyqt/pyuic3/form.cpp
@@ -23,10 +23,10 @@
#include "parser.h"
#include "widgetdatabase.h"
#include "domtool.h"
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
#define NO_STATIC_COLORS
#include <globaldefs.h>
@@ -34,7 +34,7 @@
#include <zlib.h>
#endif
-static QByteArray unzipXPM( QString data, ulong& length )
+static TQByteArray unzipXPM( TQString data, ulong& length )
{
#if QT_VERSION >= 0x030100
const int lengthOffset = 4;
@@ -61,7 +61,7 @@ static QByteArray unzipXPM( QString data, ulong& length )
ba[1] = ( length & 0x00ff0000 ) >> 16;
ba[2] = ( length & 0x0000ff00 ) >> 8;
ba[3] = ( length & 0x000000ff );
- QByteArray baunzip = qUncompress( ba, baSize );
+ TQByteArray baunzip = qUncompress( ba, baSize );
delete[] ba;
return baunzip;
#else
@@ -94,7 +94,7 @@ static QByteArray unzipXPM( QString data, ulong& length )
// crashes in some cases of slightly corrupt UIC files.
if ( length < data.length() * 5 )
length = data.length() * 5;
- QByteArray baunzip( length );
+ TQByteArray baunzip( length );
::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 );
delete[] ba;
return baunzip;
@@ -108,27 +108,27 @@ static QByteArray unzipXPM( QString data, ulong& length )
\sa createFormDecl(), createObjectImpl()
*/
-void Uic::createFormImpl( const QDomElement &e )
+void Uic::createFormImpl( const TQDomElement &e )
{
- QDomElement n;
- QDomNodeList nl;
+ TQDomElement n;
+ TQDomNodeList nl;
int i;
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
// generate local and local includes required
- QStringList globalIncludes;
- QStringList::Iterator it;
- QStringList sqlClasses;
- QStringList axwidgets, databrowsers;
+ TQStringList globalIncludes;
+ TQStringList::Iterator it;
+ TQStringList sqlClasses;
+ TQStringList axwidgets, databrowsers;
- QMap<QString, CustomInclude> customWidgetIncludes;
- QMap<QString, QString> functionImpls;
+ TQMap<TQString, CustomInclude> customWidgetIncludes;
+ TQMap<TQString, TQString> functionImpls;
// find additional slots and functions
- QStringList extraSlots;
- QStringList extraSlotTypes;
+ TQStringList extraSlots;
+ TQStringList extraSlotTypes;
nl = e.parentNode().toElement().elementsByTagName( "slot" );
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
@@ -137,7 +137,7 @@ void Uic::createFormImpl( const QDomElement &e )
continue;
if ( n.attribute( "language", "C++" ) != "C++" )
continue;
- QString slotName = n.firstChild().toText().data().stripWhiteSpace();
+ TQString slotName = n.firstChild().toText().data().stripWhiteSpace();
if ( slotName.endsWith( ";" ) )
slotName = slotName.left( slotName.length() - 1 );
@@ -147,9 +147,9 @@ void Uic::createFormImpl( const QDomElement &e )
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "functions" ) { // compatibility
- for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "function" ) {
- QString fname = n2.attribute( "name" );
+ TQString fname = n2.attribute( "name" );
fname = Parser::cleanArgs( fname );
functionImpls.insert( fname, n2.firstChild().toText().data() );
}
@@ -160,11 +160,11 @@ void Uic::createFormImpl( const QDomElement &e )
// additional includes (local or global ) and forward declaractions
nl = e.parentNode().toElement().elementsByTagName( "include" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
+ TQDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" ) {
- if ( s.right( 5 ) == ".ui.h" && !QFile::exists( s ) )
+ if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) )
continue;
if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" )
continue;
@@ -173,32 +173,32 @@ void Uic::createFormImpl( const QDomElement &e )
}
// do the local includes afterwards, since global includes have priority on clashes
- QFileInfo fi(fileName);
+ TQFileInfo fi(fileName);
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) {
if ( s.right( 5 ) != ".ui.h" )
continue;
- if ( !QFile::exists( s ) )
+ if ( !TQFile::exists( s ) )
{
s = fi.dirPath() + "/" + s;
- if ( !QFile::exists( s ) )
+ if ( !TQFile::exists( s ) )
continue;
}
- if ( QFile::exists( s ) )
+ if ( TQFile::exists( s ) )
{
- QFile f(s);
+ TQFile f(s);
f.open(IO_ReadOnly);
- QTextStream headerStream(&f);
- QString line;
- QString functionText;
- QString functionName;
- QRegExp rx("void .*::(.*\\(.*\\))");
+ TQTextStream headerStream(&f);
+ TQString line;
+ TQString functionText;
+ TQString functionName;
+ TQRegExp rx("void .*::(.*\\(.*\\))");
int pos, inFunction = 0;
while (line = headerStream.readLine())
@@ -226,8 +226,8 @@ void Uic::createFormImpl( const QDomElement &e )
// additional custom widget headers
nl = e.parentNode().toElement().elementsByTagName( "header" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QDomElement n2 = nl.item(i).toElement();
- QString s = n2.firstChild().toText().data();
+ TQDomElement n2 = nl.item(i).toElement();
+ TQString s = n2.firstChild().toText().data();
if ( n2.attribute( "location" ) != "local" )
globalIncludes += s;
}
@@ -236,29 +236,29 @@ void Uic::createFormImpl( const QDomElement &e )
for ( it = tags.begin(); it != tags.end(); ++it ) {
nl = e.parentNode().toElement().elementsByTagName( *it );
for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget
- QString name = getClassName( nl.item(i).toElement() );
+ TQString name = getClassName( nl.item(i).toElement() );
if ( name == "Spacer" ) {
- globalIncludes += "qlayout.h";
- globalIncludes += "qapplication.h";
+ globalIncludes += "tqlayout.h";
+ globalIncludes += "tqapplication.h";
continue;
}
if ( name.mid( 1 ) == "ListView" )
- globalIncludes += "qheader.h";
+ globalIncludes += "tqheader.h";
else if ( name == "QAxWidget" )
axwidgets += getObjectName(nl.item(i).toElement());
- else if ( name == "QDataBrowser" )
+ else if ( name == "TQDataBrowser" )
databrowsers += getObjectName(nl.item(i).toElement());
if ( name != objClass ) {
int wid = WidgetDatabase::idFromClassName( name );
- QMap<QString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
+ TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name );
if ( it == customWidgetIncludes.end() )
globalIncludes += WidgetDatabase::includeFile( wid );
}
}
}
- if (globalIncludes.findIndex("qtable.h") >= 0)
- out << indent << "from qttable import QTable" << endl;
+ if (globalIncludes.findIndex("tqtable.h") >= 0)
+ out << indent << "from qttable import TQTable" << endl;
if (!axwidgets.empty())
out << indent << "from qtaxcontainer import QAxWidget" << endl;
@@ -269,9 +269,9 @@ void Uic::createFormImpl( const QDomElement &e )
registerDatabases( e );
dbConnections = unique( dbConnections );
if ( dbConnections.count() )
- sqlClasses += "QSqlDatabase";
+ sqlClasses += "TQSqlDatabase";
if ( dbCursors.count() )
- sqlClasses += "QSqlCursor";
+ sqlClasses += "TQSqlCursor";
bool dbForm = FALSE;
if ( dbForms[ "(default)" ].count() )
dbForm = TRUE;
@@ -285,21 +285,21 @@ void Uic::createFormImpl( const QDomElement &e )
}
}
if ( dbForm || subDbForms ) {
- sqlClasses += "QSqlForm";
- sqlClasses += "QSqlRecord";
+ sqlClasses += "TQSqlForm";
+ sqlClasses += "TQSqlRecord";
}
- if (globalIncludes.findIndex("qdatatable.h") >= 0)
- sqlClasses += "QDataTable";
+ if (globalIncludes.findIndex("tqdatatable.h") >= 0)
+ sqlClasses += "TQDataTable";
if (globalIncludes.findIndex("qtableview.h") >= 0)
sqlClasses += "QTableView";
- if (globalIncludes.findIndex("qdatabrowser.h") >= 0)
- sqlClasses += "QDataBrowser";
+ if (globalIncludes.findIndex("tqdatabrowser.h") >= 0)
+ sqlClasses += "TQDataBrowser";
- if (globalIncludes.findIndex("qdataview.h") >= 0)
- sqlClasses += "QDataView";
+ if (globalIncludes.findIndex("tqdataview.h") >= 0)
+ sqlClasses += "TQDataView";
if ( !sqlClasses.empty() ) {
out << indent << "from qtsql import";
@@ -320,12 +320,12 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
// find out what images are required
- QStringList requiredImages;
+ TQStringList requiredImages;
static const char *imgTags[] = { "pixmap", "iconset", 0 };
for ( i = 0; imgTags[i] != 0; i++ ) {
nl = e.parentNode().toElement().elementsByTagName( imgTags[i] );
for ( int j = 0; j < (int) nl.length(); j++ ) {
- QDomNode nn = nl.item(j);
+ TQDomNode nn = nl.item(j);
while ( nn.parentNode() != e.parentNode() )
nn = nn.parentNode();
if ( nn.nodeName() != "customwidgets" )
@@ -336,26 +336,26 @@ void Uic::createFormImpl( const QDomElement &e )
// register the object and unify its name
objName = registerObject( objName );
- QStringList images;
- QStringList xpmImages;
+ TQStringList images;
+ TQStringList xpmImages;
if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) {
// create images
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "images" ) {
nl = n.elementsByTagName( "image" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
+ TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) );
if ( !requiredImages.contains( img ) )
continue;
- QDomElement tmp = nl.item(i).firstChild().toElement();
+ TQDomElement tmp = nl.item(i).firstChild().toElement();
if ( tmp.tagName() != "data" )
continue;
- QString format = tmp.attribute("format", "PNG" );
- QString data = tmp.firstChild().toText().data();
+ TQString format = tmp.attribute("format", "PNG" );
+ TQString data = tmp.firstChild().toText().data();
if ( format == "XPM.GZ" ) {
xpmImages += img;
ulong length = tmp.attribute("length").toULong();
- QByteArray baunzip = unzipXPM( data, length );
+ TQByteArray baunzip = unzipXPM( data, length );
length = baunzip.size();
// shouldn't we test the initial `length' against the
// resulting `length' to catch corrupt UIC files?
@@ -383,11 +383,11 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "\"";
int a ;
for ( a = 0; a < (int) (data.length()/2)-1; a++ ) {
- out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]);
+ out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]);
if ( a % 12 == 11 )
out << "\" \\" << endl << indent << "\"";
}
- out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]) << "\"" << endl;
+ out << "\\x" << TQString(data[2*a]) << TQString(data[2*a+1]) << "\"" << endl;
--indent;
}
}
@@ -396,16 +396,16 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
} else if ( externPixmaps ) {
#if QT_VERSION >= 0x030100
- pixmapLoaderFunction = "QPixmap.fromMimeSource";
+ pixmapLoaderFunction = "TQPixmap.fromMimeSource";
#else
out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl;
++indent;
- out << indent << "pix = QPixmap()" << endl;
- out << indent << "m = QMimeSourceFactory.defaultFactory().data(name)" << endl;
+ out << indent << "pix = TQPixmap()" << endl;
+ out << indent << "m = TQMimeSourceFactory.defaultFactory().data(name)" << endl;
out << endl;
out << indent << "if m:" << endl;
++indent;
- out << indent << "QImageDrag.decode(m,pix)" << endl;
+ out << indent << "TQImageDrag.decode(m,pix)" << endl;
--indent;
out << endl;
out << indent << "return pix" << endl;
@@ -422,15 +422,15 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl;
++indent;
- if ( objClass == "QDialog" || objClass == "QWizard" ) {
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl;
++indent;
out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl;
- } else if ( objClass == "QWidget" ) {
+ } else if ( objClass == "TQWidget" ) {
out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl;
++indent;
out << indent << objClass << ".__init__(self,parent,name,fl)" << endl;
- } else if ( objClass == "QMainWindow" ) {
+ } else if ( objClass == "TQMainWindow" ) {
out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl;
++indent;
out << indent << objClass << ".__init__(self,parent,name,fl)" << endl;
@@ -446,37 +446,37 @@ void Uic::createFormImpl( const QDomElement &e )
// create pixmaps for all images
if ( !images.isEmpty() ) {
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for ( it = images.begin(); it != images.end(); ++it ) {
- out << indent << "self." << (*it) << " = QPixmap()" << endl;
+ out << indent << "self." << (*it) << " = TQPixmap()" << endl;
out << indent << "self." << (*it) << ".loadFromData(" << (*it) << "_data,\"PNG\")" << endl;
}
}
// create pixmaps for all images
if ( !xpmImages.isEmpty() ) {
for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) {
- out << indent << "self." << (*it) << " = QPixmap(" << (*it) << "_data)" << endl;
+ out << indent << "self." << (*it) << " = TQPixmap(" << (*it) << "_data)" << endl;
}
out << endl;
}
// set the properties
- QSize geometry( 0, 0 );
+ TQSize geometry( 0, 0 );
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute("name");
- QDomElement n2 = n.firstChild().toElement();
- QString value = setObjectProperty( objClass, QString::null, prop, n2, stdset );
+ TQString prop = n.attribute("name");
+ TQDomElement n2 = n.firstChild().toElement();
+ TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset );
if ( value.isEmpty() )
continue;
if ( prop == "geometry" && n2.tagName() == "rect") {
- QDomElement n3 = n2.firstChild().toElement();
+ TQDomElement n3 = n2.firstChild().toElement();
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
geometry.setWidth( n3.firstChild().toText().data().toInt() );
@@ -485,11 +485,11 @@ void Uic::createFormImpl( const QDomElement &e )
n3 = n3.nextSibling().toElement();
}
} else {
- QString call;
+ TQString call;
if ( stdset )
call = "self." + mkStdSet( prop ) + "(" + value + ")";
else
- call = "self.setProperty(\"" + prop + "\",QVariant(" + value + "))";
+ call = "self.setProperty(\"" + prop + "\",TQVariant(" + value + "))";
if ( n2.tagName() == "string" ) {
trout << trindent << call << endl;
@@ -510,15 +510,15 @@ void Uic::createFormImpl( const QDomElement &e )
// create all children, some forms have special requirements
- if ( objClass == "QWizard" ) {
+ if ( objClass == "TQWizard" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, "self" );
- QString comment;
- QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
- out << indent << "self.addPage(" << page << ",QString(\"\"))" << endl;
+ TQString page = createObjectImpl( n, objClass, "self" );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ out << indent << "self.addPage(" << page << ",TQString(\"\"))" << endl;
trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl;
- QVariant def( FALSE, 0 );
+ TQVariant def( FALSE, 0 );
if ( DomTool::hasAttribute( n, "backEnabled" ) )
out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl;
if ( DomTool::hasAttribute( n, "nextEnabled" ) )
@@ -544,20 +544,20 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) {
if ( !(*it).isEmpty() && (*it) != "(default)") {
- out << indent << "self." << (*it) << "Connection = QSqlDatabase.database(\"" <<(*it) << "\")" << endl;
+ out << indent << "self." << (*it) << "Connection = TQSqlDatabase.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();
- QString s = getClassName( n );
- if ( (dbForm || subDbForms) && (s == "QDataBrowser" || s == "QDataView") ) {
- QString objName = getObjectName( n );
- QString tab = getDatabaseInfo( n, "table" );
- QString con = getDatabaseInfo( n, "connection" );
- out << indent << objName << "Form = QSqlForm(self,\"" << objName << "Form\")" << endl;
- QDomElement n2;
+ TQString s = getClassName( n );
+ if ( (dbForm || subDbForms) && (s == "TQDataBrowser" || s == "TQDataView") ) {
+ TQString objName = getObjectName( n );
+ TQString tab = getDatabaseInfo( n, "table" );
+ TQString con = getDatabaseInfo( n, "connection" );
+ out << indent << objName << "Form = TQSqlForm(self,\"" << objName << "Form\")" << endl;
+ TQDomElement n2;
for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() )
createFormImpl( n2, objName, con, tab );
out << indent << "self." << objName << ".setForm(" << objName << "Form)" << endl;
@@ -605,7 +605,7 @@ void Uic::createFormImpl( const QDomElement &e )
// take minimumSizeHint() into account, for height-for-width widgets
if ( !geometry.isNull() ) {
- out << indent << "self.resize(QSize(" << geometry.width() << ","
+ out << indent << "self.resize(TQSize(" << geometry.width() << ","
<< geometry.height() <<").expandedTo(self.minimumSizeHint()))" << endl;
out << indent << "self.clearWState(Qt.WState_Polished)" << endl;
}
@@ -616,8 +616,8 @@ void Uic::createFormImpl( const QDomElement &e )
out << endl;
nl = n.elementsByTagName( "connection" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString sender, receiver, signal, slot;
- for ( QDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
+ TQString sender, receiver, signal, slot;
+ for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
if ( n2.tagName() == "sender" )
sender = n2.firstChild().toText().data();
else if ( n2.tagName() == "receiver" )
@@ -656,17 +656,17 @@ void Uic::createFormImpl( const QDomElement &e )
receiver = "self." + receiver;
out << indent << "self.connect(" << sender
- << ",SIGNAL(\"" << signal << "\")," << receiver;
+ << ",TQT_SIGNAL(\"" << signal << "\")," << receiver;
- // Normally we never use the SLOT() macro in case the
+ // Normally we never use the TQT_SLOT() macro in case the
// connection is to a method of a Python custom widget. The
// exception is if the receiver is a QAxWidget where it must be
// used because the slots are dynamic.
if (isaxwidget)
- out << ",SLOT(\"" << slot << "\")";
+ out << ",TQT_SLOT(\"" << slot << "\")";
else
{
- QString mname = slot.left(slot.find('('));
+ TQString mname = slot.left(slot.find('('));
// Rename slots that have different names in PyQt.
if (isdatabrowser && mname == "del")
@@ -680,11 +680,11 @@ void Uic::createFormImpl( const QDomElement &e )
} else if ( n.tagName() == "tabstops" ) {
// setup tab order
out << endl;
- QString lastName;
- QDomElement n2 = n.firstChild().toElement();
+ TQString lastName;
+ TQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "tabstop" ) {
- QString name = n2.firstChild().toText().data();
+ TQString name = n2.firstChild().toText().data();
name = registeredName( name );
if ( !lastName.isEmpty() )
out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl;
@@ -697,7 +697,7 @@ void Uic::createFormImpl( const QDomElement &e )
// buddies
bool firstBuddy = TRUE;
- for ( QValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
+ for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) {
if ( isObjectRegistered( (*buddy).buddy ) ) {
if ( firstBuddy ) {
out << endl;
@@ -731,13 +731,13 @@ void Uic::createFormImpl( const QDomElement &e )
for ( i = 0; i < (int) nl.length(); i++ ) {
if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() )
needFontEventHandler = TRUE;
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "QDataTable" || s == "QDataBrowser" ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataTable" || s == "TQDataBrowser" ) {
if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) )
continue;
- if ( s == "QDataTable" )
+ if ( s == "TQDataTable" )
needSqlTableEventHandler = TRUE;
- if ( s == "QDataBrowser" )
+ if ( s == "TQDataBrowser" )
needSqlDataBrowserEventHandler = TRUE;
}
if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler )
@@ -749,15 +749,15 @@ void Uic::createFormImpl( const QDomElement &e )
out << " * Main event handler. Reimplemented to handle" << endl;
out << " * application font changes";
out << " */" << endl;
- out << "bool " << nameOfClass << "::event( QEvent* ev )" << endl;
+ out << "bool " << nameOfClass << "::event( TQEvent* ev )" << endl;
out << "{" << endl;
out << " bool ret = " << objClass << "::event( ev ); " << endl;
if ( needFontEventHandler ) {
++indent;
- out << " if ( ev->type() == QEvent::ApplicationFontChange ) {" << endl;
+ out << " if ( ev->type() == TQEvent::ApplicationFontChange ) {" << endl;
for ( i = 0; i < (int) nl.length(); i++ ) {
n = nl.item(i).toElement();
- QStringList list = DomTool::propertiesOfType( n, "font" );
+ TQStringList list = DomTool::propertiesOfType( n, "font" );
for ( it = list.begin(); it != list.end(); ++it )
createExclusiveProperty( n, *it );
}
@@ -779,12 +779,12 @@ void Uic::createFormImpl( const QDomElement &e )
++indent;
if ( needSqlTableEventHandler ) {
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "QDataTable" ) {
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataTable" ) {
n = nl.item(i).toElement();
- QString c = getObjectName( n );
- QString conn = getDatabaseInfo( n, "connection" );
- QString tab = getDatabaseInfo( n, "table" );
+ TQString c = getObjectName( n );
+ TQString conn = getDatabaseInfo( n, "connection" );
+ TQString tab = getDatabaseInfo( n, "table" );
if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) {
out << indent << "if self." << c << ":" << endl;
++indent;
@@ -793,19 +793,19 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "if not cursor:" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl;
+ out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl;
else
- out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl;
+ out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl;
out << indent << "if self." << c << ".isReadOnly():" << endl;
++indent;
- out << indent << "cursor.setMode(QSqlCursor.ReadOnly)" << endl;
+ out << indent << "cursor.setMode(TQSqlCursor.ReadOnly)" << endl;
--indent;
out << indent << "self." << c << ".setSqlCursor(cursor,0,1)" << endl;
--indent;
out << endl;
out << indent << "if not cursor.isActive():" << endl;
++indent;
- out << indent << "self." << c << ".refresh(QDataTable.RefreshAll)" << endl;
+ out << indent << "self." << c << ".refresh(TQDataTable.RefreshAll)" << endl;
--indent;
--indent;
}
@@ -815,12 +815,12 @@ void Uic::createFormImpl( const QDomElement &e )
if ( needSqlDataBrowserEventHandler ) {
nl = e.elementsByTagName( "widget" );
for ( i = 0; i < (int) nl.length(); i++ ) {
- QString s = getClassName( nl.item(i).toElement() );
- if ( s == "QDataBrowser" ) {
- QString obj = getObjectName( nl.item(i).toElement() );
- QString tab = getDatabaseInfo( nl.item(i).toElement(),
+ TQString s = getClassName( nl.item(i).toElement() );
+ if ( s == "TQDataBrowser" ) {
+ TQString obj = getObjectName( nl.item(i).toElement() );
+ TQString tab = getDatabaseInfo( nl.item(i).toElement(),
"table" );
- QString conn = getDatabaseInfo( nl.item(i).toElement(),
+ TQString conn = getDatabaseInfo( nl.item(i).toElement(),
"connection" );
if ( !(tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) {
out << indent << "if self." << obj << ":" << endl;
@@ -828,9 +828,9 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "if not self." << obj << ".sqlCursor():" << endl;
++indent;
if ( conn == "(default)" )
- out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl;
+ out << indent << "cursor = TQSqlCursor(\"" << tab << "\")" << endl;
else
- out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl;
+ out << indent << "cursor = TQSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl;
out << indent << "self." << obj << ".setSqlCursor(cursor,1)" << endl;
out << indent << "self." << obj << ".refresh()" << endl;
out << indent << "self." << obj << ".first()" << endl;
@@ -853,22 +853,22 @@ void Uic::createFormImpl( const QDomElement &e )
// create stubs for additional slots if necessary
if ( !extraSlots.isEmpty() && writeFunctImpl ) {
- QStringList::ConstIterator cit;
+ TQStringList::ConstIterator cit;
for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) {
pySlot(cit);
bool createWarning = TRUE;
- QString fname = Parser::cleanArgs( *cit );
- QMap<QString, QString>::Iterator fit = functionImpls.find( fname );
+ TQString fname = Parser::cleanArgs( *cit );
+ TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname );
if ( fit != functionImpls.end() ) {
int begin = (*fit).find( "{" );
- QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
+ TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 );
createWarning = body.simplifyWhiteSpace().isEmpty();
if ( !createWarning )
{
++indent;
- QString formatted_body = body.replace(QRegExp("\n"), QString("\n") + QString(indent));
+ TQString formatted_body = body.replace(TQRegExp("\n"), TQString("\n") + TQString(indent));
out << formatted_body << endl;
--indent;
}
@@ -895,17 +895,17 @@ void Uic::createFormImpl( const QDomElement &e )
Traverses recursively over all children.
*/
-void Uic::createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table )
+void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table )
{
if ( e.tagName() == "widget" &&
- e.attribute( "class" ) != "QDataTable" ) {
- QString field = getDatabaseInfo( e, "field" );
+ e.attribute( "class" ) != "TQDataTable" ) {
+ TQString field = getDatabaseInfo( e, "field" );
if ( !field.isEmpty() ) {
if ( isWidgetInTable( e, connection, table ) )
out << indent << form << "Form.insert(self." << getObjectName( e ) << "," << fixString( field ) << ")" << endl;
}
}
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
createFormImpl( n, form, connection, table );
}
@@ -914,7 +914,7 @@ void Uic::createFormImpl( const QDomElement& e, const QString& form, const QStri
// Generate a Python slot definition.
-void Uic::pySlot(QStringList::ConstIterator &it)
+void Uic::pySlot(TQStringList::ConstIterator &it)
{
out << endl;
@@ -925,7 +925,7 @@ void Uic::pySlot(QStringList::ConstIterator &it)
// remove the types - too complicated for the moment, so we just count them
// and give them names based on their position.
- QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace();
+ TQString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace();
if (!args.isEmpty()) {
int nrargs = args.contains(',') + 1;