summaryrefslogtreecommitdiffstats
path: root/pyuic3/object.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
committerTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /pyuic3/object.cpp
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'pyuic3/object.cpp')
-rw-r--r--pyuic3/object.cpp274
1 files changed, 137 insertions, 137 deletions
diff --git a/pyuic3/object.cpp b/pyuic3/object.cpp
index 834427f..1e05176 100644
--- a/pyuic3/object.cpp
+++ b/pyuic3/object.cpp
@@ -1,7 +1,7 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** This file is part of Qt Designer.
+** This file is part of TQt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
@@ -38,17 +38,17 @@
static bool createdCentralWidget = FALSE;
-QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& par, const QString& layout )
+TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout )
{
- QString parent( par );
+ TQString parent( par );
if ( parent == "self" && isMainWindow ) {
if ( !createdCentralWidget )
- out << indent << "self.setCentralWidget(QWidget(self,\"qt_central_widget\"))" << endl;
+ out << indent << "self.setCentralWidget(TQWidget(self,\"qt_central_widget\"))" << endl;
createdCentralWidget = TRUE;
parent = "self.centralWidget()";
}
- QDomElement n;
- QString objClass, objName, fullObjName;
+ TQDomElement n;
+ TQString objClass, objName, fullObjName;
int numItems = 0;
int numColumns = 0;
int numRows = 0;
@@ -61,8 +61,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return objName;
objName = getObjectName( e );
- QString definedName = objName;
- bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget";
+ TQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQLayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
objName = objClass.mid(1);
@@ -72,17 +72,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 ( objClass == "TQLayoutWidget" ) {
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 );
@@ -92,7 +92,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
// Layouts don't go into the class instance dictionary.
fullObjName = objName;
- } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) {
+ } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) {
// register the object and unify its name
objName = registerObject( objName );
@@ -104,8 +104,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
else
fullObjName = "self." + objName;
- if ( objClass == "QAxWidget" ) {
- QString controlId;
+ if ( objClass == "TQAxWidget" ) {
+ TQString controlId;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) {
controlId = n.firstChild().toElement().text();
@@ -122,10 +122,10 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute( "name" );
+ TQString prop = n.attribute( "name" );
if ( prop == "database" )
continue;
- QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
if ( prop == "name" )
@@ -139,35 +139,35 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( isLine && prop == "orientation" ) {
prop = "frameShape";
if ( value.right(10) == "Horizontal" )
- value = "QFrame.HLine";
+ value = "TQFrame.HLine";
else
- value = "QFrame.VLine";
+ value = "TQFrame.VLine";
if ( !hadFrameShadow ) {
prop = "frameStyle";
- value += " | QFrame.Sunken";
+ value += " | TQFrame.Sunken";
}
}
if ( prop == "buttonGroupId" ) {
- if ( parentClass == "QButtonGroup" )
+ if ( parentClass == "TQButtonGroup" )
out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl;
continue;
}
if ( prop == "frameworkCode" )
continue;
- if ( objClass == "QMultiLineEdit" &&
- QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ if ( objClass == "TQMultiLineEdit" &&
+ TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
continue;
- QString call = fullObjName + ".";
- QString tail;
+ TQString call = fullObjName + ".";
+ TQString tail;
if ( stdset ) {
call += mkStdSet( prop ) + "(";
tail = ")";
} else {
- call += "setProperty(\"" + prop + "\",QVariant(";
+ call += "setProperty(\"" + prop + "\",TQVariant(";
tail = "))";
}
if ( prop == "accel" ) {
- call += "QKeySequence(";
+ call += "TQKeySequence(";
tail += ")";
}
call += value + tail;
@@ -179,8 +179,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
out << indent << call << endl;
}
} else if ( n.tagName() == "item" ) {
- QString call;
- QString value;
+ TQString call;
+ TQString value;
if ( objClass.contains( "ListBox" ) ) {
call = createListBoxItemImpl( n, fullObjName );
@@ -204,7 +204,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << trindent << call << endl;
}
} else if ( objClass.contains( "ListView" ) ) {
- call = createListViewItemImpl( n, fullObjName, QString::null );
+ call = createListViewItemImpl( n, fullObjName, TQString::null );
if ( !call.isEmpty() ) {
if ( numItems == 0 )
trout << trindent << fullObjName << ".clear()" << endl;
@@ -214,8 +214,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( !call.isEmpty() )
numItems++;
} else if ( n.tagName() == "column" || n.tagName() == "row" ) {
- QString call;
- QString value;
+ TQString call;
+ TQString value;
if ( objClass.contains( "ListView" ) ) {
call = createListViewColumnImpl( n, fullObjName, &value );
@@ -224,7 +224,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << trindent << fullObjName << ".header().setLabel("
<< numColumns++ << "," << value << ")\n";
}
- } else if ( objClass == "QTable" || objClass == "QDataTable" ) {
+ } else if ( objClass == "TQTable" || objClass == "TQDataTable" ) {
bool isCols = ( n.tagName() == "column" );
call = createTableRowColumnImpl( n, fullObjName, &value );
if ( !call.isEmpty() ) {
@@ -239,39 +239,39 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
}
}
- // create all children, some widgets have special requirements
+ // create all children, some widgets have special retquirements
- 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 comment;
- QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
- out << indent << fullObjName << ".insertTab(" << page << ",QString.fromLatin1(\"\"))" << endl;
+ TQString page = createObjectImpl( n, objClass, fullObjName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ out << indent << fullObjName << ".insertTab(" << page << ",TQString.fromLatin1(\"\"))" << endl;
trout << trindent << fullObjName << ".changeTab(" << page << "," << trcall( label, comment ) << ")" << endl;
}
}
- } else if ( objClass == "QWidgetStack" ) {
+ } else if ( objClass == "TQWidgetStack" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, fullObjName );
+ TQString page = createObjectImpl( n, objClass, fullObjName );
int id = DomTool::readAttribute( n, "id", "" ).toInt();
out << indent << fullObjName << ".addWidget(" << page << "," << id << ")" << endl;
}
}
- } else if ( objClass == "QToolBox" ) {
+ } else if ( objClass == "TQToolBox" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, fullObjName );
- QString comment;
- QString label = DomTool::readAttribute( n, "label", "", comment ).toString();
- out << indent << fullObjName << ".addItem(" << page << ",QString.fromLatin1(\"\"))" << endl;
+ TQString page = createObjectImpl( n, objClass, fullObjName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "label", "", comment ).toString();
+ out << indent << fullObjName << ".addItem(" << page << ",TQString.fromLatin1(\"\"))" << endl;
trout << trindent << fullObjName << ".setItemLabel(" << fullObjName
<< ".indexOf(" << page << ")," << trcall( label, comment )
<< ")" << endl;
}
}
- } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) { // standard widgets
+ } else if ( objClass != "TQToolBar" && objClass != "TQMenuBar" ) { // standard widgets
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) )
createObjectImpl( n, objClass, fullObjName );
@@ -293,13 +293,13 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
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 0 // it's not clear whether this check should be here or not
if ( objName.isEmpty() )
return;
@@ -309,55 +309,55 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- QString prop = n.attribute( "name" );
+ TQString prop = n.attribute( "name" );
if ( prop != exclusiveProp )
continue;
- QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
- out << indent << indent << objName << ".setProperty(\"" << prop << "\",QVariant(" << value << "))" << endl;
+ out << indent << indent << objName << ".setProperty(\"" << prop << "\",TQVariant(" << value << "))" << endl;
}
}
}
-/* Convert a QSizePolicy::SizeType to text. */
-static QString mapSizeType(QSizePolicy::SizeType st)
+/* Convert a TQSizePolicy::SizeType to text. */
+static TQString mapSizeType(TQSizePolicy::SizeType st)
{
const char *txt;
switch (st)
{
- case QSizePolicy::Fixed:
- txt = "QSizePolicy.Fixed";
+ case TQSizePolicy::Fixed:
+ txt = "TQSizePolicy.Fixed";
break;
- case QSizePolicy::Minimum:
- txt = "QSizePolicy.Minimum";
+ case TQSizePolicy::Minimum:
+ txt = "TQSizePolicy.Minimum";
break;
- case QSizePolicy::Maximum:
- txt = "QSizePolicy.Maximum";
+ case TQSizePolicy::Maximum:
+ txt = "TQSizePolicy.Maximum";
break;
- case QSizePolicy::Preferred:
- txt = "QSizePolicy.Preferred";
+ case TQSizePolicy::Preferred:
+ txt = "TQSizePolicy.Preferred";
break;
- case QSizePolicy::MinimumExpanding:
- txt = "QSizePolicy.MinimumExpanding";
+ case TQSizePolicy::MinimumExpanding:
+ txt = "TQSizePolicy.MinimumExpanding";
break;
- case QSizePolicy::Expanding:
- txt = "QSizePolicy.Expanding";
+ case TQSizePolicy::Expanding:
+ txt = "TQSizePolicy.Expanding";
break;
- case QSizePolicy::Ignored:
- txt = "QSizePolicy.Ignored";
+ case TQSizePolicy::Ignored:
+ txt = "TQSizePolicy.Ignored";
break;
default:
- txt = "Invalid QSizePolicy::SizeType";
+ txt = "Invalid TQSizePolicy::SizeType";
}
return txt;
@@ -368,11 +368,11 @@ static QString mapSizeType(QSizePolicy::SizeType st)
Resource::saveProperty() and DomTool::elementToVariant. If you
change one, change all.
*/
-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" )
@@ -385,11 +385,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" )
@@ -398,10 +398,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" )
@@ -410,10 +410,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" )
@@ -424,18 +424,18 @@ 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 attrname = e.parentNode().toElement().attribute( "name", "font" );
- QString fontname;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString attrname = e.parentNode().toElement().attribute( "name", "font" );
+ TQString fontname;
if ( !obj.isEmpty() ) {
fontname = registerObject( obj + "_" + attrname );
- out << indent << fontname << " = QFont(self." << obj << ".font())" << endl;
+ out << indent << fontname << " = TQFont(self." << obj << ".font())" << endl;
} else {
fontname = registerObject( "f" );
- out << indent << fontname << " = QFont(self.font())" << endl;
+ out << indent << fontname << " = TQFont(self.font())" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -462,22 +462,22 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = fontname;
}
} else if ( e.tagName() == "string" ) {
- QString txt = e.firstChild().toText().data();
- QString com = getComment( e.parentNode() );
+ TQString txt = e.firstChild().toText().data();
+ TQString com = getComment( e.parentNode() );
- if ( prop == "toolTip" && objClass != "QAction" && objClass != "QActionGroup" ) {
+ if ( prop == "toolTip" && objClass != "TQAction" && objClass != "TQActionGroup" ) {
if ( !obj.isEmpty() )
- trout << trindent << "QToolTip.add(self." << obj << ","
+ trout << trindent << "TQToolTip.add(self." << obj << ","
<< trcall( txt, com ) << ")" << endl;
else
- trout << trindent << "QToolTip.add(self,"
+ trout << trindent << "TQToolTip.add(self,"
<< trcall( txt, com ) << ")" << endl;
- } else if ( prop == "whatsThis" && objClass != "QAction" && objClass != "QActionGroup" ) {
+ } else if ( prop == "whatsThis" && objClass != "TQAction" && objClass != "TQActionGroup" ) {
if ( !obj.isEmpty() )
- trout << trindent << "QWhatsThis.add(self." << obj << ","
+ trout << trindent << "TQWhatsThis.add(self." << obj << ","
<< trcall( txt, com ) << ")" << endl;
else
- trout << trindent << "QWhatsThis.add(self,"
+ trout << trindent << "TQWhatsThis.add(self,"
<< trcall( txt, com ) << ")" << endl;
} else {
v = trcall( txt, com );
@@ -492,7 +492,7 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
if ( stdset )
v = "%1";
else
- v = "QVariant(%1,0)";
+ v = "TQVariant(%1,0)";
v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data();
@@ -500,19 +500,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
if ( pixmapLoaderFunction.isEmpty() ) {
v.prepend( "self." );
} else {
- v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- v.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ v.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
} else if ( e.tagName() == "iconset" ) {
- v = "QIconSet(%1)";
- QString s = e.firstChild().toText().data();
+ v = "TQIconSet(%1)";
+ TQString s = e.firstChild().toText().data();
if ( !s.isEmpty() ) {
if ( pixmapLoaderFunction.isEmpty() ) {
s.prepend( "self." );
} else {
- s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- s.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ s.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
}
v = v.arg( s );
@@ -520,16 +520,16 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
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 in 4.0
- oc = "QScrollView";
+ TQString oc = objClass;
+ TQString ev = e.firstChild().toText().data();
+ if ( oc == "TQListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.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 = "";
- QStringList::Iterator it = lst.begin();
+ TQStringList::Iterator it = lst.begin();
while ( it != lst.end() ) {
v += objClass + "." + *it;
if ( it != lst.fromLast() )
@@ -537,32 +537,32 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
++it;
}
} 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() );
else if ( n3.tagName() == "horstretch" )
sp.setHorStretch( n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "verstretch" )
sp.setVerStretch( n3.firstChild().toText().data().toInt() );
n3 = n3.nextSibling().toElement();
}
- QString tmp = "self.";
+ TQString tmp = "self.";
if ( !obj.isEmpty() )
tmp += obj + ".";
- v = "QSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())";
+ v = "TQSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())";
v = v.arg( mapSizeType(sp.horData()) ).arg( mapSizeType(sp.verData()) ).arg( sp.horStretch() ).arg( sp.verStretch() );
} 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 );
@@ -576,19 +576,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();
@@ -611,10 +611,10 @@ 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() );
} else if ( e.tagName() == "date" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -626,10 +626,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QDate(%1,%2,%3)";
+ v = "TQDate(%1,%2,%3)";
v = v.arg(y).arg(m).arg(d);
} else if ( e.tagName() == "time" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -641,10 +641,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QTime(%1,%2,%3)";
+ v = "TQTime(%1,%2,%3)";
v = v.arg(h).arg(m).arg(s);
} else if ( e.tagName() == "datetime" ) {
- QDomElement n3 = e.firstChild().toElement();
+ TQDomElement n3 = e.firstChild().toElement();
int h, mi, s, y, mo, d;
h = mi = s = y = mo = d = 0;
while ( !n3.isNull() ) {
@@ -662,18 +662,18 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "QDateTime(QDate(%1,%2,%3),QTime(%4,%5,%6))";
+ v = "TQDateTime(TQDate(%1,%2,%3),TQTime(%4,%5,%6))";
v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s);
} else if ( e.tagName() == "stringlist" ) {
- QStringList l;
- QDomElement n3 = e.firstChild().toElement();
- QString listname = "l";
+ TQStringList l;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString listname = "l";
if ( !obj.isEmpty() ) {
listname = obj + "_stringlist";
listname = registerObject( listname );
- out << indent << listname << " = QStringList()" << endl;
+ out << indent << listname << " = TQStringList()" << endl;
} else {
- out << indent << listname << " = QStringList()" << endl;
+ out << indent << listname << " = TQStringList()" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "string" )
@@ -690,9 +690,9 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
/*! Extracts a named object property from \a e.
*/
-QDomElement Uic::getObjectProperty( const QDomElement& e, const QString& name )
+TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name )
{
- QDomElement n;
+ TQDomElement n;
for ( n = e.firstChild().toElement();
!n.isNull();
n = n.nextSibling().toElement() ) {