summaryrefslogtreecommitdiffstats
path: root/puic/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'puic/object.cpp')
-rw-r--r--puic/object.cpp278
1 files changed, 139 insertions, 139 deletions
diff --git a/puic/object.cpp b/puic/object.cpp
index a7eb0c4..ec2f717 100644
--- a/puic/object.cpp
+++ b/puic/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
@@ -36,19 +36,19 @@
\sa createObjectImpl()
*/
-void Uic::createObjectDecl( const QDomElement& e )
+void Uic::createObjectDecl( const TQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
@@ -58,29 +58,29 @@ void Uic::createObjectDecl( const QDomElement& e )
}
/*!
- Creates a PerlQt attribute declaration for the object given in \a e.
+ Creates a PerlTQt attribute declaration for the object given in \a e.
Children are not traversed recursively.
*/
-void Uic::createAttrDecl( const QDomElement& e )
+void Uic::createAttrDecl( const TQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- QString objClass = getClassName( e );
+ TQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- QString objName = getObjectName( e );
+ TQString objName = getObjectName( e );
if ( objName.isEmpty() )
return;
- // ignore QLayoutWidgets
- if ( objClass == "Qt::LayoutWidget" )
+ // ignore TQLayoutWidgets
+ if ( objClass == "TQt::LayoutWidget" )
return;
// register the object and unify its name
objName = registerObject( objName );
out << indent << objName << endl;
- QDomElement n = getObjectProperty( e, "font");
+ TQDomElement n = getObjectProperty( e, "font");
if ( !n.isNull() )
out << indent << objName + "_font" << endl;
}
@@ -99,17 +99,17 @@ void Uic::createAttrDecl( const QDomElement& e )
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 == "this" && isMainWindow ) {
if ( !createdCentralWidget )
- out << indent << "setCentralWidget(Qt::Widget(this, \"qt_central_widget\"));" << endl;
+ out << indent << "setCentralWidget(TQt::Widget(this, \"qt_central_widget\"));" << endl;
createdCentralWidget = TRUE;
parent = "centralWidget()";
}
- QDomElement n;
- QString objClass, objName;
+ TQDomElement n;
+ TQString objClass, objName;
int numItems = 0;
int numColumns = 0;
int numRows = 0;
@@ -122,8 +122,8 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return objName;
objName = getObjectName( e );
- QString definedName = objName;
- bool isTmpObject = objName.isEmpty() || objClass == "Qt::LayoutWidget";
+ TQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
objName = "$" + objClass.mid( 4 );
@@ -133,17 +133,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
bool isLine = objClass == "Line";
if ( isLine )
- objClass = "Qt::Frame";
+ objClass = "TQt::Frame";
out << endl;
- if ( objClass == "Qt::LayoutWidget" ) {
+ if ( objClass == "TQt::LayoutWidget" ) {
if ( layout.isEmpty() ) {
// register the object and unify its name
objName = registerObject( objName );
- out << indent << (isTmpObject ? QString::fromLatin1("my ") : QString::null) << objName << " = Qt::Widget(" << parent << ", '" << objName << "');" << endl;
+ out << indent << (isTmpObject ? TQString::fromLatin1("my ") : TQString::null) << objName << " = TQt::Widget(" << parent << ", '" << objName << "');" << 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 );
@@ -151,17 +151,17 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
return result;
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) {
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) {
// register the object and unify its name
objName = registerObject( objName );
// Temporary objects don't go into the class instance dictionary.
- out << indent << (isTmpObject ? QString("my ") : QString::null) << objName << " = " << createObjectInstance( objClass, parent, objName ) << ";" << endl;
+ out << indent << (isTmpObject ? TQString("my ") : TQString::null) << objName << " = " << createObjectInstance( objClass, parent, objName ) << ";" << endl;
}
- if ( objClass == "Qt::AxWidget" ) {
- QString controlId;
+ if ( objClass == "TQt::AxWidget" ) {
+ 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();
@@ -178,10 +178,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" )
@@ -195,35 +195,35 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( isLine && prop == "orientation" ) {
prop = "frameShape";
if ( value.right(10) == "Horizontal" )
- value = "&Qt::Frame::HLine";
+ value = "&TQt::Frame::HLine";
else
- value = "&Qt::Frame::VLine";
+ value = "&TQt::Frame::VLine";
if ( !hadFrameShadow ) {
prop = "frameStyle";
- value += " | &Qt::Frame::Sunken";
+ value += " | &TQt::Frame::Sunken";
}
}
if ( prop == "buttonGroupId" ) {
- if ( parentClass == "Qt::ButtonGroup" )
+ if ( parentClass == "TQt::ButtonGroup" )
out << indent << parent << "->insert( " << objName << "," << value << ");" << endl;
continue;
}
if ( prop == "frameworkCode" )
continue;
- if ( objClass == "Qt::MultiLineEdit" &&
- QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ if ( objClass == "TQt::MultiLineEdit" &&
+ TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
continue;
- QString call = objName + "->";
+ TQString call = objName + "->";
bool needClose = false;
if ( stdset ) {
call += mkStdSet( prop ) + "( ";
} else {
- call += "setProperty( \"" + prop + "\", Qt::Variant(" ;
+ call += "setProperty( \"" + prop + "\", TQt::Variant(" ;
needClose = true;
}
if ( prop == "accel" )
- call += "Qt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
+ call += "TQt::KeySequence( " + value + " )"+ (needClose ? " )": "") + " );";
else
call += value + (needClose ? " )": "") + " );";
@@ -234,8 +234,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.mid( 4 ) == "ListBox" ) {
call = createListBoxItemImpl( n, objName );
@@ -259,7 +259,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << indent << call << endl;
}
} else if ( objClass.mid( 4 ) == "ListView" ) {
- call = createListViewItemImpl( n, objName, QString::null );
+ call = createListViewItemImpl( n, objName, TQString::null );
if ( !call.isEmpty() ) {
if ( numItems == 0 )
trout << indent << objName << "->clear();" << endl;
@@ -269,8 +269,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.mid( 4 ) == "ListView" ) {
call = createListViewColumnImpl( n, objName, &value );
@@ -279,7 +279,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
trout << indent << objName << "->header()->setLabel( "
<< numColumns++ << ", " << value << " );\n";
}
- } else if ( objClass == "Qt::Table" || objClass == "Qt::DataTable" ) {
+ } else if ( objClass == "TQt::Table" || objClass == "TQt::DataTable" ) {
bool isCols = ( n.tagName() == "column" );
call = createTableRowColumnImpl( n, objName, &value );
if ( !call.isEmpty() ) {
@@ -296,52 +296,52 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
// create all children, some widgets have special requirements
- if ( objClass == "Qt::TabWidget" ) {
+ if ( objClass == "TQt::TabWidget" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString comment;
- QString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << objName << "->insertTab( " << page << ", \"\" );" << endl;
trout << indent << objName << "->changeTab( " << page << ", "
<< trcall( label, comment ) << " );" << endl;
}
}
- } else if ( objClass == "Qt::WidgetStack" ) {
+ } else if ( objClass == "TQt::WidgetStack" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
+ TQString page = createObjectImpl( n, objClass, objName );
int id = DomTool::readAttribute( n, "id", "" ).toInt();
out << indent << objName << "->addWidget( " << page << ", " << id << " );" << endl;
}
}
- } else if ( objClass == "Qt::ToolBox" ) {
+ } else if ( objClass == "TQt::ToolBox" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString label = DomTool::readAttribute( n, "label", "" ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString label = DomTool::readAttribute( n, "label", "" ).toString();
out << indent << objName << "->addItem( " << page << ", \"" << label << "\" );" << endl;
}
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) { // standard widgets
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) { // standard widgets
WidgetInterface *iface = 0;
- QString QtObjClass = objClass;
- QtObjClass.replace( QRegExp("^Qt::"), "Q" );
- QtObjClass.replace( QRegExp("^KDE::"), "K" );
- widgetManager()->queryInterface( QtObjClass, &iface );
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
- int id = WidgetDatabase::idFromClassName( QtObjClass );
+ TQString TQtObjClass = objClass;
+ TQtObjClass.replace( TQRegExp("^TQt::"), "Q" );
+ TQtObjClass.replace( TQRegExp("^KDE::"), "K" );
+ widgetManager()->queryInterface( TQtObjClass, &iface );
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
+ int id = WidgetDatabase::idFromClassName( TQtObjClass );
if ( WidgetDatabase::isContainer( id ) && WidgetDatabase::isCustomPluginWidget( id ) && iface ) {
- QWidgetContainerInterfacePrivate *iface2 = 0;
- iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ TQWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_TQWidgetContainer, (TQUnknownInterface**)&iface2 );
if ( iface2 ) {
- bool supportsPages = iface2->supportsPages( QtObjClass );
+ bool supportsPages = iface2->supportsPages( TQtObjClass );
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
if ( supportsPages ) {
- QString page = createObjectImpl( n, objClass, objName );
- QString comment;
- QString label = DomTool::readAttribute( n, "label", "", comment ).toString();
+ TQString page = createObjectImpl( n, objClass, objName );
+ TQString comment;
+ TQString label = DomTool::readAttribute( n, "label", "", comment ).toString();
out << indent << iface2->createCode( objClass, objName, page, label ) << endl;
} else {
createObjectImpl( n, objClass, objName );
@@ -357,7 +357,7 @@ QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass,
if ( tags.contains( n.tagName() ) )
createObjectImpl( n, objClass, objName );
}
-#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+#ifdef TQT_CONTAINER_CUSTOM_WIDGETS
}
#endif
}
@@ -377,13 +377,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;
@@ -393,15 +393,15 @@ 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;
// we assume the property isn't of type 'string'
++indent;
- out << indent << objName << "->setProperty(\"" << prop << "\", Qt::Variant(" << value << "));" << endl;
+ out << indent << objName << "->setProperty(\"" << prop << "\", TQt::Variant(" << value << "));" << endl;
--indent;
}
}
@@ -412,11 +412,11 @@ void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusi
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" )
@@ -429,11 +429,11 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Rect(%1, %2, %3, %4)";
+ v = "TQt::Rect(%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" )
@@ -442,10 +442,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Point(%1, %2)";
+ v = "TQt::Point(%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" )
@@ -454,10 +454,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Size(%1, %2)";
+ v = "TQt::Size(%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" )
@@ -468,18 +468,18 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
b = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Color(%1, %2, %3)";
+ v = "TQt::Color(%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 << "my " << fontname << " = Qt::Font(" << obj << "->font);" << endl;
+ out << indent << "my " << fontname << " = TQt::Font(" << obj << "->font);" << endl;
} else {
fontname = "$" + registerObject( "font" );
- out << indent << "my " << fontname << " = Qt::Font(this->font);" << endl;
+ out << indent << "my " << fontname << " = TQt::Font(this->font);" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -506,22 +506,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 != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ if ( prop == "toolTip" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::ToolTip::add(" << obj << ", "
+ trout << indent << "TQt::ToolTip::add(" << obj << ", "
<< trcall( txt, com ) << ");" << endl;
else
- out << indent << "Qt::ToolTip::add( this, "
+ out << indent << "TQt::ToolTip::add( this, "
<< trcall( txt, com ) << ");" << endl;
- } else if ( prop == "whatsThis" && objClass != "Qt::Action" && objClass != "Qt::ActionGroup" ) {
+ } else if ( prop == "whatsThis" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) {
if ( !obj.isEmpty() )
- trout << indent << "Qt::WhatsThis::add(" << obj << ", "
+ trout << indent << "TQt::WhatsThis::add(" << obj << ", "
<< trcall( txt, com ) << ");" << endl;
else
- trout << indent << "Qt::WhatsThis::add( this,"
+ trout << indent << "TQt::WhatsThis::add( this,"
<< trcall( txt, com ) << ");" << endl;
} else {
v = trcall( txt, com );
@@ -536,24 +536,24 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
if ( stdset )
v = "%1";
else
- v = "Qt::Variant(%1, 0)";
+ v = "TQt::Variant(%1, 0)";
v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data();
if( !externPixmaps )
v.prepend( '$' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- v.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ v.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( e.tagName() == "iconset" ) {
- v = "Qt::IconSet(%1)";
- QString s = e.firstChild().toText().data();
+ v = "TQt::IconSet(%1)";
+ TQString s = e.firstChild().toText().data();
if( !externPixmaps )
s.prepend( '$' );
if ( !pixmapLoaderFunction.isEmpty() ) {
- s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) );
- s.append( QString( externPixmaps ? "\"" : "" ) + ")" );
+ s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
+ s.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
}
v = v.arg( s );
} else if ( e.tagName() == "image" ) {
@@ -563,19 +563,19 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = "&%1::%2()";
else
v = "\"%1\"";
- QString oc = objClass;
- QString ev = e.firstChild().toText().data();
- if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual in 4.0
- oc = "Qt::ScrollView";
+ TQString oc = objClass;
+ TQString ev = e.firstChild().toText().data();
+ if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual in 4.0
+ oc = "TQt::ScrollView";
if ( stdset )
v = v.arg( oc ).arg( ev );
else
v = v.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 = "int(&";
- QStringList::Iterator it = lst.begin();
+ TQStringList::Iterator it = lst.begin();
while ( it != lst.end() ) {
v += objClass + "::" + *it;
if ( it != lst.fromLast() )
@@ -584,30 +584,30 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
}
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() );
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 = (obj.isEmpty() ? QString::fromLatin1("this") : obj) + "->";
- v = "Qt::SizePolicy(%1, %2, %3, %4, " + tmp + "sizePolicy()->hasHeightForWidth())";
+ TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("this") : obj) + "->";
+ v = "TQt::SizePolicy(%1, %2, %3, %4, " + tmp + "sizePolicy()->hasHeightForWidth())";
v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ).arg( sp.horStretch() ).arg( sp.verStretch() );
} else if ( e.tagName() == "palette" ) {
- 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 );
@@ -621,19 +621,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 = "Qt::Palette(Qt::Color(%1,%2,%3), Qt::Color(%1,%2,%3))";
+ if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
+ v = "TQt::Palette(TQt::Color(%1,%2,%3), TQt::Color(%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 << " = Qt::Palette();" << endl;
+ out << indent << palette << " = TQt::Palette();" << endl;
pal_used = TRUE;
}
- QString cg = "cg";
+ TQString cg = "cg";
if ( !cg_used ) {
- out << indent << cg << " = Qt::ColorGroup();" << endl;
+ out << indent << cg << " = TQt::ColorGroup();" << endl;
cg_used = TRUE;
}
n = e.firstChild().toElement();
@@ -656,10 +656,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
v = palette;
}
} else if ( e.tagName() == "cursor" ) {
- v = "Qt::Cursor(%1)";
+ v = "TQt::Cursor(%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() ) {
@@ -671,10 +671,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Date(%1,%2,%3)";
+ v = "TQt::Date(%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() ) {
@@ -686,10 +686,10 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Time(%1, %2, %3)";
+ v = "TQt::Time(%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() ) {
@@ -707,12 +707,12 @@ QString Uic::setObjectProperty( const QString& objClass, const QString& obj, con
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::DateTime(Qt::Date(%1, %2, %3), Qt::Time(%4, %5, %6))";
+ v = "TQt::DateTime(TQt::Date(%1, %2, %3), TQt::Time(%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;
+ TQStringList l;
+ TQDomElement n3 = e.firstChild().toElement();
+ TQString listname;
if ( !obj.isEmpty() ) {
listname = obj + "->{_strlist";
listname = registerObject( listname );
@@ -754,9 +754,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() ) {