diff options
Diffstat (limited to 'qtsharp/src/uicsharp')
-rw-r--r-- | qtsharp/src/uicsharp/uicsharp.cs | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/qtsharp/src/uicsharp/uicsharp.cs b/qtsharp/src/uicsharp/uicsharp.cs index a2553d23..62a67757 100644 --- a/qtsharp/src/uicsharp/uicsharp.cs +++ b/qtsharp/src/uicsharp/uicsharp.cs @@ -63,7 +63,7 @@ namespace QtSharp { try { String []dummyargs=new String[0]; - QApplication dummyapp=new QApplication(dummyargs,false); + TQApplication dummyapp=new TQApplication(dummyargs,false); qtAssembly=Assembly.GetAssembly(dummyapp.GetType()); // qtAssembly=Assembly.Load("Qt.dll"); Console.WriteLine("CodeBase="+qtAssembly.CodeBase); @@ -225,11 +225,11 @@ namespace QtSharp { { if (menubarElement==null) return; writer.WriteLine("\t//Menubar member fields"); - writer.WriteLine("\t QMenuBar menubar;"); + writer.WriteLine("\t TQMenuBar menubar;"); foreach (XmlNode node in menubarElement.ChildNodes) { XmlElement el=node as XmlElement; if (el.Name=="item") { - writer.WriteLine("\tpublic QPopupMenu {0};",el.GetAttribute("name")); + writer.WriteLine("\tpublic TQPopupMenu {0};",el.GetAttribute("name")); } } } @@ -241,7 +241,7 @@ namespace QtSharp { foreach (XmlNode node in actionsElement.ChildNodes) { XmlElement el=node as XmlElement; if (el.Name=="action") { - writer.WriteLine("\tpublic QAction {0};",getName(el)); + writer.WriteLine("\tpublic TQAction {0};",getName(el)); } } } @@ -253,7 +253,7 @@ namespace QtSharp { foreach (XmlNode node in toolbarsElement.ChildNodes) { XmlElement el=node as XmlElement; if (el.Name=="toolbar") { - writer.WriteLine("\tpublic QToolBar {0};",getName(el)); + writer.WriteLine("\tpublic TQToolBar {0};",getName(el)); } } } @@ -334,7 +334,7 @@ namespace QtSharp { tmp=tmp.NextSibling as XmlElement; String slot=tmp.InnerText; - writer.WriteLine("\t\tQObject.Connect({0},SIGNAL(\"{1}\"),{2},SLOT(\"{3}\"));", + writer.WriteLine("\t\tQObject.Connect({0},TQT_SIGNAL(\"{1}\"),{2},TQT_SLOT(\"{3}\"));", sender,signal,receiver,slot); } break; @@ -346,7 +346,7 @@ namespace QtSharp { private void createConstructor() { //Later handle non qwidgets better (dialog,....) - writer.WriteLine("\n\tpublic "+className+"(QWidget parent, String name) :base(parent, name) {"); + writer.WriteLine("\n\tpublic "+className+"(TQWidget parent, String name) :base(parent, name) {"); writer.WriteLine("\t\tif (name==null) SetName(\""+className+"\");"); setupImages(); setupActions(); @@ -370,7 +370,7 @@ namespace QtSharp { writer.WriteLine("\t//images"); foreach (XmlNode node in imagesElement.ChildNodes) { XmlElement el=node as XmlElement; - writer.WriteLine("\t\t{0}=new QPixmap({1}_data);", + writer.WriteLine("\t\t{0}=new TQPixmap({1}_data);", el.GetAttribute("name"),el.GetAttribute("name")); } } @@ -382,7 +382,7 @@ namespace QtSharp { foreach (XmlNode aNode in actionsElement.ChildNodes) { XmlElement action=aNode as XmlElement; if (action.Name!="action") continue; - writer.WriteLine("\t\t{0}= new QAction(this,\"{1}\");",getName(action),getName(action)); + writer.WriteLine("\t\t{0}= new TQAction(this,\"{1}\");",getName(action),getName(action)); foreach (XmlNode pNode in action.ChildNodes) { XmlElement prop=pNode as XmlElement; if (prop.Name!="property") continue; @@ -398,14 +398,14 @@ namespace QtSharp { if (menubarElement==null) return; writer.WriteLine("\t//menubar"); String barname=getName(menubarElement); - writer.WriteLine("\t\t{0}=new QMenuBar(this,\"{1}\");",barname,barname); + writer.WriteLine("\t\t{0}=new TQMenuBar(this,\"{1}\");",barname,barname); int count=0; foreach (XmlNode mNode in menubarElement.ChildNodes) { XmlElement item=mNode as XmlElement; if (item.Name!="item") continue; String submenu_name=item.GetAttribute("name"); String submenu_text=stringify(item.GetAttribute("text")); - writer.WriteLine("\t\t{0}=new QPopupMenu(this);",submenu_name); + writer.WriteLine("\t\t{0}=new TQPopupMenu(this);",submenu_name); foreach (XmlNode node in item.ChildNodes) { XmlElement element=node as XmlElement; @@ -428,7 +428,7 @@ namespace QtSharp { XmlElement toolbar=tNode as XmlElement; if (toolbar.Name!="toolbar") continue; String varname=getName(toolbar); - writer.WriteLine("\t\t{0}=new QToolBar(this,\"{1}\");",varname,varname); + writer.WriteLine("\t\t{0}=new TQToolBar(this,\"{1}\");",varname,varname); writer.WriteLine("\t\tthis.AddDockWindow({0},(Qt.Dock){1},false);",varname,toolbar.GetAttribute("dock")); foreach (XmlNode node in toolbar.ChildNodes) { XmlElement element=node as XmlElement; @@ -473,7 +473,7 @@ namespace QtSharp { private void widgetAdd(String parname,XmlElement par, XmlElement obj) { if (par==widgetElement) { - if (par.GetAttribute("class")=="QWizard") + if (par.GetAttribute("class")=="TQWizard") { writer.WriteLine("\t\tAddPage("+getName(obj)+", "+getName(obj)+".Caption());"); } @@ -486,7 +486,7 @@ namespace QtSharp { else writer.WriteLine("\t\t"+parname+".Add("+getName(obj)+");"); } else switch(par.GetAttribute("class")) { - case "QTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");"); + case "TQTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");"); break; default: break; } @@ -575,10 +575,10 @@ namespace QtSharp { break; } } - writer.WriteLine("\t\tQSpacerItem {0}=new QSpacerItem({1},{2},{3},{4});", + writer.WriteLine("\t\tQSpacerItem {0}=new TQSpacerItem({1},{2},{3},{4});", name,shx,shy, - (orientation=="VERTICAL")?"Qt.QSizePolicy.SizeType.Minimum":("Qt.QSizePolicy.SizeType."+toPascal(sizeType)), - (orientation!="VERTICAL")?"Qt.QSizePolicy.SizeType.Minimum":("Qt.QSizePolicy.SizeType."+toPascal(sizeType))); + (orientation=="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType)), + (orientation!="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType))); } int layoutcnt=1; @@ -600,11 +600,11 @@ namespace QtSharp { parent=obj.GetAttribute("uicsharp_parent"); switch (obj.Name) { - case "vbox": writer.WriteLine("\t\t"+(privateLayout?"QVBoxLayout ":"")+name+"= new QVBoxLayout("+ + case "vbox": writer.WriteLine("\t\t"+(privateLayout?"TQVBoxLayout ":"")+name+"= new TQVBoxLayout("+ ((parent==null)?"":parent)+");"); setupLayout(name,obj); return obj; - case "hbox": writer.WriteLine("\t\t"+(privateLayout?"QHBoxLayout ":"")+name+"= new QHBoxLayout("+ + case "hbox": writer.WriteLine("\t\t"+(privateLayout?"TQHBoxLayout ":"")+name+"= new TQHBoxLayout("+ ((parent==null)?"":parent)+");"); setupLayout(name,obj); return obj; @@ -647,7 +647,7 @@ namespace QtSharp { rows=(tmprows<rows)?rows:tmprows; } } - writer.WriteLine("\t\t"+ (privateLayout?"QGridLayout ":"")+name +"= new QGridLayout ("+ + writer.WriteLine("\t\t"+ (privateLayout?"TQGridLayout ":"")+name +"= new TQGridLayout ("+ ((parent==null)?"":(parent+", "))+rows+", "+cols+");"); setupLayout(name,obj); return obj; @@ -696,7 +696,7 @@ namespace QtSharp { private void widgetType(XmlElement obj, ref String typename, ref XmlElement subcontainer, bool write) { typename=obj.GetAttribute("class"); - if ((typename!="QGroupBox") && (typename!="ButtonGroup")) return; + if ((typename!="TQGroupBox") && (typename!="ButtonGroup")) return; foreach (XmlNode node in obj.ChildNodes) { if (elementType(node as XmlElement)==ElementType.LayoutType) { XmlElement el =node as XmlElement; @@ -708,17 +708,17 @@ namespace QtSharp { el.SetAttribute("uicsharp_alignment","(int)Qt.AlignmentFlags.AlignTop"); switch (el.Name) { - case "vbox": typename="QGroupBox"; + case "vbox": typename="TQGroupBox"; if (write) - writer.WriteLine("\t\t QVBoxLayout "+el.GetAttribute("uicsharp_name")+";"); + writer.WriteLine("\t\t TQVBoxLayout "+el.GetAttribute("uicsharp_name")+";"); return; - case "hbox": typename="QGroupBox"; + case "hbox": typename="TQGroupBox"; if (write) - writer.WriteLine("\t\t QHBoxLayout "+el.GetAttribute("uicsharp_name")+";"); + writer.WriteLine("\t\t TQHBoxLayout "+el.GetAttribute("uicsharp_name")+";"); return; - case "grid": typename="QGroupBox"; + case "grid": typename="TQGroupBox"; if (write) - writer.WriteLine("\t\t QGridLayout "+el.GetAttribute("uicsharp_name")+";"); + writer.WriteLine("\t\t TQGridLayout "+el.GetAttribute("uicsharp_name")+";"); return; @@ -769,7 +769,7 @@ namespace QtSharp { switch (value.Name) { case "string" : if (prop.GetAttribute("name")!="accel") sc += "\""+stringify(value.InnerText)+"\""; - else sc+="new QKeySequence(\""+stringify(value.InnerText)+"\")"; + else sc+="new TQKeySequence(\""+stringify(value.InnerText)+"\")"; break; case "cstring" : sc += value.InnerText; break; @@ -789,9 +789,9 @@ namespace QtSharp { } } if ((varName=="this") && (methodName=="SetGeometry")) - sc = "Resize ((new QSize("+rw+", "+rh+")).ExpandedTo(SizeHint())"; + sc = "Resize ((new TQSize("+rw+", "+rh+")).ExpandedTo(SizeHint())"; else - sc += "new QRect("+rx+", "+ry+", "+rw+", "+rh+")"; + sc += "new TQRect("+rx+", "+ry+", "+rw+", "+rh+")"; break; case "enum" : @@ -810,7 +810,7 @@ namespace QtSharp { } break; - case "iconset" : sc += "new QIconSet("+value.InnerText+")"; + case "iconset" : sc += "new TQIconSet("+value.InnerText+")"; break; case "bool" : sc += value.InnerText; break; @@ -923,7 +923,7 @@ namespace QtSharp { { writer.WriteLine("\tpublic static void Main (String[] args)\n"+ "\t{\n"+ - "\t\tQApplication app = new QApplication (args);\n"+ + "\t\tQApplication app = new TQApplication (args);\n"+ "\t\t"+className+" test = new "+className+" (null,\"\");\n"+ "\t\tapp.SetMainWidget (test);\n"+ "\t\ttest.Show ();\n"+ |