summaryrefslogtreecommitdiffstats
path: root/python/pyqt/pyuic2/uic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyqt/pyuic2/uic.cpp')
-rw-r--r--python/pyqt/pyuic2/uic.cpp520
1 files changed, 260 insertions, 260 deletions
diff --git a/python/pyqt/pyuic2/uic.cpp b/python/pyqt/pyuic2/uic.cpp
index 19fb0794..93c67f6b 100644
--- a/python/pyqt/pyuic2/uic.cpp
+++ b/python/pyqt/pyuic2/uic.cpp
@@ -18,31 +18,31 @@
**********************************************************************/
#include "uic.h"
-#include <qapplication.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqapplication.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <stdio.h>
#include <stdlib.h>
-#include <qstringlist.h>
-#include <qstrlist.h>
-#include <qdatetime.h>
+#include <tqstringlist.h>
+#include <tqstrlist.h>
+#include <tqdatetime.h>
#include <widgetdatabase.h>
#include <domtool.h>
#include <globaldefs.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <zlib.h>
-static QString mkBool( bool b )
+static TQString mkBool( bool b )
{
return b? "1" : "0";
}
-static QString mkBool( const QString& s )
+static TQString mkBool( const TQString& s )
{
return mkBool( s == "true" || s == "1" );
}
-static bool toBool( const QString& s )
+static bool toBool( const TQString& s )
{
return s == "true" || s.toInt() != 0;
}
@@ -50,13 +50,13 @@ static bool toBool( const QString& s )
// fixString is only used in conjunction with tr(). We need to write out the
// string in utf8 and make sure it's converted from utf8 when created.
-static QString fixString( const QString &str )
+static TQString fixString( const TQString &str )
{
- QString s( str );
- s.replace( QRegExp( "\\\\" ), "\\\\" );
- s.replace( QRegExp( "\"" ), "\\\"" );
- s.replace( QRegExp( "\n" ), "\\n\"\n\"" );
- s.replace( QRegExp( "\r" ), "\\r" );
+ TQString s( str );
+ s.replace( TQRegExp( "\\\\" ), "\\\\" );
+ s.replace( TQRegExp( "\"" ), "\\\"" );
+ s.replace( TQRegExp( "\n" ), "\\n\"\n\"" );
+ s.replace( TQRegExp( "\r" ), "\\r" );
bool onlyAscii = TRUE;
unsigned int i;
@@ -69,13 +69,13 @@ static QString fixString( const QString &str )
if ( onlyAscii )
s = "\"" + s + "\"";
else
- s = "QString.fromUtf8(\"" + s + "\")";
+ s = "TQString.fromUtf8(\"" + s + "\")";
return s;
}
-static QString mkStdSet( const QString& prop )
+static TQString mkStdSet( const TQString& prop )
{
- return QString( "set" ) + prop[0].upper() + prop.mid(1);
+ return TQString( "set" ) + prop[0].upper() + prop.mid(1);
}
@@ -86,9 +86,9 @@ static QString mkStdSet( const QString& prop )
The class Uic encapsulates the user interface compiler (uic).
*/
-static QString className;
+static TQString className;
-Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm )
+Uic::Uic( TQTextStream &outStream, TQDomDocument doc, const TQString &trm )
: out( outStream ), trmacro( trm )
{
item_used = cg_used = pal_used = 0;
@@ -101,7 +101,7 @@ Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm )
nameOfClass = getClassName( doc.firstChild().toElement() );
- QDomElement firstWidget = doc.firstChild().firstChild().toElement();
+ TQDomElement firstWidget = doc.firstChild().firstChild().toElement();
while ( firstWidget.tagName() != "widget" )
firstWidget = firstWidget.nextSibling().toElement();
@@ -117,13 +117,13 @@ Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm )
/*! Extracts a class name from \a e
*/
-QString Uic::getClassName( const QDomElement& e )
+TQString Uic::getClassName( const TQDomElement& e )
{
- QDomElement n;
- QString cn;
+ TQDomElement n;
+ TQString cn;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "class" ) {
- QString s = n.firstChild().toText().data();
+ TQString s = n.firstChild().toText().data();
int i;
while ( ( i = s.find(' ' )) != -1 )
s[i] = '_';
@@ -138,35 +138,35 @@ QString Uic::getClassName( const QDomElement& e )
/*! Extracts an object name from \a e. It's stored in the 'name'
property.
*/
-QString Uic::getObjectName( const QDomElement& e )
+TQString Uic::getObjectName( const TQDomElement& e )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" && n2.firstChild().toText().data() == "name" ) {
return n2.nextSibling().toElement().firstChild().toText().data();
}
}
}
- return QString::null;
+ return TQString::null;
}
/*! Extracts an layout name from \a e. It's stored in the 'name'
property of the preceeding sibling (the first child of a QLayoutWidget).
*/
-QString Uic::getLayoutName( const QDomElement& e )
+TQString Uic::getLayoutName( const TQDomElement& e )
{
- QDomElement p = e.parentNode().toElement();
- QString tail = QString::null;
+ TQDomElement p = e.parentNode().toElement();
+ TQString tail = TQString::null;
if (getClassName(p) != "QLayoutWidget")
tail = "Layout";
- QDomElement n;
+ TQDomElement n;
for ( n = p.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" && n2.firstChild().toText().data() == "name" ) {
return n2.nextSibling().toElement().firstChild().toText().data() + tail;
}
@@ -175,7 +175,7 @@ QString Uic::getLayoutName( const QDomElement& e )
return e.tagName();
}
-QByteArray unzipXPM( QString data, ulong& length )
+TQByteArray unzipXPM( TQString data, ulong& length )
{
char *ba = new char[ data.length() / 2 ];
for ( int i = 0; i < (int)data.length() / 2; ++i ) {
@@ -195,7 +195,7 @@ QByteArray unzipXPM( QString data, ulong& length )
}
if ( length < data.length() * 5 )
length = data.length() * 5;
- QByteArray baunzip( length );
+ TQByteArray baunzip( length );
::uncompress( (uchar*) baunzip.data(), &length, (uchar*) ba, data.length()/2 );
return baunzip;
}
@@ -206,16 +206,16 @@ QByteArray unzipXPM( QString data, ulong& length )
\sa createFormDecl(), createObjectImpl()
*/
-void Uic::createFormImpl( const QDomElement &e )
+void Uic::createFormImpl( const TQDomElement &e )
{
- QStringList::Iterator it;
- QDomElement n;
- QDomNodeList nl;
+ TQStringList::Iterator it;
+ 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 );
// Handle custom widgets.
for (n = e; !n.isNull(); n = n.nextSibling().toElement())
@@ -223,14 +223,14 @@ void Uic::createFormImpl( const QDomElement &e )
if (n.tagName() != "customwidgets")
continue;
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
while (!n2.isNull())
{
if (n2.tagName() == "customwidget")
{
- QDomElement n3 = n2.firstChild().toElement();
- QString cname, header;
+ TQDomElement n3 = n2.firstChild().toElement();
+ TQString cname, header;
while (!n3.isNull())
{
@@ -261,27 +261,27 @@ void Uic::createFormImpl( const QDomElement &e )
}
// find out what images are required
- QStringList requiredImages;
+ TQStringList requiredImages;
nl = e.elementsByTagName( "pixmap" );
for ( int j = 0; j < (int) nl.length(); j++ ) {
requiredImages += nl.item(j).firstChild().toText().data();
}
- QStringList images;
- QStringList xpmImages;
+ TQStringList images;
+ TQStringList xpmImages;
if ( pixmapLoaderFunction.isEmpty() ) {
// 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++ ) {
- QDomElement tmp = nl.item(i).firstChild().toElement();
- QString img = registerObject( tmp.firstChild().toText().data() );
+ TQDomElement tmp = nl.item(i).firstChild().toElement();
+ TQString img = registerObject( tmp.firstChild().toText().data() );
if ( !requiredImages.contains( img ) )
continue;
tmp = tmp.nextSibling().toElement();
- QString format = tmp.attribute("format", "PNG" );
- QString data = tmp.firstChild().toText().data();
+ TQString format = tmp.attribute("format", "PNG" );
+ TQString data = tmp.firstChild().toText().data();
out << endl;
out << endl;
@@ -289,7 +289,7 @@ void Uic::createFormImpl( const QDomElement &e )
if ( format == "XPM.GZ" ) {
xpmImages += img;
ulong length = tmp.attribute("length").toULong();
- QByteArray baunzip = unzipXPM( data, length );
+ TQByteArray baunzip = unzipXPM( data, length );
int a = 0;
out << indent << img << "_data = [" << endl;
while ( baunzip[a] != '\"' )
@@ -316,11 +316,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;
popIndent();
}
}
@@ -339,11 +339,11 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl;
pushIndent();
- if ( objClass == "QDialog" || objClass == "QWizard" ) {
+ if ( objClass == "TQDialog" || objClass == "TQWizard" ) {
out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl;
pushIndent();
out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl;
- } else if ( objClass == "QWidget" ) { // standard QWidget
+ } else if ( objClass == "TQWidget" ) { // standard QWidget
out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl;
pushIndent();
out << indent << objClass << ".__init__(self,parent,name,fl)" << endl;
@@ -357,9 +357,9 @@ void Uic::createFormImpl( const QDomElement &e )
// create pixmaps for all images
if ( !images.isEmpty() ) {
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for ( it = images.begin(); it != images.end(); ++it ) {
- out << indent << (*it) << " = QPixmap()" << endl;
+ out << indent << (*it) << " = TQPixmap()" << endl;
out << indent << (*it) << ".loadFromData(" << (*it) << "_data,'PNG')" << endl;
}
@@ -368,7 +368,7 @@ void Uic::createFormImpl( const QDomElement &e )
// create pixmaps for all images
if ( !xpmImages.isEmpty() ) {
for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) {
- out << indent << (*it) << " = QPixmap(" << (*it) << "_data)" << endl;
+ out << indent << (*it) << " = TQPixmap(" << (*it) << "_data)" << endl;
}
out << endl;
@@ -379,11 +379,11 @@ void Uic::createFormImpl( const QDomElement &e )
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
bool stdset = toBool( n.attribute( "stdset" ) );
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString prop = n2.firstChild().toText().data();
- QString value = setObjectProperty( objClass, QString::null, prop, n2.nextSibling().toElement(), stdset );
+ TQString prop = n2.firstChild().toText().data();
+ TQString value = setObjectProperty( objClass, TQString::null, prop, n2.nextSibling().toElement(), stdset );
if ( value.isEmpty() )
continue;
@@ -396,7 +396,7 @@ void Uic::createFormImpl( const QDomElement &e )
out << indent;
if ( prop == "geometry" && n2.nextSibling().toElement().tagName() == "rect") {
- QDomElement n3 = n2.nextSibling().toElement().firstChild().toElement();
+ TQDomElement n3 = n2.nextSibling().toElement().firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
@@ -412,7 +412,7 @@ void Uic::createFormImpl( const QDomElement &e )
if ( stdset )
out << "self." << mkStdSet(prop) << "(" << value << ")" << endl;
else
- out << "self.setProperty('" << prop << "',QVariant(" << value << "))" << endl;
+ out << "self.setProperty('" << prop << "',TQVariant(" << value << "))" << endl;
}
if (prop == "name") {
@@ -426,13 +426,13 @@ 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 label = DomTool::readAttribute( n, "title", "" ).toString();
+ TQString page = createObjectImpl( n, objClass, "self" );
+ TQString label = DomTool::readAttribute( n, "title", "" ).toString();
out << indent << "self.addPage(" << page << ","<< trmacro << "(" << fixString( label ) << "))" << 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" ) )
@@ -454,11 +454,11 @@ void Uic::createFormImpl( const QDomElement &e )
// Get the list of any user defined slots.
- QStringList userSlots;
+ TQStringList userSlots;
for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "connections" ) {
- 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() == "slot" ) {
userSlots += n2.firstChild().toText().data();
}
@@ -472,8 +472,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" )
@@ -499,20 +499,20 @@ void Uic::createFormImpl( const QDomElement &e )
else
receiver = "self." + receiver;
- // Note that we never use the SLOT() macro in case we have
+ // Note that we never use the TQT_SLOT() macro in case we have
// custom widgets implemented in Python.
out << indent << "self.connect(" << sender
- << ",SIGNAL('" << signal << "'),self."
+ << ",TQT_SIGNAL('" << signal << "'),self."
<< slot.left(slot.find('(')) << ")" << endl;
}
} else if ( n.tagName() == "tabstops" ) {
// setup tab order
out << endl;
- QString lastName;
- QDomElement n2 = n.firstChild().toElement();
+ TQString lastName;
+ TQDomElement n2 = n.firstChild().toElement();
while ( !n2.isNull() ) {
if ( n2.tagName() == "tabstop" ) {
- QString name = n2.firstChild().toText().data();
+ TQString name = n2.firstChild().toText().data();
name = registeredName( name );
if ( !lastName.isEmpty() )
out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl;
@@ -526,7 +526,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;
@@ -555,7 +555,7 @@ void Uic::createFormImpl( const QDomElement &e )
pushIndent();
out << indent << "ret = " << objClass << ".event(self,ev)" << endl;
out << endl;
- out << indent << "if ev.type() == QEvent.ApplicationFontChange:" << endl;
+ out << indent << "if ev.type() == TQEvent.ApplicationFontChange:" << endl;
pushIndent();
for ( i = 0; i < (int) nl.length(); i++ ) {
@@ -583,7 +583,7 @@ void Uic::createFormImpl( const QDomElement &e )
// to 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;
@@ -611,11 +611,11 @@ void Uic::createFormImpl( const QDomElement &e )
\sa createObjectDecl()
*/
-QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout )
+TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout )
{
- QDomElement n;
- QString objClass, objName, fullObjName;
+ TQDomElement n;
+ TQString objClass, objName, fullObjName;
if ( layouts.contains( e.tagName() ) )
return createLayoutImpl( e, parentClass, parent, layout );
@@ -625,7 +625,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return objName;
objName = getObjectName( e );
- QString definedName = objName;
+ TQString definedName = objName;
bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
@@ -636,17 +636,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
bool isLine = objClass == "Line";
if ( isLine )
- objClass = "QFrame";
+ objClass = "TQFrame";
out << endl;
if ( objClass == "QLayoutWidget" ) {
if ( layout.isEmpty() ) {
// register the object and unify its name
objName = registerObject( objName );
- out << indent << objName << " = QWidget(" << parent << ",'" << definedName << "')" << endl;
+ out << indent << objName << " = TQWidget(" << parent << ",'" << definedName << "')" << endl;
} else {
// the layout widget is not necessary, hide it by creating its child in the parent
- QString result;
+ TQString result;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if (tags.contains( n.tagName() ) )
result = createObjectImpl( n, parentClass, parent, layout );
@@ -671,11 +671,11 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
bool stdset = toBool( n.attribute( "stdset" ) );
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString prop = n2.firstChild().toText().data();
- QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset );
+ TQString prop = n2.firstChild().toText().data();
+ TQString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset );
if ( value.isEmpty() )
continue;
@@ -688,12 +688,12 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( isLine && prop == "orientation" ) {
prop = "frameStyle";
if ( value.right(10) == "Horizontal" )
- value = "QFrame.HLine | QFrame.Sunken";
+ value = "TQFrame.HLine | TQFrame.Sunken";
else
- value = "QFrame.VLine | QFrame.Sunken";
+ value = "TQFrame.VLine | TQFrame.Sunken";
}
if ( prop == "buttonGroupId" ) {
- if ( parentClass == "QButtonGroup" )
+ if ( parentClass == "TQButtonGroup" )
out << indent << parent << ".insert(" << fullObjName << "," << value << ")" << endl;
continue;
}
@@ -703,31 +703,31 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( stdset )
out << indent << fullObjName << "." << mkStdSet(prop) << "(" << value << ")" << endl;
else
- out << indent << fullObjName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl;
+ out << indent << fullObjName << ".setProperty('" << prop << "',TQVariant(" << value << "))" << endl;
}
}
} else if ( n.tagName() == "item" ) {
if ( objClass.mid(1) == "ListBox" ) {
- QString s = createListBoxItemImpl( n, fullObjName );
+ TQString s = createListBoxItemImpl( n, fullObjName );
if ( !s.isEmpty() )
out << indent << s << endl;
} else if ( objClass.mid(1) == "ComboBox" ) {
- QString s = createListBoxItemImpl( n, fullObjName );
+ TQString s = createListBoxItemImpl( n, fullObjName );
if ( !s.isEmpty() )
out << indent << s << endl;
} else if ( objClass.mid(1) == "IconView" ) {
- QString s = createIconViewItemImpl( n, fullObjName );
+ TQString s = createIconViewItemImpl( n, fullObjName );
if ( !s.isEmpty() )
out << indent << s << endl;
} else if ( objClass.mid(1) == "ListView" ) {
- QString s = createListViewItemImpl( n, fullObjName, QString::null );
+ TQString s = createListViewItemImpl( n, fullObjName, TQString::null );
if ( !s.isEmpty() )
out << s << endl;
}
} else if ( n.tagName() == "column" ) {
if ( objClass.mid(1) == "ListView" ) {
- QString s = createListViewColumnImpl( n, fullObjName );
+ TQString s = createListViewColumnImpl( n, fullObjName );
if ( !s.isEmpty() )
out << s;
}
@@ -736,11 +736,11 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
// create all children, some widgets have special requirements
- if ( objClass == "QTabWidget" ) {
+ if ( objClass == "TQTabWidget" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, fullObjName );
- QString label = DomTool::readAttribute( n, "title", "" ).toString();
+ TQString page = createObjectImpl( n, objClass, fullObjName );
+ TQString label = DomTool::readAttribute( n, "title", "" ).toString();
out << indent << fullObjName << ".insertTab(" << page << "," << trmacro << "(" << fixString( label ) << "))" << endl;
}
}
@@ -758,17 +758,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
Creates implementation of an listbox item tag.
*/
-QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent )
+TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString attrib = n2.firstChild().toText().data();
- QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() );
+ TQString attrib = n2.firstChild().toText().data();
+ TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() );
if ( attrib == "text" )
txt = v.toString();
else if ( attrib == "pixmap" ) {
@@ -792,17 +792,17 @@ QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent
Creates implementation of an iconview item tag.
*/
-QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent )
+TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString pix;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString attrib = n2.firstChild().toText().data();
- QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() );
+ TQString attrib = n2.firstChild().toText().data();
+ TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() );
if ( attrib == "text" )
txt = v.toString();
else if ( attrib == "pixmap" ) {
@@ -818,8 +818,8 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent
}
if ( pix.isEmpty() )
- return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + "))";
- return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + ")," + pix + ")";
+ return "TQIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + "))";
+ return "TQIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + ")," + pix + ")";
}
@@ -827,15 +827,15 @@ QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent
Creates implementation of an listview item tag.
*/
-QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent,
- const QString &parentItem )
+TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent,
+ const TQString &parentItem )
{
- QString s;
+ TQString s;
- QDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
bool hasChildren = e.elementsByTagName( "item" ).count() > 0;
- QString item;
+ TQString item;
if ( hasChildren ) {
item = registerObject( "item" );
@@ -850,22 +850,22 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
}
if ( !parentItem.isEmpty() )
- s += "QListViewItem(" + parentItem + "," + lastItem + ")\n";
+ s += "TQListViewItem(" + parentItem + "," + lastItem + ")\n";
else
- s += "QListViewItem(" + parent + "," + lastItem + ")\n";
+ s += "TQListViewItem(" + parent + "," + lastItem + ")\n";
- QStringList textes;
- QStringList pixmaps;
+ TQStringList textes;
+ TQStringList pixmaps;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString attrib = n2.firstChild().toText().data();
- QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() );
+ TQString attrib = n2.firstChild().toText().data();
+ TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() );
if ( attrib == "text" )
textes << v.toString();
else if ( attrib == "pixmap" ) {
- QString pix = v.toString();
+ TQString pix = v.toString();
if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) {
pix.prepend( pixmapLoaderFunction + "( " );
pix.append( " )" );
@@ -882,9 +882,9 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
for ( int i = 0; i < (int)textes.count(); ++i ) {
if ( !textes[ i ].isEmpty() )
- s += indent + item + ".setText(" + QString::number( i ) + "," + trmacro + "(" + fixString( textes[ i ] ) + "))\n";
+ s += indent + item + ".setText(" + TQString::number( i ) + "," + trmacro + "(" + fixString( textes[ i ] ) + "))\n";
if ( !pixmaps[ i ].isEmpty() )
- s += indent + item + ".setPixmap(" + QString::number( i ) + "," + pixmaps[ i ] + ")\n";
+ s += indent + item + ".setPixmap(" + TQString::number( i ) + "," + pixmaps[ i ] + ")\n";
}
lastItem = item;
@@ -895,18 +895,18 @@ QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent
Creates implementation of an listview column tag.
*/
-QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &parent )
+TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent )
{
- QDomElement n = e.firstChild().toElement();
- QString txt;
- QString pix;
+ TQDomElement n = e.firstChild().toElement();
+ TQString txt;
+ TQString pix;
bool clickable = FALSE, resizeable = FALSE;
while ( !n.isNull() ) {
if ( n.tagName() == "property" ) {
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString attrib = n2.firstChild().toText().data();
- QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() );
+ TQString attrib = n2.firstChild().toText().data();
+ TQVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), TQVariant() );
if ( attrib == "text" )
txt = v.toString();
else if ( attrib == "pixmap" ) {
@@ -924,7 +924,7 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare
n = n.nextSibling().toElement();
}
- QString s;
+ TQString s;
s = indent + parent + ".addColumn(" + trmacro + "(" + fixString( txt ) + "))\n";
if ( !pix.isEmpty() )
s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1," + pix + "," + trmacro + "(" + fixString( txt ) + "))\n";
@@ -939,17 +939,17 @@ QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &pare
/*!
Creates the implementation of a layout tag. Called from createObjectImpl().
*/
-QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout )
+TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout )
{
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
objClass = e.tagName();
- QString qlayout = "QVBoxLayout";
+ TQString qlayout = "TQVBoxLayout";
if ( objClass == "hbox" )
- qlayout = "QHBoxLayout";
+ qlayout = "TQHBoxLayout";
else if ( objClass == "grid" )
- qlayout = "QGridLayout";
+ qlayout = "TQGridLayout";
bool isGrid = e.tagName() == "grid" ;
objName = registerObject( getLayoutName( e ) );
@@ -957,7 +957,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
int margin = DomTool::readProperty( e, "margin", BOXLAYOUT_DEFAULT_MARGIN ).toInt();
int spacing = DomTool::readProperty( e, "spacing", BOXLAYOUT_DEFAULT_SPACING ).toInt();
- if ( (parentClass == "QGroupBox" || parentClass == "QButtonGroup") && layout.isEmpty() ) {
+ if ( (parentClass == "TQGroupBox" || parentClass == "TQButtonGroup") && layout.isEmpty() ) {
// special case for group box
out << indent << parent << ".setColumnLayout(0,Qt.Vertical)" << endl;
out << indent << parent << ".layout().setSpacing(0)" << endl;
@@ -977,10 +977,10 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
if ( !isGrid ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "spacer" ) {
- QString child = createSpacerImpl( n, parentClass, parent, objName );
+ TQString child = createSpacerImpl( n, parentClass, parent, objName );
out << indent << objName << ".addItem(" << child << ")" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- QString child = createObjectImpl( n, parentClass, parent, objName );
+ TQString child = createObjectImpl( n, parentClass, parent, objName );
if ( isLayout( child ) )
out << indent << objName << ".addLayout(" << child << ")" << endl;
else
@@ -989,7 +989,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
}
} else {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
- QDomElement ae = n;
+ TQDomElement ae = n;
int row = ae.attribute( "row" ).toInt();
int col = ae.attribute( "column" ).toInt();
int rowspan = ae.attribute( "rowspan" ).toInt();
@@ -999,7 +999,7 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
if ( colspan < 1 )
colspan = 1;
if ( n.tagName() == "spacer" ) {
- QString child = createSpacerImpl( n, parentClass, parent, objName );
+ TQString child = createSpacerImpl( n, parentClass, parent, objName );
if ( rowspan * colspan != 1 )
out << indent << objName << ".addMultiCell(" << child << ","
<< row << "," << row + rowspan - 1 << "," << col << ","
@@ -1008,9 +1008,9 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
out << indent << objName << ".addItem(" << child << ","
<< row << "," << col << ")" << endl;
} else if ( tags.contains( n.tagName() ) ) {
- QString child = createObjectImpl( n, parentClass, parent, objName );
+ TQString child = createObjectImpl( n, parentClass, parent, objName );
out << endl;
- QString o = "Widget";
+ TQString o = "Widget";
if ( isLayout( child ) )
o = "Layout";
if ( rowspan * colspan != 1 )
@@ -1028,31 +1028,31 @@ QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass,
-QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/)
+TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/)
{
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
objClass = e.tagName();
objName = registerObject( "spacer" );
- QSize size = DomTool::readProperty( e, "sizeHint", QSize(0,0) ).toSize();
- QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
+ TQSize size = DomTool::readProperty( e, "sizeHint", TQSize(0,0) ).toSize();
+ TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical";
if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" &&
DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2
- QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect();
+ TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect();
size = geom.size();
}
if ( isVspacer )
- out << indent << objName << " = QSpacerItem("
+ out << indent << objName << " = TQSpacerItem("
<< size.width() << "," << size.height()
- << ",QSizePolicy.Minimum,QSizePolicy." << sizeType << ")" << endl;
+ << ",TQSizePolicy.Minimum,TQSizePolicy." << sizeType << ")" << endl;
else
- out << indent << objName << " = QSpacerItem("
+ out << indent << objName << " = TQSpacerItem("
<< size.width() << "," << size.height()
- << ",QSizePolicy." << sizeType << ",QSizePolicy.Minimum)" << endl;
+ << ",TQSizePolicy." << sizeType << ",TQSizePolicy.Minimum)" << endl;
return objName;
}
@@ -1067,27 +1067,27 @@ QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClas
application font or palette change handlers in createFormImpl().
*/
-void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp )
+void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp )
{
- QDomElement n;
- QString objClass = getClassName( e );
+ TQDomElement n;
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objClass.isEmpty() )
return;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" ) {
bool stdset = toBool( n.attribute( "stdset" ) );
- QDomElement n2 = n.firstChild().toElement();
+ TQDomElement n2 = n.firstChild().toElement();
if ( n2.tagName() == "name" ) {
- QString prop = n2.firstChild().toText().data();
+ TQString prop = n2.firstChild().toText().data();
if ( prop != exclusiveProp )
continue;
- QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset );
+ TQString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset );
if ( value.isEmpty() )
continue;
- out << indent << objName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl;
+ out << indent << objName << ".setProperty('" << prop << "',TQVariant(" << value << "))" << endl;
}
}
}
@@ -1105,11 +1105,11 @@ const char* const ColorRole[] = {
/*!
Attention: this function has to be in sync with Resource::setWidgetProperty(). If you change one, change both.
*/
-QString Uic::setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset )
+TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset )
{
- QString v;
+ TQString v;
if ( e.tagName() == "rect" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -1122,11 +1122,11 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QRect(%1,%2,%3,%4)";
+ v = "TQRect(%1,%2,%3,%4)";
v = v.arg(x).arg(y).arg(w).arg(h);
} else if ( e.tagName() == "point" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -1135,10 +1135,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QPoint(%1,%2)";
+ v = "TQPoint(%1,%2)";
v = v.arg(x).arg(y);
} else if ( e.tagName() == "size" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -1147,10 +1147,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QSize(%1,%2)";
+ v = "TQSize(%1,%2)";
v = v.arg(w).arg(h);
} else if ( e.tagName() == "color" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int r= 0, g = 0, b = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "red" )
@@ -1161,16 +1161,16 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
b = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QColor(%1,%2,%3)";
+ v = "TQColor(%1,%2,%3)";
v = v.arg(r).arg(g).arg(b);
} else if ( e.tagName() == "font" ) {
- QDomElement n3 = e.firstChild().toElement();
- QString fontname = "f";
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString fontname = "f";
if ( !obj.isEmpty() ) {
fontname = obj + "_font";
- out << indent << fontname << " = QFont(self." << obj << ".font())" << endl;
+ out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl;
} else {
- out << indent << fontname << " = QFont(self.font())" << endl;
+ out << indent << fontname << " = TQFont(self.font())" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -1199,14 +1199,14 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
} else if ( e.tagName() == "string" ) {
if ( prop == "toolTip" ) {
if ( !obj.isEmpty() )
- out << indent << "QToolTip.add(self." << obj << "," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
+ out << indent << "TQToolTip.add(self." << obj << "," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
else
- out << indent << "QToolTip.add(self," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
+ out << indent << "TQToolTip.add(self," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
} else if ( prop == "whatsThis" ) {
if ( !obj.isEmpty() )
- out << indent << "QWhatsThis.add(self." << obj << "," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
+ out << indent << "TQWhatsThis.add(self." << obj << "," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
else
- out << indent << "QWhatsThis.add(self," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
+ out << indent << "TQWhatsThis.add(self," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl;
} else {
v = trmacro + "(%1)";
v = v.arg( fixString( e.firstChild().toText().data() ) );
@@ -1230,51 +1230,51 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v.append( " )" );
}
} else if ( e.tagName() == "iconset" ) {
- v = "QIconSet(%1)";
+ v = "TQIconSet(%1)";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "image" ) {
v = e.firstChild().toText().data() + ".convertToImage()";
} else if ( e.tagName() == "enum" ) {
v = "%1.%2";
- QString oc = objClass;
- QString ev = e.firstChild().toText().data();
- if ( oc == "QListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual of WithMode enum in 3.0
- oc = "QScrollView";
+ TQString oc = objClass;
+ TQString ev = e.firstChild().toText().data();
+ if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0
+ oc = "TQScrollView";
v = v.arg( oc ).arg( ev );
} else if ( e.tagName() == "set" ) {
- QString keys( e.firstChild().toText().data() );
- QStringList lst = QStringList::split( '|', keys );
+ TQString keys( e.firstChild().toText().data() );
+ TQStringList lst = TQStringList::split( '|', keys );
v = "";
- for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
v += objClass + "." + *it;
if ( it != lst.fromLast() )
v += " | ";
}
} else if ( e.tagName() == "sizepolicy" ) {
- QDomElement n3 = e.firstChild().toElement();
- QSizePolicy sp;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- QString tmp;
+ TQString tmp;
if ( !obj.isEmpty() )
tmp = "self." + obj;
else
tmp = "self";
- v = "QSizePolicy(%1,%2," + tmp + ".sizePolicy().hasHeightForWidth())";
+ v = "TQSizePolicy(%1,%2," + tmp + ".sizePolicy().hasHeightForWidth())";
v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() );
} else if ( e.tagName() == "palette" ) {
- QPalette pal;
+ TQPalette pal;
bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0;
- QDomElement n;
+ TQDomElement n;
if ( no_pixmaps ) {
n = e.firstChild().toElement();
while ( !n.isNull() ) {
- QColorGroup cg;
+ TQColorGroup cg;
if ( n.tagName() == "active" ) {
cg = loadColorGroup( n );
pal.setActive( cg );
@@ -1288,19 +1288,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
n = n.nextSibling().toElement();
}
}
- if ( no_pixmaps && pal == QPalette( pal.active().button(), pal.active().background() ) ) {
- v = "QPalette(QColor(%1,%2,%3),QColor(%1,%2,%3))";
+ if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
+ v = "TQPalette(TQColor(%1,%2,%3),TQColor(%1,%2,%3))";
v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() );
v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() );
} else {
- QString palette = "pal";
+ TQString palette = "pal";
if ( !pal_used ) {
- out << indent << palette << " = QPalette()" << endl;
+ out << indent << palette << " = TQPalette()" << endl;
pal_used = TRUE;
}
- QString cg = "cg";
+ TQString cg = "cg";
if ( !cg_used ) {
- out << indent << cg << " = QColorGroup()" << endl;
+ out << indent << cg << " = TQColorGroup()" << endl;
cg_used = TRUE;
}
n = e.firstChild().toElement();
@@ -1323,7 +1323,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = palette;
}
} else if ( e.tagName() == "cursor" ) {
- v = "QCursor(%1)";
+ v = "TQCursor(%1)";
v = v.arg( e.firstChild().toText().data() );
}
return v;
@@ -1334,33 +1334,33 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
/*!
Creates a colorgroup with name \a name from the color group \a cg
*/
-void Uic::createColorGroupImpl( const QString& name, const QDomElement& e )
+void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e )
{
- QColorGroup cg;
+ TQColorGroup cg;
int r = -1;
- QDomElement n = e.firstChild().toElement();
- QString color;
+ TQDomElement n = e.firstChild().toElement();
+ TQString color;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- QColor col = DomTool::readColor( n );
- color = "QColor(%1,%2,%3)";
+ TQColor col = DomTool::readColor( n );
+ color = "TQColor(%1,%2,%3)";
color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() );
if ( col == white )
color = "Qt.white";
else if ( col == black )
color = "Qt.black";
if ( n.nextSibling().toElement().tagName() != "pixmap" ) {
- out << indent << name << ".setColor(QColorGroup." << ColorRole[r] << "," << color << ")" << endl;
+ out << indent << name << ".setColor(TQColorGroup." << ColorRole[r] << "," << color << ")" << endl;
}
} else if ( n.tagName() == "pixmap" ) {
- QString pixmap = n.firstChild().toText().data();
+ TQString pixmap = n.firstChild().toText().data();
if ( !pixmapLoaderFunction.isEmpty() ) {
pixmap.prepend( pixmapLoaderFunction + "(" );
pixmap.append( ")" );
}
- out << indent << name << ".setBrush(QColorGroup."
- << ColorRole[r] << ",QBrush(" << color << "," << pixmap << "))" << endl;
+ out << indent << name << ".setBrush(TQColorGroup."
+ << ColorRole[r] << ",TQBrush(" << color << "," << pixmap << "))" << endl;
}
n = n.nextSibling().toElement();
}
@@ -1370,16 +1370,16 @@ void Uic::createColorGroupImpl( const QString& name, const QDomElement& e )
Auxiliary function to load a color group. The colorgroup must not
contain pixmaps.
*/
-QColorGroup Uic::loadColorGroup( const QDomElement &e )
+TQColorGroup Uic::loadColorGroup( const TQDomElement &e )
{
- QColorGroup cg;
+ TQColorGroup cg;
int r = -1;
- QDomElement n = e.firstChild().toElement();
- QColor col;
+ TQDomElement n = e.firstChild().toElement();
+ TQColor col;
while ( !n.isNull() ) {
if ( n.tagName() == "color" ) {
r++;
- cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
}
n = n.nextSibling().toElement();
}
@@ -1396,7 +1396,7 @@ QColorGroup Uic::loadColorGroup( const QDomElement &e )
\sa registeredName(), isObjectRegistered()
*/
-QString Uic::registerObject( const QString& name )
+TQString Uic::registerObject( const TQString& name )
{
if ( objectNames.isEmpty() ) {
// some temporary variables we need
@@ -1406,7 +1406,7 @@ QString Uic::registerObject( const QString& name )
objectNames += "pal";
}
- QString result = name;
+ TQString result = name;
int i;
while ( ( i = result.find(' ' )) != -1 ) {
result[i] = '_';
@@ -1414,10 +1414,10 @@ QString Uic::registerObject( const QString& name )
if ( objectNames.contains( result ) ) {
int i = 2;
- while ( objectNames.contains( result + "_" + QString::number(i) ) )
+ while ( objectNames.contains( result + "_" + TQString::number(i) ) )
i++;
result += "_";
- result += QString::number(i);
+ result += TQString::number(i);
}
objectNames += result;
objectMapper.insert( name, result );
@@ -1430,7 +1430,7 @@ QString Uic::registerObject( const QString& name )
\sa registerObject(), isObjectRegistered()
*/
-QString Uic::registeredName( const QString& name )
+TQString Uic::registeredName( const TQString& name )
{
if ( !objectMapper.contains( name ) )
return name;
@@ -1440,24 +1440,24 @@ QString Uic::registeredName( const QString& name )
/*!
Returns whether the object \a name was registered yet or not.
*/
-bool Uic::isObjectRegistered( const QString& name )
+bool Uic::isObjectRegistered( const TQString& name )
{
return objectMapper.contains( name );
}
/*!
- Unifies the entries in stringlist \a list. Should really be a QStringList feature.
+ Unifies the entries in stringlist \a list. Should really be a TQStringList feature.
*/
-QStringList Uic::unique( const QStringList& list )
+TQStringList Uic::unique( const TQStringList& list )
{
- QStringList result;
+ TQStringList result;
if (list.isEmpty() )
return result;
- QStringList l = list;
+ TQStringList l = list;
l.sort();
result += l.first();
- for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
+ for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
if ( *it != result.last() )
result += *it;
}
@@ -1469,7 +1469,7 @@ QStringList Uic::unique( const QStringList& list )
/*!
Creates an instance of class \a objClass, with parent \a parent and name \a objName
*/
-QString Uic::createObjectInstance( const QString& objClass, const QString& parent, const QString& objName )
+TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName )
{
if ( objClass.mid(1) == "ComboBox" ) {
@@ -1478,7 +1478,7 @@ QString Uic::createObjectInstance( const QString& objClass, const QString& paren
return objClass + "(" + parent + ",'" + objName + "')";
}
-bool Uic::isLayout( const QString& name ) const
+bool Uic::isLayout( const TQString& name ) const
{
return layoutObjects.contains( name );
}
@@ -1487,22 +1487,22 @@ bool Uic::isLayout( const QString& name ) const
#if defined(BLACKADDER)
#include "ba.h"
-int BA::compilePython(const QString &fileName,const QString &outputFile,
- const QString &trmacro,bool execCode)
+int BA::compilePython(const TQString &fileName,const TQString &outputFile,
+ const TQString &trmacro,bool execCode)
{
#else
int main( int argc, char * argv[] )
{
const char *error = 0;
- QString fileName;
- QString outputFile;
- QString trmacro;
+ TQString fileName;
+ TQString outputFile;
+ TQString trmacro;
bool execCode = FALSE;
for ( int n = 1; n < argc && error == 0; n++ ) {
- QCString arg = argv[n];
+ TQCString arg = argv[n];
if ( arg[0] == '-' ) { // option
- QCString opt = &arg[1];
+ TQCString opt = &arg[1];
if ( opt[0] == 'o' ) { // output redirection
if ( opt[1] == '\0' ) {
if ( !(n < argc-1) ) {
@@ -1550,11 +1550,11 @@ int main( int argc, char * argv[] )
}
#endif
- QFile file( fileName );
+ TQFile file( fileName );
if ( !file.open( IO_ReadOnly ) )
qFatal( "pyuic: Could not open file '%s' ", (const char *)fileName );
- QFile fileOut;
+ TQFile fileOut;
if (!outputFile.isEmpty()) {
fileOut.setName( outputFile );
if (!fileOut.open( IO_WriteOnly ) )
@@ -1562,16 +1562,16 @@ int main( int argc, char * argv[] )
} else {
fileOut.open( IO_WriteOnly, stdout );
}
- QTextStream out( &fileOut );
- out.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream out( &fileOut );
+ out.setEncoding( TQTextStream::UnicodeUTF8 );
- QDomDocument doc;
+ TQDomDocument doc;
if ( !doc.setContent( &file ) )
qFatal( "pyuic: Failed to parse %s\n", (const char *)fileName );
out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl;
out << "#" << endl;
- out << "# Created: " << QDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
out << "# by: The Python User Interface Compiler (pyuic) " << PYQT_VERSION << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
@@ -1583,14 +1583,14 @@ int main( int argc, char * argv[] )
out << "from qt import *" << endl;
- Uic( out, doc, trmacro.isEmpty() ? QString("self.tr") : trmacro );
+ Uic( out, doc, trmacro.isEmpty() ? TQString("self.tr") : trmacro );
if (execCode) {
out << endl;
out << endl;
out << "if __name__ == '__main__':" << endl;
- out << " a = QApplication(sys.argv)" << endl;
- out << " QObject.connect(a,SIGNAL('lastWindowClosed()'),a,SLOT('quit()'))" << endl;
+ out << " a = TQApplication(sys.argv)" << endl;
+ out << " TQObject.connect(a,TQT_SIGNAL('lastWindowClosed()'),a,TQT_SLOT('quit()'))" << endl;
out << " w = " << className << "()" << endl;
out << " a.setMainWidget(w)" << endl;
out << " w.show()" << endl;