summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/object.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/object.cpp258
1 files changed, 129 insertions, 129 deletions
diff --git a/qtruby/rubylib/designer/rbuic/object.cpp b/qtruby/rubylib/designer/rbuic/object.cpp
index 2d05e0b6..bb1422b1 100644
--- a/qtruby/rubylib/designer/rbuic/object.cpp
+++ b/qtruby/rubylib/designer/rbuic/object.cpp
@@ -41,19 +41,19 @@
\sa createObjectImpl()
*/
-void Uic::createObjectDecl( const TQDomElement& e )
+void Uic::createObjectDecl( const TTQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString 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
@@ -68,27 +68,27 @@ void Uic::createObjectDecl( const TQDomElement& e )
Children are not traversed recursively.
*/
-void Uic::createAttrDecl( const TQDomElement& e )
+void Uic::createAttrDecl( const TTQDomElement& e )
{
if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) {
// out << indent << registerObject(getLayoutName(e) ) << endl;
} else {
- TQString objClass = getClassName( e );
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString 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 );
- TQString attr(objName);
- attr.replace(TQChar('@'), "attr_reader :");
+ TTQString attr(objName);
+ attr.replace(TTQChar('@'), "attr_reader :");
out << indent << attr << endl;
- TQDomElement n = getObjectProperty( e, "font");
+ TTQDomElement n = getObjectProperty( e, "font");
// if ( !n.isNull() )
// out << indent << objName + "_font" << endl;
}
@@ -107,17 +107,17 @@ void Uic::createAttrDecl( const TQDomElement& e )
static bool createdCentralWidget = false;
-TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout )
+TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& par, const TTQString& layout )
{
- TQString parent( par );
+ TTQString parent( par );
if ( parent == "self" && isMainWindow ) {
if ( !createdCentralWidget )
- out << indent << "setCentralWidget(Qt::Widget.new(self, \"qt_central_widget\"))" << endl;
+ out << indent << "setCentralWidget(TQt::Widget.new(self, \"qt_central_widget\"))" << endl;
createdCentralWidget = true;
parent = "centralWidget()";
}
- TQDomElement n;
- TQString objClass, objName, fullObjName;
+ TTQDomElement n;
+ TTQString objClass, objName, fullObjName;
int numItems = 0;
int numColumns = 0;
int numRows = 0;
@@ -130,8 +130,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
return objName;
objName = getObjectName( e );
- TQString definedName = objName;
- bool isTmpObject = objName.isEmpty() || objClass == "Qt::LayoutWidget";
+ TTQString definedName = objName;
+ bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget";
if ( isTmpObject ) {
if ( objClass[0] == 'Q' )
objName = objClass.mid( 4 );
@@ -141,17 +141,17 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
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 ? TQString::fromLatin1("") : TQString::null) << objName << " = Qt::Widget.new(" << parent << ", '" << objName << "')" << endl;
+ out << indent << (isTmpObject ? TTQString::fromLatin1("") : TTQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl;
} else {
// the layout widget is not necessary, hide it by creating its child in the parent
- TQString result;
+ TTQString result;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if (tags.contains( n.tagName() ) )
result = createObjectImpl( n, parentClass, parent, layout );
@@ -162,7 +162,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
// Layouts don't go into the class instance dictionary.
// FIXME PerlQt: fullObjName isn't used anymore => remove
fullObjName = objName;
- } 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 );
@@ -174,8 +174,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
else
fullObjName = objName;
- if ( objClass == "Qt::AxWidget" ) {
- TQString controlId;
+ if ( objClass == "TQt::AxWidget" ) {
+ TTQString 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();
@@ -193,10 +193,10 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- TQString prop = n.attribute("name");
+ TTQString prop = n.attribute("name");
if ( prop == "database" )
continue;
- TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
if ( prop == "name" )
@@ -210,26 +210,26 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
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( " << fullObjName << "," << value << ")" << endl;
continue;
}
if ( prop == "frameworkCode" )
continue;
- if ( objClass == "Qt::MultiLineEdit" &&
- TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
+ if ( objClass == "TQt::MultiLineEdit" &&
+ TTQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) )
continue;
- TQString call = fullObjName + ".";
+ TTQString call = fullObjName + ".";
if (! call.startsWith("@")) {
call.prepend("@");
}
@@ -238,7 +238,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
call += mkStdSet( prop ) + "( ";
call += value + " )";
} else {
- call += "setProperty( \"" + prop + "\", Qt::Variant.new(" ;
+ call += "setProperty( \"" + prop + "\", TQt::Variant.new(" ;
call += value + " ) )";
}
@@ -249,8 +249,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
out << indent << call << endl;
}
} else if ( n.tagName() == "item" ) {
- TQString call;
- TQString value;
+ TTQString call;
+ TTQString value;
if ( objClass.mid( 4 ) == "ListBox" ) {
call = createListBoxItemImpl( n, fullObjName, &value );
@@ -274,7 +274,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
trout << indent << call << endl;
}
} else if ( objClass.mid( 4 ) == "ListView" ) {
- call = createListViewItemImpl( n, fullObjName, TQString::null );
+ call = createListViewItemImpl( n, fullObjName, TTQString::null );
if ( !call.isEmpty() ) {
if ( numItems == 0 )
trout << indent << fullObjName << ".clear()" << endl;
@@ -284,8 +284,8 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
if ( !call.isEmpty() )
numItems++;
} else if ( n.tagName() == "column" || n.tagName() == "row" ) {
- TQString call;
- TQString value;
+ TTQString call;
+ TTQString value;
if ( objClass.mid( 4 ) == "ListView" ) {
call = createListViewColumnImpl( n, fullObjName, &value );
@@ -294,7 +294,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
trout << indent << fullObjName << ".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, fullObjName, &value );
if ( !call.isEmpty() ) {
@@ -309,40 +309,40 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
}
}
- // create all children, some widgets have special requirements
+ // create all children, some widgets have special retquirements
- if ( objClass == "Qt::TabWidget" ) {
+ if ( objClass == "TQt::TabWidget" ) {
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) ) {
- TQString page = createObjectImpl( n, objClass, fullObjName );
- TQString comment;
- TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
+ TTQString page = createObjectImpl( n, objClass, fullObjName );
+ TTQString comment;
+ TTQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << fullObjName << ".insertTab(" << page << ", " << trcall( label ) << ")" << endl;
trout << indent << fullObjName << ".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() ) ) {
- TQString page = createObjectImpl( n, objClass, objName );
+ TTQString page = createObjectImpl( n, objClass, objName );
int id = DomTool::readAttribute( n, "id", "" ).toInt();
out << indent << fullObjName << ".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() ) ) {
- TQString page = createObjectImpl( n, objClass, objName );
- TQString comment;
- TQString label = DomTool::readAttribute( n, "label", comment ).toString();
+ TTQString page = createObjectImpl( n, objClass, objName );
+ TTQString comment;
+ TTQString label = DomTool::readAttribute( n, "label", comment ).toString();
out << indent << fullObjName << ".addItem( " << page << ", \"\" )" << endl;
trout << indent << fullObjName << ".setItemLabel( " << fullObjName
<< ".indexOf(" << page << "), " << trcall( label, comment )
<< " )" << endl;
}
}
- } else if ( objClass != "Qt::ToolBar" && objClass != "Qt::MenuBar" ) { // standard widgets
+ } else if ( objClass != "TQt::ToolBar" && objClass != "TQt::MenuBar" ) { // standard widgets
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
if ( tags.contains( n.tagName() ) )
createObjectImpl( n, objClass, fullObjName );
@@ -364,13 +364,13 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla
application font or palette change handlers in createFormImpl().
*/
-void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp )
+void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp )
{
- TQDomElement n;
- TQString objClass = getClassName( e );
+ TTQDomElement n;
+ TTQString objClass = getClassName( e );
if ( objClass.isEmpty() )
return;
- TQString objName = getObjectName( e );
+ TTQString objName = getObjectName( e );
if ( objClass.isEmpty() )
return;
for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
@@ -378,13 +378,13 @@ void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclu
bool stdset = stdsetdef;
if ( n.hasAttribute( "stdset" ) )
stdset = toBool( n.attribute( "stdset" ) );
- TQString prop = n.attribute("name");
+ TTQString prop = n.attribute("name");
if ( prop != exclusiveProp )
continue;
- TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
+ TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
if ( value.isEmpty() )
continue;
- out << indent << indent << objName << ".setProperty(\"" << prop << "\", Qt::Variant.new(" << value << "))" << endl;
+ out << indent << indent << objName << ".setProperty(\"" << prop << "\", TQt::Variant.new(" << value << "))" << endl;
}
}
}
@@ -394,11 +394,11 @@ void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclu
Resource::saveProperty() and DomTool::elementToVariant. If you
change one, change all.
*/
-TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset )
+TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset )
{
- TQString v;
+ TTQString v;
if ( e.tagName() == "rect" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0, w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -411,11 +411,11 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Rect.new(%1, %2, %3, %4)";
+ v = "TQt::Rect.new(%1, %2, %3, %4)";
v = v.arg(x).arg(y).arg(w).arg(h);
} else if ( e.tagName() == "point" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int x = 0, y = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "x" )
@@ -424,10 +424,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
y = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Point.new(%1, %2)";
+ v = "TQt::Point.new(%1, %2)";
v = v.arg(x).arg(y);
} else if ( e.tagName() == "size" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int w = 0, h = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "width" )
@@ -436,10 +436,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
h = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Size.new(%1, %2)";
+ v = "TQt::Size.new(%1, %2)";
v = v.arg(w).arg(h);
} else if ( e.tagName() == "color" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int r= 0, g = 0, b = 0;
while ( !n3.isNull() ) {
if ( n3.tagName() == "red" )
@@ -450,17 +450,17 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
b = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Color.new(%1, %2, %3)";
+ v = "TQt::Color.new(%1, %2, %3)";
v = v.arg(r).arg(g).arg(b);
} else if ( e.tagName() == "font" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQString fontname;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQString fontname;
if ( !obj.isEmpty() ) {
fontname = obj + "_font";
- out << indent << fontname << " = Qt::Font.new(" << obj << ".font())" << endl;
+ out << indent << fontname << " = TQt::Font.new(" << obj << ".font())" << endl;
} else {
fontname = registerObject( "f" );
- out << indent << fontname << " = Qt::Font.new(font())" << endl;
+ out << indent << fontname << " = TQt::Font.new(font())" << endl;
}
while ( !n3.isNull() ) {
if ( n3.tagName() == "family" )
@@ -487,23 +487,23 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = fontname;
}
} else if ( e.tagName() == "string" ) {
- TQString txt = e.firstChild().toText().data();
- TQString com = getComment( e.parentNode() );
+ TTQString txt = e.firstChild().toText().data();
+ TTQString 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
- trout << indent << "Qt::ToolTip.add( self, "
+ trout << indent << "TQt::ToolTip.add( self, "
<< 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 << ", " << trcall( txt, com ) << ")" << endl;
+ trout << indent << "TQt::WhatsThis.add(" << obj << ", " << trcall( txt, com ) << ")" << endl;
else
- trout << indent << "Qt::WhatsThis.add(self," << trcall( txt, com ) << ")" << endl;
+ trout << indent << "TQt::WhatsThis.add(self," << trcall( txt, com ) << ")" << endl;
} else if (e.parentNode().toElement().attribute("name") == "accel") {
- v = "Qt::KeySequence.new(" + trcall( txt, com ) + ")";
+ v = "TQt::KeySequence.new(" + trcall( txt, com ) + ")";
} else {
v = trcall( txt, com );
}
@@ -511,9 +511,9 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = "\"%1\"";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "number" ) {
- // FIXME: hack. QtRuby needs a TQKeySequence to build an accel
+ // FIXME: hack. QtRuby needs a TTQKeySequence to build an accel
if( e.parentNode().toElement().attribute("name") == "accel" )
- v = "Qt::KeySequence.new(%1)";
+ v = "TQt::KeySequence.new(%1)";
else
v = "%1";
v = v.arg( e.firstChild().toText().data() );
@@ -521,22 +521,22 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
if ( stdset )
v = "%1";
else
- v = "Qt::Variant.new(%1, 0)";
+ v = "TQt::Variant.new(%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 + "(" + TQString( externPixmaps ? "\"" : "" ) );
- v.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ v.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ v.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
}
} else if ( e.tagName() == "iconset" ) {
- v = "Qt::IconSet.new(%1)";
- TQString s = e.firstChild().toText().data();
+ v = "TQt::IconSet.new(%1)";
+ TTQString s = e.firstChild().toText().data();
if ( !pixmapLoaderFunction.isEmpty() ) {
- s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) );
- s.append( TQString( externPixmaps ? "\"" : "" ) + ")" );
+ s.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) );
+ s.append( TTQString( externPixmaps ? "\"" : "" ) + ")" );
} else {
s.prepend("@");
}
@@ -545,22 +545,22 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = e.firstChild().toText().data() + ".convertToImage()";
} else if ( e.tagName() == "enum" ) {
v = "%1::%2";
- TQString oc = objClass;
- TQString ev = e.firstChild().toText().data();
- if ( oc == "Qt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0
- oc = "Qt::ScrollView";
+ TTQString oc = objClass;
+ TTQString ev = e.firstChild().toText().data();
+ if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TTQListView::Manual of WithMode enum in 3.0
+ oc = "TQt::ScrollView";
v = v.arg( oc ).arg( ev );
} else if ( e.tagName() == "set" ) {
- TQString keys( e.firstChild().toText().data() );
- TQStringList lst = TQStringList::split( '|', keys );
+ TTQString keys( e.firstChild().toText().data() );
+ TTQStringList lst = TTQStringList::split( '|', keys );
v = "";
#if defined(Q_CC_EDG)
// workaround for EDG bug reproduced with MIPSpro C++ 7.3.?
// and KAI C++ 4.0e that will be fixed in KAI C++ 4.0f
- TQStringList::Iterator it = lst.begin();
+ TTQStringList::Iterator it = lst.begin();
for ( ; it != lst.end(); ++it ) {
#else
- for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ for ( TTQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
#endif
v += objClass + "::" + *it;
if ( it != lst.fromLast() )
@@ -568,30 +568,30 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
}
v += "";
} else if ( e.tagName() == "sizepolicy" ) {
- TQDomElement n3 = e.firstChild().toElement();
- TQSizePolicy sp;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQSizePolicy sp;
while ( !n3.isNull() ) {
if ( n3.tagName() == "hsizetype" )
- sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
else if ( n3.tagName() == "vsizetype" )
- sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ sp.setVerData( (TTQSizePolicy::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();
}
- TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("self") : obj) + ".";
- v = "Qt::SizePolicy.new(%1, %2, %3, %4, " + tmp + "sizePolicy().hasHeightForWidth())";
+ TTQString tmp = (obj.isEmpty() ? TTQString::fromLatin1("self") : obj) + ".";
+ v = "TQt::SizePolicy.new(%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" ) {
- TQPalette pal;
+ TTQPalette pal;
bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0;
- TQDomElement n;
+ TTQDomElement n;
if ( no_pixmaps ) {
n = e.firstChild().toElement();
while ( !n.isNull() ) {
- TQColorGroup cg;
+ TTQColorGroup cg;
if ( n.tagName() == "active" ) {
cg = loadColorGroup( n );
pal.setActive( cg );
@@ -605,19 +605,19 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
n = n.nextSibling().toElement();
}
}
- if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) {
- v = "Qt::Palette.new(Qt::Color.new(%1,%2,%3), Qt::Color.new(%1,%2,%3))";
+ if ( no_pixmaps && pal == TTQPalette( pal.active().button(), pal.active().background() ) ) {
+ v = "TQt::Palette.new(TQt::Color.new(%1,%2,%3), TQt::Color.new(%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 {
- TQString palette = "pal";
+ TTQString palette = "pal";
if ( !pal_used ) {
- out << indent << palette << " = Qt::Palette.new()" << endl;
+ out << indent << palette << " = TQt::Palette.new()" << endl;
pal_used = true;
}
- TQString cg = "cg";
+ TTQString cg = "cg";
if ( !cg_used ) {
- out << indent << cg << " = Qt::ColorGroup.new()" << endl;
+ out << indent << cg << " = TQt::ColorGroup.new()" << endl;
cg_used = true;
}
n = e.firstChild().toElement();
@@ -640,10 +640,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
v = palette;
}
} else if ( e.tagName() == "cursor" ) {
- v = "Qt::Cursor.new(%1)";
+ v = "TQt::Cursor.new(%1)";
v = v.arg( e.firstChild().toText().data() );
} else if ( e.tagName() == "date" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int y, m, d;
y = m = d = 0;
while ( !n3.isNull() ) {
@@ -655,10 +655,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Date.new(%1,%2,%3)";
+ v = "TQt::Date.new(%1,%2,%3)";
v = v.arg(y).arg(m).arg(d);
} else if ( e.tagName() == "time" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int h, m, s;
h = m = s = 0;
while ( !n3.isNull() ) {
@@ -670,10 +670,10 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
s = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::Time.new(%1, %2, %3)";
+ v = "TQt::Time.new(%1, %2, %3)";
v = v.arg(h).arg(m).arg(s);
} else if ( e.tagName() == "datetime" ) {
- TQDomElement n3 = e.firstChild().toElement();
+ TTQDomElement n3 = e.firstChild().toElement();
int h, mi, s, y, mo, d;
h = mi = s = y = mo = d = 0;
while ( !n3.isNull() ) {
@@ -691,12 +691,12 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
d = n3.firstChild().toText().data().toInt();
n3 = n3.nextSibling().toElement();
}
- v = "Qt::DateTime.new(Qt::Date.new(%1, %2, %3), Qt::Time.new(%4, %5, %6))";
+ v = "TQt::DateTime.new(TQt::Date.new(%1, %2, %3), TQt::Time.new(%4, %5, %6))";
v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s);
} else if ( e.tagName() == "stringlist" ) {
- TQStringList l;
- TQDomElement n3 = e.firstChild().toElement();
- TQString listname;
+ TTQStringList l;
+ TTQDomElement n3 = e.firstChild().toElement();
+ TTQString listname;
if ( !obj.isEmpty() ) {
listname = obj + "_strlist";
out << indent << listname << " = [";
@@ -736,9 +736,9 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
/*! Extracts a named object property from \a e.
*/
-TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name )
+TTQDomElement Uic::getObjectProperty( const TTQDomElement& e, const TTQString& name )
{
- TQDomElement n;
+ TTQDomElement n;
for ( n = e.firstChild().toElement();
!n.isNull();
n = n.nextSibling().toElement() ) {