From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- qtsharp/src/uicsharp/tests/form1.ui | 8 ++-- qtsharp/src/uicsharp/tests/form10.ui | 20 +++++----- qtsharp/src/uicsharp/tests/form2.ui | 28 +++++++------- qtsharp/src/uicsharp/tests/form3.ui | 42 ++++++++++----------- qtsharp/src/uicsharp/tests/form4.ui | 46 +++++++++++------------ qtsharp/src/uicsharp/tests/form5.ui | 2 +- qtsharp/src/uicsharp/tests/form6.ui | 16 ++++---- qtsharp/src/uicsharp/tests/form7.ui | 42 ++++++++++----------- qtsharp/src/uicsharp/tests/form8.ui | 8 ++-- qtsharp/src/uicsharp/tests/form9.ui | 26 ++++++------- qtsharp/src/uicsharp/uicsharp.cs | 72 ++++++++++++++++++------------------ 11 files changed, 155 insertions(+), 155 deletions(-) (limited to 'qtsharp/src/uicsharp') diff --git a/qtsharp/src/uicsharp/tests/form1.ui b/qtsharp/src/uicsharp/tests/form1.ui index e5895a10..f9553078 100644 --- a/qtsharp/src/uicsharp/tests/form1.ui +++ b/qtsharp/src/uicsharp/tests/form1.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -16,12 +16,12 @@ unnamed - + LineEdit1 - + PushButton1 @@ -29,7 +29,7 @@ PushButton1 - + TextLabel1 diff --git a/qtsharp/src/uicsharp/tests/form10.ui b/qtsharp/src/uicsharp/tests/form10.ui index 50b27bb6..c5b42cce 100644 --- a/qtsharp/src/uicsharp/tests/form10.ui +++ b/qtsharp/src/uicsharp/tests/form10.ui @@ -1,6 +1,6 @@ Form2 - + Form2 @@ -12,7 +12,7 @@ 480 - + WidgetStack1 @@ -24,7 +24,7 @@ 301 - + page @@ -35,7 +35,7 @@ unnamed - + CheckBox2 @@ -43,7 +43,7 @@ CheckBox2 - + RadioButton2 @@ -53,7 +53,7 @@ - + page @@ -64,7 +64,7 @@ unnamed - + Column 1 @@ -88,7 +88,7 @@ ListView1 - + Table1 @@ -101,7 +101,7 @@ - + page @@ -112,7 +112,7 @@ unnamed - + Table2 diff --git a/qtsharp/src/uicsharp/tests/form2.ui b/qtsharp/src/uicsharp/tests/form2.ui index 4d6545d5..57e7256b 100644 --- a/qtsharp/src/uicsharp/tests/form2.ui +++ b/qtsharp/src/uicsharp/tests/form2.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -16,7 +16,7 @@ unnamed - + GroupBox1 @@ -27,7 +27,7 @@ unnamed - + CheckBox1 @@ -35,7 +35,7 @@ CheckBox1 - + CheckBox2 @@ -43,7 +43,7 @@ CheckBox2 - + CheckBox3 @@ -51,7 +51,7 @@ CheckBox3 - + CheckBox4 @@ -59,7 +59,7 @@ CheckBox4 - + CheckBox5 @@ -67,7 +67,7 @@ CheckBox5 - + CheckBox6 @@ -75,7 +75,7 @@ CheckBox6 - + CheckBox7 @@ -83,7 +83,7 @@ CheckBox7 - + CheckBox8 @@ -91,7 +91,7 @@ CheckBox8 - + CheckBox9 @@ -101,7 +101,7 @@ - + Frame3 @@ -115,12 +115,12 @@ unnamed - + LineEdit1 - + New Item diff --git a/qtsharp/src/uicsharp/tests/form3.ui b/qtsharp/src/uicsharp/tests/form3.ui index 2e77c2bd..eb6533ba 100644 --- a/qtsharp/src/uicsharp/tests/form3.ui +++ b/qtsharp/src/uicsharp/tests/form3.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -16,7 +16,7 @@ unnamed - + Layout1 @@ -24,7 +24,7 @@ unnamed - + GroupBox1 @@ -35,7 +35,7 @@ unnamed - + CheckBox1 @@ -43,7 +43,7 @@ CheckBox1 - + CheckBox2 @@ -51,7 +51,7 @@ CheckBox2 - + CheckBox3 @@ -59,7 +59,7 @@ CheckBox3 - + CheckBox4 @@ -67,7 +67,7 @@ CheckBox4 - + CheckBox5 @@ -75,7 +75,7 @@ CheckBox5 - + CheckBox6 @@ -83,7 +83,7 @@ CheckBox6 - + CheckBox7 @@ -91,7 +91,7 @@ CheckBox7 - + CheckBox8 @@ -99,7 +99,7 @@ CheckBox8 - + CheckBox9 @@ -109,7 +109,7 @@ - + GroupBox2 @@ -120,7 +120,7 @@ unnamed - + PushButton1 @@ -128,7 +128,7 @@ PushButton1 - + PushButton2 @@ -138,7 +138,7 @@ - + GroupBox3 @@ -149,7 +149,7 @@ unnamed - + PushButton3 @@ -157,7 +157,7 @@ PushButton3 - + PushButton4 @@ -169,7 +169,7 @@ - + Frame3 @@ -183,12 +183,12 @@ unnamed - + LineEdit1 - + New Item diff --git a/qtsharp/src/uicsharp/tests/form4.ui b/qtsharp/src/uicsharp/tests/form4.ui index bb18f36e..21733b0b 100644 --- a/qtsharp/src/uicsharp/tests/form4.ui +++ b/qtsharp/src/uicsharp/tests/form4.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -16,7 +16,7 @@ unnamed - + Layout1 @@ -24,7 +24,7 @@ unnamed - + GroupBox1 @@ -35,7 +35,7 @@ unnamed - + CheckBox1 @@ -43,7 +43,7 @@ CheckBox1 - + CheckBox2 @@ -51,7 +51,7 @@ CheckBox2 - + CheckBox3 @@ -59,7 +59,7 @@ CheckBox3 - + CheckBox4 @@ -67,7 +67,7 @@ CheckBox4 - + CheckBox5 @@ -75,7 +75,7 @@ CheckBox5 - + CheckBox6 @@ -83,7 +83,7 @@ CheckBox6 - + CheckBox7 @@ -91,7 +91,7 @@ CheckBox7 - + CheckBox8 @@ -99,7 +99,7 @@ CheckBox8 - + CheckBox9 @@ -109,7 +109,7 @@ - + GroupBox2 @@ -120,7 +120,7 @@ unnamed - + PushButton1 @@ -128,7 +128,7 @@ PushButton1 - + PushButton2 @@ -138,7 +138,7 @@ - + GroupBox3 @@ -149,7 +149,7 @@ unnamed - + PushButton3 @@ -157,7 +157,7 @@ PushButton3 - + Layout2 @@ -165,7 +165,7 @@ unnamed - + CheckBox10 @@ -173,7 +173,7 @@ CheckBox10 - + CheckBox11 @@ -187,7 +187,7 @@ - + Frame3 @@ -201,12 +201,12 @@ unnamed - + LineEdit1 - + New Item diff --git a/qtsharp/src/uicsharp/tests/form5.ui b/qtsharp/src/uicsharp/tests/form5.ui index 47cd7d91..bb998334 100644 --- a/qtsharp/src/uicsharp/tests/form5.ui +++ b/qtsharp/src/uicsharp/tests/form5.ui @@ -1,6 +1,6 @@ Form1 - + Form1 diff --git a/qtsharp/src/uicsharp/tests/form6.ui b/qtsharp/src/uicsharp/tests/form6.ui index 7e67784c..bcc04572 100644 --- a/qtsharp/src/uicsharp/tests/form6.ui +++ b/qtsharp/src/uicsharp/tests/form6.ui @@ -1,6 +1,6 @@ MyDialog - + MyDialog @@ -19,14 +19,14 @@ unnamed - + Splitter1 Vertical - + Column 1 @@ -50,7 +50,7 @@ ListView1 - + New Item @@ -64,7 +64,7 @@ - + Layout5 @@ -78,7 +78,7 @@ 6 - + buttonOk @@ -95,7 +95,7 @@ true - + buttonCancel @@ -109,7 +109,7 @@ true - + buttonHelp diff --git a/qtsharp/src/uicsharp/tests/form7.ui b/qtsharp/src/uicsharp/tests/form7.ui index 6cf51c06..8d043b3a 100644 --- a/qtsharp/src/uicsharp/tests/form7.ui +++ b/qtsharp/src/uicsharp/tests/form7.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -12,7 +12,7 @@ 480 - + GroupBox3 @@ -27,7 +27,7 @@ GroupBox3 - + PushButton3 @@ -43,7 +43,7 @@ PushButton3 - + CheckBox10 @@ -59,7 +59,7 @@ CheckBox10 - + CheckBox11 @@ -76,7 +76,7 @@ - + GroupBox1 @@ -91,7 +91,7 @@ GroupBox1 - + CheckBox1 @@ -107,7 +107,7 @@ CheckBox1 - + CheckBox2 @@ -123,7 +123,7 @@ CheckBox2 - + CheckBox3 @@ -139,7 +139,7 @@ CheckBox3 - + CheckBox4 @@ -155,7 +155,7 @@ CheckBox4 - + CheckBox5 @@ -171,7 +171,7 @@ CheckBox5 - + CheckBox6 @@ -187,7 +187,7 @@ CheckBox6 - + CheckBox7 @@ -203,7 +203,7 @@ CheckBox7 - + CheckBox8 @@ -219,7 +219,7 @@ CheckBox8 - + CheckBox9 @@ -236,7 +236,7 @@ - + GroupBox2 @@ -251,7 +251,7 @@ GroupBox2 - + PushButton1 @@ -267,7 +267,7 @@ PushButton1 - + PushButton2 @@ -284,7 +284,7 @@ - + Frame3 @@ -302,7 +302,7 @@ Raised - + LineEdit1 @@ -315,7 +315,7 @@ - + New Item diff --git a/qtsharp/src/uicsharp/tests/form8.ui b/qtsharp/src/uicsharp/tests/form8.ui index 09f20bef..072b9977 100644 --- a/qtsharp/src/uicsharp/tests/form8.ui +++ b/qtsharp/src/uicsharp/tests/form8.ui @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -12,7 +12,7 @@ 480 - + PushButton1 @@ -28,7 +28,7 @@ PushButton1 - + RadioButton1 @@ -44,7 +44,7 @@ RadioButton1 - + CheckBox1 diff --git a/qtsharp/src/uicsharp/tests/form9.ui b/qtsharp/src/uicsharp/tests/form9.ui index b1e61488..3ba562c7 100644 --- a/qtsharp/src/uicsharp/tests/form9.ui +++ b/qtsharp/src/uicsharp/tests/form9.ui @@ -1,6 +1,6 @@ MyDialog1 - + MyDialog1 @@ -25,18 +25,18 @@ 6 - + tabWidget - + Widget8 Tab - + ComboBox1 @@ -49,7 +49,7 @@ - + New Item @@ -67,7 +67,7 @@ - + TextLabel1 @@ -84,7 +84,7 @@ - + Widget9 @@ -95,7 +95,7 @@ unnamed - + New Item @@ -105,7 +105,7 @@ ListBox2 - + TextEdit1 @@ -113,7 +113,7 @@ - + Layout1 @@ -127,7 +127,7 @@ 6 - + buttonHelp @@ -158,7 +158,7 @@ - + buttonOk @@ -175,7 +175,7 @@ true - + buttonCancel diff --git a/qtsharp/src/uicsharp/uicsharp.cs b/qtsharp/src/uicsharp/uicsharp.cs index 62a67757..32587f4b 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]; - TQApplication dummyapp=new TQApplication(dummyargs,false); + TTQApplication dummyapp=new TTQApplication(dummyargs,false); qtAssembly=Assembly.GetAssembly(dummyapp.GetType()); // qtAssembly=Assembly.Load("Qt.dll"); Console.WriteLine("CodeBase="+qtAssembly.CodeBase); @@ -216,7 +216,7 @@ namespace QtSharp { "\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\","+ "\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\",\"....###############...\","+ "\"......................\",\"......................\"};"); - writer.WriteLine("\tQPixmap {0};",el.GetAttribute("name")); + writer.WriteLine("\tTQPixmap {0};",el.GetAttribute("name")); } } @@ -225,11 +225,11 @@ namespace QtSharp { { if (menubarElement==null) return; writer.WriteLine("\t//Menubar member fields"); - writer.WriteLine("\t TQMenuBar menubar;"); + writer.WriteLine("\t TTQMenuBar menubar;"); foreach (XmlNode node in menubarElement.ChildNodes) { XmlElement el=node as XmlElement; if (el.Name=="item") { - writer.WriteLine("\tpublic TQPopupMenu {0};",el.GetAttribute("name")); + writer.WriteLine("\tpublic TTQPopupMenu {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 TQAction {0};",getName(el)); + writer.WriteLine("\tpublic TTQAction {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 TQToolBar {0};",getName(el)); + writer.WriteLine("\tpublic TTQToolBar {0};",getName(el)); } } } @@ -269,7 +269,7 @@ namespace QtSharp { if (submembernode.ParentNode!=widget) continue; // I think this is a workaround for a classlib bug XmlElement submember=submembernode as XmlElement; addSubMembers(submember); - if (submember.GetAttribute("class")=="QLayoutWidget") continue; //they are private + if (submember.GetAttribute("class")=="TQLayoutWidget") continue; //they are private String membername=getName(submember); if (membername==String.Empty) continue; writer.WriteLine("\t"+submember.GetAttribute("class")+" "+membername+";"); @@ -334,7 +334,7 @@ namespace QtSharp { tmp=tmp.NextSibling as XmlElement; String slot=tmp.InnerText; - writer.WriteLine("\t\tQObject.Connect({0},TQT_SIGNAL(\"{1}\"),{2},TQT_SLOT(\"{3}\"));", + writer.WriteLine("\t\tTQObject.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+"(TQWidget parent, String name) :base(parent, name) {"); + writer.WriteLine("\n\tpublic "+className+"(TTQWidget 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 TQPixmap({1}_data);", + writer.WriteLine("\t\t{0}=new TTQPixmap({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 TQAction(this,\"{1}\");",getName(action),getName(action)); + writer.WriteLine("\t\t{0}= new TTQAction(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 TQMenuBar(this,\"{1}\");",barname,barname); + writer.WriteLine("\t\t{0}=new TTQMenuBar(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 TQPopupMenu(this);",submenu_name); + writer.WriteLine("\t\t{0}=new TTQPopupMenu(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 TQToolBar(this,\"{1}\");",varname,varname); + writer.WriteLine("\t\t{0}=new TTQToolBar(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; @@ -442,7 +442,7 @@ namespace QtSharp { private ElementType elementType(XmlElement el) { switch (el.Name) { - case "widget": return (el.GetAttribute("class")=="QLayoutWidget")? + case "widget": return (el.GetAttribute("class")=="TQLayoutWidget")? ElementType.LayoutType:ElementType.WidgetType; case "vbox": return ElementType.LayoutType; case "hbox": return ElementType.LayoutType; @@ -473,7 +473,7 @@ namespace QtSharp { private void widgetAdd(String parname,XmlElement par, XmlElement obj) { if (par==widgetElement) { - if (par.GetAttribute("class")=="TQWizard") + if (par.GetAttribute("class")=="TTQWizard") { 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 "TQTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");"); + case "TTQTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");"); break; default: break; } @@ -575,10 +575,10 @@ namespace QtSharp { break; } } - writer.WriteLine("\t\tQSpacerItem {0}=new TQSpacerItem({1},{2},{3},{4});", + writer.WriteLine("\t\tTQSpacerItem {0}=new TTQSpacerItem({1},{2},{3},{4});", name,shx,shy, - (orientation=="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType)), - (orientation!="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType))); + (orientation=="VERTICAL")?"Qt.TTQSizePolicy.SizeType.Minimum":("Qt.TTQSizePolicy.SizeType."+toPascal(sizeType)), + (orientation!="VERTICAL")?"Qt.TTQSizePolicy.SizeType.Minimum":("Qt.TTQSizePolicy.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?"TQVBoxLayout ":"")+name+"= new TQVBoxLayout("+ + case "vbox": writer.WriteLine("\t\t"+(privateLayout?"TTQVBoxLayout ":"")+name+"= new TTQVBoxLayout("+ ((parent==null)?"":parent)+");"); setupLayout(name,obj); return obj; - case "hbox": writer.WriteLine("\t\t"+(privateLayout?"TQHBoxLayout ":"")+name+"= new TQHBoxLayout("+ + case "hbox": writer.WriteLine("\t\t"+(privateLayout?"TTQHBoxLayout ":"")+name+"= new TTQHBoxLayout("+ ((parent==null)?"":parent)+");"); setupLayout(name,obj); return obj; @@ -647,7 +647,7 @@ namespace QtSharp { rows=(tmprows