qtbindings 4.6.3.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1225) hide show
  1. data/CHANGELOG.txt +9 -0
  2. data/CMakeLists.txt +22 -0
  3. data/COPYING.LIB.txt +510 -0
  4. data/COPYING.txt +286 -0
  5. data/KNOWN_ISSUES.txt +20 -0
  6. data/README.txt +92 -0
  7. data/Rakefile +96 -0
  8. data/TODO.txt +2 -0
  9. data/bin/1.8/rbrcc.exe +0 -0
  10. data/bin/1.8/rbuic4.exe +0 -0
  11. data/bin/1.8/smokeapi.exe +0 -0
  12. data/bin/1.8/smokedeptool.exe +0 -0
  13. data/bin/1.9/rbrcc.exe +0 -0
  14. data/bin/1.9/rbuic4.exe +0 -0
  15. data/bin/1.9/smokeapi.exe +0 -0
  16. data/bin/1.9/smokedeptool.exe +0 -0
  17. data/bin/Qt3Support4.dll +0 -0
  18. data/bin/QtAssistantClient4.dll +0 -0
  19. data/bin/QtCLucene4.dll +0 -0
  20. data/bin/QtCore4.dll +0 -0
  21. data/bin/QtDesigner4.dll +0 -0
  22. data/bin/QtDesignerComponents4.dll +0 -0
  23. data/bin/QtGui4.dll +0 -0
  24. data/bin/QtHelp4.dll +0 -0
  25. data/bin/QtMultimedia4.dll +0 -0
  26. data/bin/QtNetwork4.dll +0 -0
  27. data/bin/QtOpenGL4.dll +0 -0
  28. data/bin/QtScript4.dll +0 -0
  29. data/bin/QtScriptTools4.dll +0 -0
  30. data/bin/QtSql4.dll +0 -0
  31. data/bin/QtSvg4.dll +0 -0
  32. data/bin/QtTest4.dll +0 -0
  33. data/bin/QtWebKit4.dll +0 -0
  34. data/bin/QtXml4.dll +0 -0
  35. data/bin/QtXmlPatterns4.dll +0 -0
  36. data/bin/libgcc_s_dw2-1.dll +0 -0
  37. data/bin/mingwm10.dll +0 -0
  38. data/bin/phonon4.dll +0 -0
  39. data/bin/plugins/arthurplugin.dll +0 -0
  40. data/bin/plugins/containerextension.dll +0 -0
  41. data/bin/plugins/customwidgetplugin.dll +0 -0
  42. data/bin/plugins/phononwidgets.dll +0 -0
  43. data/bin/plugins/qcncodecs4.dll +0 -0
  44. data/bin/plugins/qgif4.dll +0 -0
  45. data/bin/plugins/qglgraphicssystem4.dll +0 -0
  46. data/bin/plugins/qico4.dll +0 -0
  47. data/bin/plugins/qjpcodecs4.dll +0 -0
  48. data/bin/plugins/qjpeg4.dll +0 -0
  49. data/bin/plugins/qkrcodecs4.dll +0 -0
  50. data/bin/plugins/qmng4.dll +0 -0
  51. data/bin/plugins/qsqlite4.dll +0 -0
  52. data/bin/plugins/qsqlodbc4.dll +0 -0
  53. data/bin/plugins/qsvg4.dll +0 -0
  54. data/bin/plugins/qsvgicon4.dll +0 -0
  55. data/bin/plugins/qt3supportwidgets.dll +0 -0
  56. data/bin/plugins/qtaccessiblecompatwidgets4.dll +0 -0
  57. data/bin/plugins/qtaccessiblewidgets4.dll +0 -0
  58. data/bin/plugins/qtiff4.dll +0 -0
  59. data/bin/plugins/qtracegraphicssystem4.dll +0 -0
  60. data/bin/plugins/qtwcodecs4.dll +0 -0
  61. data/bin/plugins/qwebview.dll +0 -0
  62. data/bin/plugins/taskmenuextension.dll +0 -0
  63. data/bin/plugins/worldtimeclockplugin.dll +0 -0
  64. data/bin/rbqtapi +152 -0
  65. data/bin/rbrcc +18 -0
  66. data/bin/rbuic4 +18 -0
  67. data/bin/smokeapi +18 -0
  68. data/bin/smokedeptool +18 -0
  69. data/examples/base/kicons.rb +54 -0
  70. data/examples/base/rui.rb +21 -0
  71. data/examples/designer/calculatorbuilder/calculatorbuilder.qrc +5 -0
  72. data/examples/designer/calculatorbuilder/calculatorform.rb +60 -0
  73. data/examples/designer/calculatorbuilder/calculatorform.ui +299 -0
  74. data/examples/designer/calculatorbuilder/main.rb +34 -0
  75. data/examples/designer/calculatorbuilder/makefile +2 -0
  76. data/examples/designer/calculatorform/calculatorform.rb +46 -0
  77. data/examples/designer/calculatorform/calculatorform.ui +277 -0
  78. data/examples/designer/calculatorform/main.rb +32 -0
  79. data/examples/designer/calculatorform/makefile +3 -0
  80. data/examples/desktop/screenshot/main.rb +32 -0
  81. data/examples/desktop/screenshot/screenshot.rb +156 -0
  82. data/examples/desktop/systray/images/bad.svg +64 -0
  83. data/examples/desktop/systray/images/heart.svg +55 -0
  84. data/examples/desktop/systray/images/trash.svg +58 -0
  85. data/examples/desktop/systray/main.rb +41 -0
  86. data/examples/desktop/systray/makefile +2 -0
  87. data/examples/desktop/systray/systray.qrc +7 -0
  88. data/examples/desktop/systray/window.rb +223 -0
  89. data/examples/dialogs/complexwizard/complexwizard.rb +140 -0
  90. data/examples/dialogs/complexwizard/licensewizard.rb +294 -0
  91. data/examples/dialogs/complexwizard/main.rb +31 -0
  92. data/examples/dialogs/configdialog/configdialog.rb +109 -0
  93. data/examples/dialogs/configdialog/images/config.png +0 -0
  94. data/examples/dialogs/configdialog/images/query.png +0 -0
  95. data/examples/dialogs/configdialog/images/update.png +0 -0
  96. data/examples/dialogs/configdialog/main.rb +31 -0
  97. data/examples/dialogs/configdialog/pages.rb +140 -0
  98. data/examples/dialogs/extension/finddialog.rb +89 -0
  99. data/examples/dialogs/extension/main.rb +31 -0
  100. data/examples/dialogs/findfiles/main.rb +32 -0
  101. data/examples/dialogs/findfiles/window.rb +177 -0
  102. data/examples/dialogs/simplewizard/classwizard.rb +374 -0
  103. data/examples/dialogs/simplewizard/main.rb +31 -0
  104. data/examples/dialogs/simplewizard/simplewizard.rb +110 -0
  105. data/examples/dialogs/standarddialogs/dialog.rb +340 -0
  106. data/examples/dialogs/standarddialogs/main.rb +31 -0
  107. data/examples/dialogs/tabdialog/main.rb +38 -0
  108. data/examples/dialogs/tabdialog/tabdialog.rb +178 -0
  109. data/examples/draganddrop/draggableicons/dragwidget.rb +125 -0
  110. data/examples/draganddrop/draggableicons/images/boat.png +0 -0
  111. data/examples/draganddrop/draggableicons/images/car.png +0 -0
  112. data/examples/draganddrop/draggableicons/images/house.png +0 -0
  113. data/examples/draganddrop/draggableicons/main.rb +41 -0
  114. data/examples/draganddrop/draggabletext/draglabel.rb +51 -0
  115. data/examples/draganddrop/draggabletext/dragwidget.rb +94 -0
  116. data/examples/draganddrop/draggabletext/main.rb +33 -0
  117. data/examples/draganddrop/draggabletext/words.txt +41 -0
  118. data/examples/draganddrop/dropsite/dropsitewidget.rb +98 -0
  119. data/examples/draganddrop/dropsite/dropsitewindow.rb +114 -0
  120. data/examples/draganddrop/dropsite/main.rb +33 -0
  121. data/examples/draganddrop/fridgemagnets/draglabel.rb +78 -0
  122. data/examples/draganddrop/fridgemagnets/dragwidget.rb +130 -0
  123. data/examples/draganddrop/fridgemagnets/main.rb +33 -0
  124. data/examples/draganddrop/fridgemagnets/words.txt +48 -0
  125. data/examples/draganddrop/puzzle/example.jpg +0 -0
  126. data/examples/draganddrop/puzzle/main.rb +33 -0
  127. data/examples/draganddrop/puzzle/mainwindow.rb +136 -0
  128. data/examples/draganddrop/puzzle/pieceslist.rb +95 -0
  129. data/examples/draganddrop/puzzle/puzzlewidget.rb +190 -0
  130. data/examples/graphicsview/collidingmice/images/cheese.jpg +0 -0
  131. data/examples/graphicsview/collidingmice/main.rb +53 -0
  132. data/examples/graphicsview/collidingmice/makefile +2 -0
  133. data/examples/graphicsview/collidingmice/mice.qrc +5 -0
  134. data/examples/graphicsview/collidingmice/mouse.rb +176 -0
  135. data/examples/graphicsview/dragdroprobot/coloritem.rb +86 -0
  136. data/examples/graphicsview/dragdroprobot/images/head.png +0 -0
  137. data/examples/graphicsview/dragdroprobot/main.rb +57 -0
  138. data/examples/graphicsview/dragdroprobot/makefile +2 -0
  139. data/examples/graphicsview/dragdroprobot/robot.qrc +5 -0
  140. data/examples/graphicsview/dragdroprobot/robot.rb +246 -0
  141. data/examples/itemviews/chart/chart.qrc +5 -0
  142. data/examples/itemviews/chart/main.rb +33 -0
  143. data/examples/itemviews/chart/mainwindow.rb +151 -0
  144. data/examples/itemviews/chart/makefile +2 -0
  145. data/examples/itemviews/chart/mydata.cht +8 -0
  146. data/examples/itemviews/chart/pieview.rb +516 -0
  147. data/examples/itemviews/chart/qtdata.cht +14 -0
  148. data/examples/itemviews/dirview/main.rb +39 -0
  149. data/examples/itemviews/pixelator/imagemodel.rb +51 -0
  150. data/examples/itemviews/pixelator/images.qrc +5 -0
  151. data/examples/itemviews/pixelator/images/qt.png +0 -0
  152. data/examples/itemviews/pixelator/main.rb +34 -0
  153. data/examples/itemviews/pixelator/mainwindow.rb +218 -0
  154. data/examples/itemviews/pixelator/makefile +3 -0
  155. data/examples/itemviews/pixelator/pixeldelegate.rb +67 -0
  156. data/examples/itemviews/puzzle/example.jpg +0 -0
  157. data/examples/itemviews/puzzle/main.rb +36 -0
  158. data/examples/itemviews/puzzle/mainwindow.rb +143 -0
  159. data/examples/itemviews/puzzle/piecesmodel.rb +174 -0
  160. data/examples/itemviews/puzzle/puzzlewidget.rb +192 -0
  161. data/examples/itemviews/simpledommodel/domitem.rb +62 -0
  162. data/examples/itemviews/simpledommodel/dommodel.rb +139 -0
  163. data/examples/itemviews/simpledommodel/main.rb +33 -0
  164. data/examples/itemviews/simpledommodel/mainwindow.rb +66 -0
  165. data/examples/itemviews/simpletreemodel/default.txt +40 -0
  166. data/examples/itemviews/simpletreemodel/main.rb +41 -0
  167. data/examples/itemviews/simpletreemodel/makefile +2 -0
  168. data/examples/itemviews/simpletreemodel/simpletreemodel.qrc +5 -0
  169. data/examples/itemviews/simpletreemodel/treeitem.rb +67 -0
  170. data/examples/itemviews/simpletreemodel/treemodel.rb +164 -0
  171. data/examples/itemviews/sortingmodel/default.txt +40 -0
  172. data/examples/itemviews/sortingmodel/main.rb +53 -0
  173. data/examples/itemviews/sortingmodel/treeitem.rb +73 -0
  174. data/examples/itemviews/sortingmodel/treemodel.rb +166 -0
  175. data/examples/itemviews/spinboxdelegate/main.rb +47 -0
  176. data/examples/itemviews/spinboxdelegate/spinboxdelegate.rb +62 -0
  177. data/examples/killerfilter/killerfilter.rb +55 -0
  178. data/examples/layouts/basiclayouts/dialog.rb +110 -0
  179. data/examples/layouts/basiclayouts/main.rb +31 -0
  180. data/examples/layouts/borderlayout/borderlayout.rb +190 -0
  181. data/examples/layouts/borderlayout/main.rb +32 -0
  182. data/examples/layouts/borderlayout/window.rb +52 -0
  183. data/examples/layouts/flowlayouts/flowlayout.rb +108 -0
  184. data/examples/layouts/flowlayouts/main.rb +32 -0
  185. data/examples/layouts/flowlayouts/window.rb +43 -0
  186. data/examples/mainwindows/application/images/copy.png +0 -0
  187. data/examples/mainwindows/application/images/cut.png +0 -0
  188. data/examples/mainwindows/application/images/new.png +0 -0
  189. data/examples/mainwindows/application/images/open.png +0 -0
  190. data/examples/mainwindows/application/images/paste.png +0 -0
  191. data/examples/mainwindows/application/images/save.png +0 -0
  192. data/examples/mainwindows/application/main.rb +32 -0
  193. data/examples/mainwindows/application/mainwindow.rb +285 -0
  194. data/examples/mainwindows/dockwidgets/images/new.png +0 -0
  195. data/examples/mainwindows/dockwidgets/images/print.png +0 -0
  196. data/examples/mainwindows/dockwidgets/images/save.png +0 -0
  197. data/examples/mainwindows/dockwidgets/images/undo.png +0 -0
  198. data/examples/mainwindows/dockwidgets/main.rb +32 -0
  199. data/examples/mainwindows/dockwidgets/mainwindow.rb +302 -0
  200. data/examples/mainwindows/mdi/images/copy.png +0 -0
  201. data/examples/mainwindows/mdi/images/cut.png +0 -0
  202. data/examples/mainwindows/mdi/images/new.png +0 -0
  203. data/examples/mainwindows/mdi/images/open.png +0 -0
  204. data/examples/mainwindows/mdi/images/paste.png +0 -0
  205. data/examples/mainwindows/mdi/images/save.png +0 -0
  206. data/examples/mainwindows/mdi/main.rb +32 -0
  207. data/examples/mainwindows/mdi/mainwindow.rb +363 -0
  208. data/examples/mainwindows/mdi/mdichild.rb +152 -0
  209. data/examples/mainwindows/menus/main.rb +32 -0
  210. data/examples/mainwindows/menus/mainwindow.rb +327 -0
  211. data/examples/mainwindows/recentfiles/main.rb +32 -0
  212. data/examples/mainwindows/recentfiles/mainwindow.rb +258 -0
  213. data/examples/mainwindows/sdi/images/copy.png +0 -0
  214. data/examples/mainwindows/sdi/images/cut.png +0 -0
  215. data/examples/mainwindows/sdi/images/new.png +0 -0
  216. data/examples/mainwindows/sdi/images/open.png +0 -0
  217. data/examples/mainwindows/sdi/images/paste.png +0 -0
  218. data/examples/mainwindows/sdi/images/save.png +0 -0
  219. data/examples/mainwindows/sdi/main.rb +32 -0
  220. data/examples/mainwindows/sdi/mainwindow.rb +335 -0
  221. data/examples/network/broadcastreceiver/main.rb +32 -0
  222. data/examples/network/broadcastreceiver/receiver.rb +64 -0
  223. data/examples/network/broadcastsender/main.rb +32 -0
  224. data/examples/network/broadcastsender/sender.rb +70 -0
  225. data/examples/network/fortuneclient/client.rb +150 -0
  226. data/examples/network/fortuneclient/main.rb +32 -0
  227. data/examples/network/fortuneserver/main.rb +32 -0
  228. data/examples/network/fortuneserver/server.rb +88 -0
  229. data/examples/network/ftp/ftpwindow.rb +254 -0
  230. data/examples/network/ftp/images/cdtoparent.png +0 -0
  231. data/examples/network/ftp/images/dir.png +0 -0
  232. data/examples/network/ftp/images/file.png +0 -0
  233. data/examples/network/ftp/main.rb +32 -0
  234. data/examples/network/http/httpwindow.rb +187 -0
  235. data/examples/network/http/main.rb +32 -0
  236. data/examples/network/loopback/dialog.rb +163 -0
  237. data/examples/network/loopback/main.rb +32 -0
  238. data/examples/opengl/grabber/glwidget.rb +265 -0
  239. data/examples/opengl/grabber/main.rb +32 -0
  240. data/examples/opengl/grabber/mainwindow.rb +189 -0
  241. data/examples/opengl/hellogl/glwidget.rb +226 -0
  242. data/examples/opengl/hellogl/main.rb +32 -0
  243. data/examples/opengl/hellogl/window.rb +66 -0
  244. data/examples/opengl/textures/glwidget.rb +151 -0
  245. data/examples/opengl/textures/images/side1.png +0 -0
  246. data/examples/opengl/textures/images/side2.png +0 -0
  247. data/examples/opengl/textures/images/side3.png +0 -0
  248. data/examples/opengl/textures/images/side4.png +0 -0
  249. data/examples/opengl/textures/images/side5.png +0 -0
  250. data/examples/opengl/textures/images/side6.png +0 -0
  251. data/examples/opengl/textures/main.rb +32 -0
  252. data/examples/opengl/textures/window.rb +77 -0
  253. data/examples/painting/basicdrawing/images/brick.png +0 -0
  254. data/examples/painting/basicdrawing/images/qt-logo.png +0 -0
  255. data/examples/painting/basicdrawing/main.rb +32 -0
  256. data/examples/painting/basicdrawing/renderarea.rb +166 -0
  257. data/examples/painting/basicdrawing/window.rb +215 -0
  258. data/examples/painting/concentriccircles/circlewidget.rb +88 -0
  259. data/examples/painting/concentriccircles/main.rb +32 -0
  260. data/examples/painting/concentriccircles/window.rb +72 -0
  261. data/examples/painting/fontsampler/main.rb +32 -0
  262. data/examples/painting/fontsampler/mainwindow.rb +368 -0
  263. data/examples/painting/fontsampler/mainwindowbase.ui +136 -0
  264. data/examples/painting/fontsampler/makefile +8 -0
  265. data/examples/painting/fontsampler/previewdialog.rb +256 -0
  266. data/examples/painting/fontsampler/previewdialogbase.ui +224 -0
  267. data/examples/painting/fontsampler/previewlabel.rb +43 -0
  268. data/examples/painting/imagecomposition/imagecomposer.rb +152 -0
  269. data/examples/painting/imagecomposition/imagecomposition.qrc +6 -0
  270. data/examples/painting/imagecomposition/images/background.png +0 -0
  271. data/examples/painting/imagecomposition/images/blackrectangle.png +0 -0
  272. data/examples/painting/imagecomposition/images/butterfly.png +0 -0
  273. data/examples/painting/imagecomposition/images/checker.png +0 -0
  274. data/examples/painting/imagecomposition/main.rb +33 -0
  275. data/examples/painting/imagecomposition/makefile +2 -0
  276. data/examples/painting/painterpaths/main.rb +32 -0
  277. data/examples/painting/painterpaths/renderarea.rb +97 -0
  278. data/examples/painting/painterpaths/window.rb +247 -0
  279. data/examples/painting/svgviewer/files/bubbles.svg +212 -0
  280. data/examples/painting/svgviewer/files/cubic.svg +77 -0
  281. data/examples/painting/svgviewer/files/spheres.svg +79 -0
  282. data/examples/painting/svgviewer/main.rb +38 -0
  283. data/examples/painting/svgviewer/mainwindow.rb +99 -0
  284. data/examples/painting/svgviewer/makefile +2 -0
  285. data/examples/painting/svgviewer/svgview.rb +156 -0
  286. data/examples/painting/svgviewer/svgviewer.qrc +6 -0
  287. data/examples/painting/svgviewer/svgwindow.rb +87 -0
  288. data/examples/painting/transformations/main.rb +32 -0
  289. data/examples/painting/transformations/renderarea.rb +127 -0
  290. data/examples/painting/transformations/window.rb +153 -0
  291. data/examples/passivepopup/passivepopup.rb +38 -0
  292. data/examples/qdbus/chat/chat.rb +146 -0
  293. data/examples/qdbus/chat/chat_adaptor.rb +12 -0
  294. data/examples/qdbus/chat/chat_interface.rb +13 -0
  295. data/examples/qdbus/chat/chatmainwindow.ui +184 -0
  296. data/examples/qdbus/chat/chatsetnickname.ui +145 -0
  297. data/examples/qdbus/chat/makefile +8 -0
  298. data/examples/qdbus/complexpingpong/complexping.rb +92 -0
  299. data/examples/qdbus/complexpingpong/complexpong.rb +83 -0
  300. data/examples/qdbus/complexpingpong/ping-common.rb +1 -0
  301. data/examples/qdbus/listnames/listnames.rb +69 -0
  302. data/examples/qdbus/pingpong/ping-common.rb +1 -0
  303. data/examples/qdbus/pingpong/ping.rb +52 -0
  304. data/examples/qdbus/pingpong/pong.rb +55 -0
  305. data/examples/qdbus/remotecontrolledcar/car/car.rb +151 -0
  306. data/examples/qdbus/remotecontrolledcar/car/main.rb +50 -0
  307. data/examples/qdbus/remotecontrolledcar/controller/controller.rb +66 -0
  308. data/examples/qdbus/remotecontrolledcar/controller/controller.ui +61 -0
  309. data/examples/qdbus/remotecontrolledcar/controller/main.rb +32 -0
  310. data/examples/qdbus/remotecontrolledcar/controller/makefile +2 -0
  311. data/examples/qtscribble/scribble.rb +270 -0
  312. data/examples/richtext/calendar/main.rb +33 -0
  313. data/examples/richtext/calendar/mainwindow.rb +173 -0
  314. data/examples/richtext/orderform/detailsdialog.rb +130 -0
  315. data/examples/richtext/orderform/main.rb +34 -0
  316. data/examples/richtext/orderform/mainwindow.rb +194 -0
  317. data/examples/richtext/syntaxhighlighter/examples/example +79 -0
  318. data/examples/richtext/syntaxhighlighter/highlighter.rb +90 -0
  319. data/examples/richtext/syntaxhighlighter/main.rb +34 -0
  320. data/examples/richtext/syntaxhighlighter/mainwindow.rb +105 -0
  321. data/examples/ruboids/Manifest +26 -0
  322. data/examples/ruboids/README +53 -0
  323. data/examples/ruboids/TODO +29 -0
  324. data/examples/ruboids/boids.properties +33 -0
  325. data/examples/ruboids/generateManifest.rb +42 -0
  326. data/examples/ruboids/index.html +147 -0
  327. data/examples/ruboids/release.rb +152 -0
  328. data/examples/ruboids/ruboids/Boid.rb +141 -0
  329. data/examples/ruboids/ruboids/BoidView.rb +159 -0
  330. data/examples/ruboids/ruboids/Camera.rb +24 -0
  331. data/examples/ruboids/ruboids/CameraDialog.rb +218 -0
  332. data/examples/ruboids/ruboids/Canvas.rb +143 -0
  333. data/examples/ruboids/ruboids/Cloud.rb +61 -0
  334. data/examples/ruboids/ruboids/CloudView.rb +54 -0
  335. data/examples/ruboids/ruboids/Flock.rb +47 -0
  336. data/examples/ruboids/ruboids/Graphics.rb +278 -0
  337. data/examples/ruboids/ruboids/Params.rb +87 -0
  338. data/examples/ruboids/ruboids/Point.rb +153 -0
  339. data/examples/ruboids/ruboids/Thing.rb +34 -0
  340. data/examples/ruboids/ruboids/Triangle.rb +21 -0
  341. data/examples/ruboids/ruboids/View.rb +88 -0
  342. data/examples/ruboids/ruboids/World.rb +82 -0
  343. data/examples/ruboids/ruboids/WorldWindow.rb +52 -0
  344. data/examples/ruboids/ruboids/info.rb +12 -0
  345. data/examples/ruboids/ruboids/ruboids.rb +29 -0
  346. data/examples/run_all.rb +14 -0
  347. data/examples/textedit/textedit.rb +150 -0
  348. data/examples/tutorial/t1/t1.rb +10 -0
  349. data/examples/tutorial/t10/cannon.rb +72 -0
  350. data/examples/tutorial/t10/lcdrange.rb +45 -0
  351. data/examples/tutorial/t10/t10.rb +55 -0
  352. data/examples/tutorial/t11/cannon.rb +124 -0
  353. data/examples/tutorial/t11/lcdrange.rb +45 -0
  354. data/examples/tutorial/t11/t11.rb +65 -0
  355. data/examples/tutorial/t12/cannon.rb +158 -0
  356. data/examples/tutorial/t12/lcdrange.rb +59 -0
  357. data/examples/tutorial/t12/t12.rb +66 -0
  358. data/examples/tutorial/t13/cannon.rb +208 -0
  359. data/examples/tutorial/t13/gamebrd.rb +113 -0
  360. data/examples/tutorial/t13/lcdrange.rb +60 -0
  361. data/examples/tutorial/t13/t13.rb +11 -0
  362. data/examples/tutorial/t14/cannon.rb +263 -0
  363. data/examples/tutorial/t14/gamebrd.rb +123 -0
  364. data/examples/tutorial/t14/lcdrange.rb +63 -0
  365. data/examples/tutorial/t14/t14.rb +11 -0
  366. data/examples/tutorial/t2/t2.rb +16 -0
  367. data/examples/tutorial/t3/t3.rb +18 -0
  368. data/examples/tutorial/t4/t4.rb +25 -0
  369. data/examples/tutorial/t5/t5.rb +37 -0
  370. data/examples/tutorial/t6/t6.rb +52 -0
  371. data/examples/tutorial/t7/lcdrange.rb +32 -0
  372. data/examples/tutorial/t7/t7.rb +42 -0
  373. data/examples/tutorial/t8/cannon.rb +38 -0
  374. data/examples/tutorial/t8/lcdrange.rb +45 -0
  375. data/examples/tutorial/t8/t8.rb +43 -0
  376. data/examples/tutorial/t9/cannon.rb +45 -0
  377. data/examples/tutorial/t9/lcdrange.rb +46 -0
  378. data/examples/tutorial/t9/t9.rb +43 -0
  379. data/examples/widgets/analogclock/analogclock.rb +94 -0
  380. data/examples/widgets/analogclock/main.rb +9 -0
  381. data/examples/widgets/calculator/button.rb +45 -0
  382. data/examples/widgets/calculator/calculator.rb +382 -0
  383. data/examples/widgets/calculator/main.rb +32 -0
  384. data/examples/widgets/charactermap/characterwidget.rb +110 -0
  385. data/examples/widgets/charactermap/main.rb +32 -0
  386. data/examples/widgets/charactermap/mainwindow.rb +118 -0
  387. data/examples/widgets/digitalclock/digitalclock.rb +30 -0
  388. data/examples/widgets/digitalclock/main.rb +9 -0
  389. data/examples/widgets/groupbox/main.rb +32 -0
  390. data/examples/widgets/groupbox/window.rb +134 -0
  391. data/examples/widgets/icons/iconpreviewarea.rb +111 -0
  392. data/examples/widgets/icons/iconsizespinbox.rb +39 -0
  393. data/examples/widgets/icons/imagedelegate.rb +73 -0
  394. data/examples/widgets/icons/images/designer.png +0 -0
  395. data/examples/widgets/icons/images/find_disabled.png +0 -0
  396. data/examples/widgets/icons/images/find_normal.png +0 -0
  397. data/examples/widgets/icons/images/monkey_off_128x128.png +0 -0
  398. data/examples/widgets/icons/images/monkey_off_16x16.png +0 -0
  399. data/examples/widgets/icons/images/monkey_off_32x32.png +0 -0
  400. data/examples/widgets/icons/images/monkey_off_64x64.png +0 -0
  401. data/examples/widgets/icons/images/monkey_on_128x128.png +0 -0
  402. data/examples/widgets/icons/images/monkey_on_16x16.png +0 -0
  403. data/examples/widgets/icons/images/monkey_on_32x32.png +0 -0
  404. data/examples/widgets/icons/images/monkey_on_64x64.png +0 -0
  405. data/examples/widgets/icons/images/qtopia_16x16.png +0 -0
  406. data/examples/widgets/icons/images/qtopia_32x32.png +0 -0
  407. data/examples/widgets/icons/images/qtopia_48x48.png +0 -0
  408. data/examples/widgets/icons/main.rb +32 -0
  409. data/examples/widgets/icons/mainwindow.rb +351 -0
  410. data/examples/widgets/imageviewer/imageviewer.rb +219 -0
  411. data/examples/widgets/imageviewer/main.rb +32 -0
  412. data/examples/widgets/lineedits/main.rb +32 -0
  413. data/examples/widgets/lineedits/window.rb +199 -0
  414. data/examples/widgets/movie/images/open.png +0 -0
  415. data/examples/widgets/movie/images/pause.png +0 -0
  416. data/examples/widgets/movie/images/play.png +0 -0
  417. data/examples/widgets/movie/images/quit.png +0 -0
  418. data/examples/widgets/movie/images/stop.png +0 -0
  419. data/examples/widgets/movie/main.rb +32 -0
  420. data/examples/widgets/movie/movieplayer.rb +201 -0
  421. data/examples/widgets/movie/movies/fire.mng +0 -0
  422. data/examples/widgets/screenshot/main.rb +32 -0
  423. data/examples/widgets/screenshot/screenshot.rb +155 -0
  424. data/examples/widgets/scribble/main.rb +32 -0
  425. data/examples/widgets/scribble/mainwindow.rb +202 -0
  426. data/examples/widgets/scribble/scribblearea.rb +154 -0
  427. data/examples/widgets/sliders/main.rb +32 -0
  428. data/examples/widgets/sliders/slidersgroup.rb +97 -0
  429. data/examples/widgets/sliders/window.rb +124 -0
  430. data/examples/widgets/spinboxes/main.rb +32 -0
  431. data/examples/widgets/spinboxes/window.rb +213 -0
  432. data/examples/widgets/tetrix/main.rb +33 -0
  433. data/examples/widgets/tetrix/tetrixboard.rb +346 -0
  434. data/examples/widgets/tetrix/tetrixpiece.rb +135 -0
  435. data/examples/widgets/tetrix/tetrixwindow.rb +88 -0
  436. data/examples/widgets/tooltips/images/circle.png +0 -0
  437. data/examples/widgets/tooltips/images/square.png +0 -0
  438. data/examples/widgets/tooltips/images/triangle.png +0 -0
  439. data/examples/widgets/tooltips/main.rb +32 -0
  440. data/examples/widgets/tooltips/shapeitem.rb +31 -0
  441. data/examples/widgets/tooltips/sortingbox.rb +222 -0
  442. data/examples/widgets/wiggly/dialog.rb +48 -0
  443. data/examples/widgets/wiggly/main.rb +9 -0
  444. data/examples/widgets/wiggly/wigglywidget.rb +76 -0
  445. data/examples/widgets/windowflags/controllerwindow.rb +195 -0
  446. data/examples/widgets/windowflags/main.rb +32 -0
  447. data/examples/widgets/windowflags/previewwindow.rb +103 -0
  448. data/examples/xml/dombookmarks/frank.xbel +230 -0
  449. data/examples/xml/dombookmarks/jennifer.xbel +93 -0
  450. data/examples/xml/dombookmarks/main.rb +34 -0
  451. data/examples/xml/dombookmarks/mainwindow.rb +129 -0
  452. data/examples/xml/dombookmarks/xbeltree.rb +172 -0
  453. data/examples/xml/saxbookmarks/frank.xbel +230 -0
  454. data/examples/xml/saxbookmarks/jennifer.xbel +93 -0
  455. data/examples/xml/saxbookmarks/main.rb +34 -0
  456. data/examples/xml/saxbookmarks/mainwindow.rb +144 -0
  457. data/examples/xml/saxbookmarks/xbelgenerator.rb +95 -0
  458. data/examples/xml/saxbookmarks/xbelhandler.rb +122 -0
  459. data/ext/CMakeLists.txt +22 -0
  460. data/ext/cmake/modules/CMakeCSharpCompiler.cmake.in +7 -0
  461. data/ext/cmake/modules/CMakeCSharpInformation.cmake +366 -0
  462. data/ext/cmake/modules/CMakeDetermineCSharpCompiler.cmake +85 -0
  463. data/ext/cmake/modules/CMakeTestCSharpCompiler.cmake +1 -0
  464. data/ext/cmake/modules/CheckCXXSourceCompiles.cmake +68 -0
  465. data/ext/cmake/modules/FindMono.cmake +36 -0
  466. data/ext/cmake/modules/FindPHP5.cmake +179 -0
  467. data/ext/cmake/modules/FindPerlMore.cmake +78 -0
  468. data/ext/cmake/modules/FindQScintilla.cmake +57 -0
  469. data/ext/cmake/modules/FindQt4.cmake +1271 -0
  470. data/ext/cmake/modules/FindQwt5.cmake +104 -0
  471. data/ext/cmake/modules/FindRuby.cmake +261 -0
  472. data/ext/cmake/modules/FindSmoke.cmake +78 -0
  473. data/ext/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake +85 -0
  474. data/ext/cmake/modules/MacroLogFeature.cmake +146 -0
  475. data/ext/cmake/modules/MacroOptionalAddBindings.cmake +47 -0
  476. data/ext/cmake/modules/MacroOptionalFindPackage.cmake +48 -0
  477. data/ext/cmake/modules/MacroPushRequiredVars.cmake +47 -0
  478. data/ext/cmake/modules/Qt4ConfigDependentSettings.cmake +384 -0
  479. data/ext/cmake/modules/Qt4Macros.cmake +414 -0
  480. data/ext/generator/CMakeLists.txt +38 -0
  481. data/ext/generator/generator_export.h +31 -0
  482. data/ext/generator/generatorenvironment.cpp +52 -0
  483. data/ext/generator/generatorenvironment.h +35 -0
  484. data/ext/generator/generatorpreprocessor.cpp +242 -0
  485. data/ext/generator/generatorpreprocessor.h +83 -0
  486. data/ext/generator/generators/CMakeLists.txt +4 -0
  487. data/ext/generator/generators/dump/CMakeLists.txt +10 -0
  488. data/ext/generator/generators/dump/generator_dump.cpp +36 -0
  489. data/ext/generator/generators/smoke/CMakeLists.txt +13 -0
  490. data/ext/generator/generators/smoke/generator_smoke.cpp +233 -0
  491. data/ext/generator/generators/smoke/globals.h +138 -0
  492. data/ext/generator/generators/smoke/helpers.cpp +773 -0
  493. data/ext/generator/generators/smoke/writeClasses.cpp +502 -0
  494. data/ext/generator/generators/smoke/writeSmokeDataFile.cpp +729 -0
  495. data/ext/generator/generatorvisitor.cpp +922 -0
  496. data/ext/generator/generatorvisitor.h +119 -0
  497. data/ext/generator/main.cpp +239 -0
  498. data/ext/generator/name_compiler.cpp +205 -0
  499. data/ext/generator/name_compiler.h +76 -0
  500. data/ext/generator/options.cpp +32 -0
  501. data/ext/generator/options.h +45 -0
  502. data/ext/generator/parser/CMakeLists.txt +41 -0
  503. data/ext/generator/parser/ast.cpp +21 -0
  504. data/ext/generator/parser/ast.h +923 -0
  505. data/ext/generator/parser/astutilities.h +65 -0
  506. data/ext/generator/parser/codegenerator.cpp +867 -0
  507. data/ext/generator/parser/codegenerator.h +180 -0
  508. data/ext/generator/parser/codemodel_fwd.h +76 -0
  509. data/ext/generator/parser/commentformatter.cpp +54 -0
  510. data/ext/generator/parser/commentformatter.h +45 -0
  511. data/ext/generator/parser/commentparser.cpp +109 -0
  512. data/ext/generator/parser/commentparser.h +84 -0
  513. data/ext/generator/parser/control.cpp +40 -0
  514. data/ext/generator/parser/control.h +51 -0
  515. data/ext/generator/parser/cppparser_export.h +33 -0
  516. data/ext/generator/parser/default_visitor.cpp +470 -0
  517. data/ext/generator/parser/default_visitor.h +116 -0
  518. data/ext/generator/parser/dumptree.cpp +146 -0
  519. data/ext/generator/parser/dumptree.h +50 -0
  520. data/ext/generator/parser/indexedstring.cpp +213 -0
  521. data/ext/generator/parser/indexedstring.h +147 -0
  522. data/ext/generator/parser/kdevelop-parser-rev +1 -0
  523. data/ext/generator/parser/kdevvarlengtharray.h +346 -0
  524. data/ext/generator/parser/lexer.cpp +963 -0
  525. data/ext/generator/parser/lexer.h +308 -0
  526. data/ext/generator/parser/listnode.cpp +20 -0
  527. data/ext/generator/parser/listnode.h +97 -0
  528. data/ext/generator/parser/memorypool.cpp +20 -0
  529. data/ext/generator/parser/memorypool.h +41 -0
  530. data/ext/generator/parser/name_compiler.cpp +190 -0
  531. data/ext/generator/parser/name_compiler.h +77 -0
  532. data/ext/generator/parser/parser.cpp +4706 -0
  533. data/ext/generator/parser/parser.h +300 -0
  534. data/ext/generator/parser/parsesession.cpp +105 -0
  535. data/ext/generator/parser/parsesession.h +87 -0
  536. data/ext/generator/parser/problem.h +21 -0
  537. data/ext/generator/parser/rpp/CMakeLists.txt +39 -0
  538. data/ext/generator/parser/rpp/Makefile.am +13 -0
  539. data/ext/generator/parser/rpp/anchor.h +51 -0
  540. data/ext/generator/parser/rpp/appendedlist.h +363 -0
  541. data/ext/generator/parser/rpp/chartools.cpp +126 -0
  542. data/ext/generator/parser/rpp/chartools.h +90 -0
  543. data/ext/generator/parser/rpp/macrorepository.cpp +44 -0
  544. data/ext/generator/parser/rpp/macrorepository.h +59 -0
  545. data/ext/generator/parser/rpp/pp-configuration +86 -0
  546. data/ext/generator/parser/rpp/pp-engine.cpp +1216 -0
  547. data/ext/generator/parser/rpp/pp-engine.h +267 -0
  548. data/ext/generator/parser/rpp/pp-environment.cpp +271 -0
  549. data/ext/generator/parser/rpp/pp-environment.h +119 -0
  550. data/ext/generator/parser/rpp/pp-internal.cpp +38 -0
  551. data/ext/generator/parser/rpp/pp-internal.h +37 -0
  552. data/ext/generator/parser/rpp/pp-location.cpp +191 -0
  553. data/ext/generator/parser/rpp/pp-location.h +89 -0
  554. data/ext/generator/parser/rpp/pp-macro-expander.cpp +568 -0
  555. data/ext/generator/parser/rpp/pp-macro-expander.cpp.orig +558 -0
  556. data/ext/generator/parser/rpp/pp-macro-expander.h +130 -0
  557. data/ext/generator/parser/rpp/pp-macro.cpp +153 -0
  558. data/ext/generator/parser/rpp/pp-macro.h +176 -0
  559. data/ext/generator/parser/rpp/pp-scanner.cpp +310 -0
  560. data/ext/generator/parser/rpp/pp-scanner.h +97 -0
  561. data/ext/generator/parser/rpp/pp-stream.cpp +425 -0
  562. data/ext/generator/parser/rpp/pp-stream.h +183 -0
  563. data/ext/generator/parser/rpp/preprocessor.cpp +65 -0
  564. data/ext/generator/parser/rpp/preprocessor.h +80 -0
  565. data/ext/generator/parser/rpp/rpp.pri +2 -0
  566. data/ext/generator/parser/rpp/test/t001.cpp +23 -0
  567. data/ext/generator/parser/rpp/test/t002.cpp +15 -0
  568. data/ext/generator/parser/rpp/test/t003.cpp +10 -0
  569. data/ext/generator/parser/rpp/test/t004.cpp +9 -0
  570. data/ext/generator/parser/rpp/test/t005.cpp +10 -0
  571. data/ext/generator/parser/rpp/test/t006.cpp +10 -0
  572. data/ext/generator/parser/rpp/test/t007.cpp +6 -0
  573. data/ext/generator/parser/rpp/test/t008.cpp +6 -0
  574. data/ext/generator/parser/rpp/test/t009.cpp +5 -0
  575. data/ext/generator/parser/rpp/test/t010.cpp +15 -0
  576. data/ext/generator/parser/rpp/test/t011.cpp +9 -0
  577. data/ext/generator/parser/rpp/tests/CMakeLists.txt +13 -0
  578. data/ext/generator/parser/rpp/tests/main.cpp +69 -0
  579. data/ext/generator/parser/rxx.pri +50 -0
  580. data/ext/generator/parser/rxx_allocator.h +128 -0
  581. data/ext/generator/parser/safetycounter.h +57 -0
  582. data/ext/generator/parser/simplecursor.h +74 -0
  583. data/ext/generator/parser/stringhelpers.cpp +577 -0
  584. data/ext/generator/parser/stringhelpers.h +118 -0
  585. data/ext/generator/parser/symbol.h +140 -0
  586. data/ext/generator/parser/tests/CMakeLists.txt +30 -0
  587. data/ext/generator/parser/tests/test_generator.cpp +259 -0
  588. data/ext/generator/parser/tests/test_parser.cpp +474 -0
  589. data/ext/generator/parser/tests/test_pool.cpp +109 -0
  590. data/ext/generator/parser/tests/test_pool.h +35 -0
  591. data/ext/generator/parser/tests/testconfig.h.cmake +4 -0
  592. data/ext/generator/parser/tokens.cpp +364 -0
  593. data/ext/generator/parser/tokens.h +147 -0
  594. data/ext/generator/parser/type_compiler.cpp +135 -0
  595. data/ext/generator/parser/type_compiler.h +68 -0
  596. data/ext/generator/parser/visitor.cpp +115 -0
  597. data/ext/generator/parser/visitor.h +138 -0
  598. data/ext/generator/type.cpp +195 -0
  599. data/ext/generator/type.h +497 -0
  600. data/ext/generator/type_compiler.cpp +275 -0
  601. data/ext/generator/type_compiler.h +80 -0
  602. data/ext/ruby/CMakeLists.txt +63 -0
  603. data/ext/ruby/qtruby/AUTHORS +54 -0
  604. data/ext/ruby/qtruby/CMakeLists.txt +4 -0
  605. data/ext/ruby/qtruby/COPYING +355 -0
  606. data/ext/ruby/qtruby/COPYING.LIB +510 -0
  607. data/ext/ruby/qtruby/ChangeLog +3732 -0
  608. data/ext/ruby/qtruby/INSTALL +79 -0
  609. data/ext/ruby/qtruby/README +264 -0
  610. data/ext/ruby/qtruby/TODO +8 -0
  611. data/ext/ruby/qtruby/bin/CMakeLists.txt +1 -0
  612. data/ext/ruby/qtruby/bin/rbqtapi +152 -0
  613. data/ext/ruby/qtruby/examples/base/kicons.rb +54 -0
  614. data/ext/ruby/qtruby/examples/base/rui.rb +21 -0
  615. data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorbuilder.qrc +5 -0
  616. data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorform.rb +60 -0
  617. data/ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorform.ui +299 -0
  618. data/ext/ruby/qtruby/examples/designer/calculatorbuilder/main.rb +33 -0
  619. data/ext/ruby/qtruby/examples/designer/calculatorbuilder/makefile +2 -0
  620. data/ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb +46 -0
  621. data/ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.ui +277 -0
  622. data/ext/ruby/qtruby/examples/designer/calculatorform/main.rb +32 -0
  623. data/ext/ruby/qtruby/examples/designer/calculatorform/makefile +3 -0
  624. data/ext/ruby/qtruby/examples/desktop/screenshot/main.rb +32 -0
  625. data/ext/ruby/qtruby/examples/desktop/screenshot/screenshot.rb +156 -0
  626. data/ext/ruby/qtruby/examples/desktop/systray/images/bad.svg +64 -0
  627. data/ext/ruby/qtruby/examples/desktop/systray/images/heart.svg +55 -0
  628. data/ext/ruby/qtruby/examples/desktop/systray/images/trash.svg +58 -0
  629. data/ext/ruby/qtruby/examples/desktop/systray/main.rb +41 -0
  630. data/ext/ruby/qtruby/examples/desktop/systray/makefile +2 -0
  631. data/ext/ruby/qtruby/examples/desktop/systray/systray.qrc +7 -0
  632. data/ext/ruby/qtruby/examples/desktop/systray/window.rb +223 -0
  633. data/ext/ruby/qtruby/examples/dialogs/complexwizard/complexwizard.rb +140 -0
  634. data/ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb +294 -0
  635. data/ext/ruby/qtruby/examples/dialogs/complexwizard/main.rb +31 -0
  636. data/ext/ruby/qtruby/examples/dialogs/configdialog/configdialog.rb +109 -0
  637. data/ext/ruby/qtruby/examples/dialogs/configdialog/images/config.png +0 -0
  638. data/ext/ruby/qtruby/examples/dialogs/configdialog/images/query.png +0 -0
  639. data/ext/ruby/qtruby/examples/dialogs/configdialog/images/update.png +0 -0
  640. data/ext/ruby/qtruby/examples/dialogs/configdialog/main.rb +31 -0
  641. data/ext/ruby/qtruby/examples/dialogs/configdialog/pages.rb +140 -0
  642. data/ext/ruby/qtruby/examples/dialogs/extension/finddialog.rb +89 -0
  643. data/ext/ruby/qtruby/examples/dialogs/extension/main.rb +31 -0
  644. data/ext/ruby/qtruby/examples/dialogs/findfiles/main.rb +32 -0
  645. data/ext/ruby/qtruby/examples/dialogs/findfiles/window.rb +177 -0
  646. data/ext/ruby/qtruby/examples/dialogs/simplewizard/classwizard.rb +374 -0
  647. data/ext/ruby/qtruby/examples/dialogs/simplewizard/main.rb +31 -0
  648. data/ext/ruby/qtruby/examples/dialogs/simplewizard/simplewizard.rb +110 -0
  649. data/ext/ruby/qtruby/examples/dialogs/standarddialogs/dialog.rb +340 -0
  650. data/ext/ruby/qtruby/examples/dialogs/standarddialogs/main.rb +31 -0
  651. data/ext/ruby/qtruby/examples/dialogs/tabdialog/main.rb +38 -0
  652. data/ext/ruby/qtruby/examples/dialogs/tabdialog/tabdialog.rb +178 -0
  653. data/ext/ruby/qtruby/examples/draganddrop/draggableicons/dragwidget.rb +125 -0
  654. data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/boat.png +0 -0
  655. data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/car.png +0 -0
  656. data/ext/ruby/qtruby/examples/draganddrop/draggableicons/images/house.png +0 -0
  657. data/ext/ruby/qtruby/examples/draganddrop/draggableicons/main.rb +41 -0
  658. data/ext/ruby/qtruby/examples/draganddrop/draggabletext/draglabel.rb +51 -0
  659. data/ext/ruby/qtruby/examples/draganddrop/draggabletext/dragwidget.rb +94 -0
  660. data/ext/ruby/qtruby/examples/draganddrop/draggabletext/main.rb +33 -0
  661. data/ext/ruby/qtruby/examples/draganddrop/draggabletext/words.txt +41 -0
  662. data/ext/ruby/qtruby/examples/draganddrop/dropsite/dropsitewidget.rb +98 -0
  663. data/ext/ruby/qtruby/examples/draganddrop/dropsite/dropsitewindow.rb +114 -0
  664. data/ext/ruby/qtruby/examples/draganddrop/dropsite/main.rb +33 -0
  665. data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/draglabel.rb +78 -0
  666. data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/dragwidget.rb +130 -0
  667. data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/main.rb +33 -0
  668. data/ext/ruby/qtruby/examples/draganddrop/fridgemagnets/words.txt +48 -0
  669. data/ext/ruby/qtruby/examples/draganddrop/puzzle/example.jpg +0 -0
  670. data/ext/ruby/qtruby/examples/draganddrop/puzzle/main.rb +33 -0
  671. data/ext/ruby/qtruby/examples/draganddrop/puzzle/mainwindow.rb +136 -0
  672. data/ext/ruby/qtruby/examples/draganddrop/puzzle/pieceslist.rb +95 -0
  673. data/ext/ruby/qtruby/examples/draganddrop/puzzle/puzzlewidget.rb +190 -0
  674. data/ext/ruby/qtruby/examples/graphicsview/collidingmice/images/cheese.jpg +0 -0
  675. data/ext/ruby/qtruby/examples/graphicsview/collidingmice/main.rb +53 -0
  676. data/ext/ruby/qtruby/examples/graphicsview/collidingmice/makefile +2 -0
  677. data/ext/ruby/qtruby/examples/graphicsview/collidingmice/mice.qrc +5 -0
  678. data/ext/ruby/qtruby/examples/graphicsview/collidingmice/mouse.rb +176 -0
  679. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/coloritem.rb +86 -0
  680. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/images/head.png +0 -0
  681. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/main.rb +57 -0
  682. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/makefile +2 -0
  683. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/robot.qrc +5 -0
  684. data/ext/ruby/qtruby/examples/graphicsview/dragdroprobot/robot.rb +246 -0
  685. data/ext/ruby/qtruby/examples/itemviews/chart/chart.qrc +5 -0
  686. data/ext/ruby/qtruby/examples/itemviews/chart/main.rb +33 -0
  687. data/ext/ruby/qtruby/examples/itemviews/chart/mainwindow.rb +151 -0
  688. data/ext/ruby/qtruby/examples/itemviews/chart/makefile +2 -0
  689. data/ext/ruby/qtruby/examples/itemviews/chart/mydata.cht +8 -0
  690. data/ext/ruby/qtruby/examples/itemviews/chart/pieview.rb +516 -0
  691. data/ext/ruby/qtruby/examples/itemviews/chart/qtdata.cht +14 -0
  692. data/ext/ruby/qtruby/examples/itemviews/dirview/main.rb +39 -0
  693. data/ext/ruby/qtruby/examples/itemviews/pixelator/imagemodel.rb +51 -0
  694. data/ext/ruby/qtruby/examples/itemviews/pixelator/images.qrc +5 -0
  695. data/ext/ruby/qtruby/examples/itemviews/pixelator/images/qt.png +0 -0
  696. data/ext/ruby/qtruby/examples/itemviews/pixelator/main.rb +34 -0
  697. data/ext/ruby/qtruby/examples/itemviews/pixelator/mainwindow.rb +218 -0
  698. data/ext/ruby/qtruby/examples/itemviews/pixelator/makefile +3 -0
  699. data/ext/ruby/qtruby/examples/itemviews/pixelator/pixeldelegate.rb +67 -0
  700. data/ext/ruby/qtruby/examples/itemviews/puzzle/example.jpg +0 -0
  701. data/ext/ruby/qtruby/examples/itemviews/puzzle/main.rb +36 -0
  702. data/ext/ruby/qtruby/examples/itemviews/puzzle/mainwindow.rb +143 -0
  703. data/ext/ruby/qtruby/examples/itemviews/puzzle/piecesmodel.rb +174 -0
  704. data/ext/ruby/qtruby/examples/itemviews/puzzle/puzzlewidget.rb +192 -0
  705. data/ext/ruby/qtruby/examples/itemviews/simpledommodel/domitem.rb +62 -0
  706. data/ext/ruby/qtruby/examples/itemviews/simpledommodel/dommodel.rb +139 -0
  707. data/ext/ruby/qtruby/examples/itemviews/simpledommodel/main.rb +33 -0
  708. data/ext/ruby/qtruby/examples/itemviews/simpledommodel/mainwindow.rb +66 -0
  709. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/default.txt +40 -0
  710. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/main.rb +41 -0
  711. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/makefile +2 -0
  712. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/simpletreemodel.qrc +5 -0
  713. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/treeitem.rb +67 -0
  714. data/ext/ruby/qtruby/examples/itemviews/simpletreemodel/treemodel.rb +164 -0
  715. data/ext/ruby/qtruby/examples/itemviews/sortingmodel/default.txt +40 -0
  716. data/ext/ruby/qtruby/examples/itemviews/sortingmodel/main.rb +53 -0
  717. data/ext/ruby/qtruby/examples/itemviews/sortingmodel/treeitem.rb +73 -0
  718. data/ext/ruby/qtruby/examples/itemviews/sortingmodel/treemodel.rb +166 -0
  719. data/ext/ruby/qtruby/examples/itemviews/spinboxdelegate/main.rb +47 -0
  720. data/ext/ruby/qtruby/examples/itemviews/spinboxdelegate/spinboxdelegate.rb +62 -0
  721. data/ext/ruby/qtruby/examples/killerfilter/killerfilter.rb +55 -0
  722. data/ext/ruby/qtruby/examples/layouts/basiclayouts/dialog.rb +110 -0
  723. data/ext/ruby/qtruby/examples/layouts/basiclayouts/main.rb +31 -0
  724. data/ext/ruby/qtruby/examples/layouts/borderlayout/borderlayout.rb +190 -0
  725. data/ext/ruby/qtruby/examples/layouts/borderlayout/main.rb +32 -0
  726. data/ext/ruby/qtruby/examples/layouts/borderlayout/window.rb +52 -0
  727. data/ext/ruby/qtruby/examples/layouts/flowlayouts/flowlayout.rb +108 -0
  728. data/ext/ruby/qtruby/examples/layouts/flowlayouts/main.rb +32 -0
  729. data/ext/ruby/qtruby/examples/layouts/flowlayouts/window.rb +43 -0
  730. data/ext/ruby/qtruby/examples/mainwindows/application/images/copy.png +0 -0
  731. data/ext/ruby/qtruby/examples/mainwindows/application/images/cut.png +0 -0
  732. data/ext/ruby/qtruby/examples/mainwindows/application/images/new.png +0 -0
  733. data/ext/ruby/qtruby/examples/mainwindows/application/images/open.png +0 -0
  734. data/ext/ruby/qtruby/examples/mainwindows/application/images/paste.png +0 -0
  735. data/ext/ruby/qtruby/examples/mainwindows/application/images/save.png +0 -0
  736. data/ext/ruby/qtruby/examples/mainwindows/application/main.rb +32 -0
  737. data/ext/ruby/qtruby/examples/mainwindows/application/mainwindow.rb +285 -0
  738. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/new.png +0 -0
  739. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/print.png +0 -0
  740. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/save.png +0 -0
  741. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/images/undo.png +0 -0
  742. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/main.rb +32 -0
  743. data/ext/ruby/qtruby/examples/mainwindows/dockwidgets/mainwindow.rb +302 -0
  744. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/copy.png +0 -0
  745. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/cut.png +0 -0
  746. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/new.png +0 -0
  747. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/open.png +0 -0
  748. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/paste.png +0 -0
  749. data/ext/ruby/qtruby/examples/mainwindows/mdi/images/save.png +0 -0
  750. data/ext/ruby/qtruby/examples/mainwindows/mdi/main.rb +32 -0
  751. data/ext/ruby/qtruby/examples/mainwindows/mdi/mainwindow.rb +363 -0
  752. data/ext/ruby/qtruby/examples/mainwindows/mdi/mdichild.rb +152 -0
  753. data/ext/ruby/qtruby/examples/mainwindows/menus/main.rb +32 -0
  754. data/ext/ruby/qtruby/examples/mainwindows/menus/mainwindow.rb +327 -0
  755. data/ext/ruby/qtruby/examples/mainwindows/recentfiles/main.rb +32 -0
  756. data/ext/ruby/qtruby/examples/mainwindows/recentfiles/mainwindow.rb +258 -0
  757. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/copy.png +0 -0
  758. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/cut.png +0 -0
  759. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/new.png +0 -0
  760. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/open.png +0 -0
  761. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/paste.png +0 -0
  762. data/ext/ruby/qtruby/examples/mainwindows/sdi/images/save.png +0 -0
  763. data/ext/ruby/qtruby/examples/mainwindows/sdi/main.rb +32 -0
  764. data/ext/ruby/qtruby/examples/mainwindows/sdi/mainwindow.rb +335 -0
  765. data/ext/ruby/qtruby/examples/network/broadcastreceiver/main.rb +32 -0
  766. data/ext/ruby/qtruby/examples/network/broadcastreceiver/receiver.rb +64 -0
  767. data/ext/ruby/qtruby/examples/network/broadcastsender/main.rb +32 -0
  768. data/ext/ruby/qtruby/examples/network/broadcastsender/sender.rb +70 -0
  769. data/ext/ruby/qtruby/examples/network/fortuneclient/client.rb +150 -0
  770. data/ext/ruby/qtruby/examples/network/fortuneclient/main.rb +32 -0
  771. data/ext/ruby/qtruby/examples/network/fortuneserver/main.rb +32 -0
  772. data/ext/ruby/qtruby/examples/network/fortuneserver/server.rb +88 -0
  773. data/ext/ruby/qtruby/examples/network/ftp/ftpwindow.rb +254 -0
  774. data/ext/ruby/qtruby/examples/network/ftp/images/cdtoparent.png +0 -0
  775. data/ext/ruby/qtruby/examples/network/ftp/images/dir.png +0 -0
  776. data/ext/ruby/qtruby/examples/network/ftp/images/file.png +0 -0
  777. data/ext/ruby/qtruby/examples/network/ftp/main.rb +32 -0
  778. data/ext/ruby/qtruby/examples/network/http/httpwindow.rb +187 -0
  779. data/ext/ruby/qtruby/examples/network/http/main.rb +32 -0
  780. data/ext/ruby/qtruby/examples/network/loopback/dialog.rb +163 -0
  781. data/ext/ruby/qtruby/examples/network/loopback/main.rb +32 -0
  782. data/ext/ruby/qtruby/examples/opengl/grabber/glwidget.rb +265 -0
  783. data/ext/ruby/qtruby/examples/opengl/grabber/main.rb +32 -0
  784. data/ext/ruby/qtruby/examples/opengl/grabber/mainwindow.rb +189 -0
  785. data/ext/ruby/qtruby/examples/opengl/hellogl/glwidget.rb +226 -0
  786. data/ext/ruby/qtruby/examples/opengl/hellogl/main.rb +32 -0
  787. data/ext/ruby/qtruby/examples/opengl/hellogl/window.rb +66 -0
  788. data/ext/ruby/qtruby/examples/opengl/textures/glwidget.rb +151 -0
  789. data/ext/ruby/qtruby/examples/opengl/textures/images/side1.png +0 -0
  790. data/ext/ruby/qtruby/examples/opengl/textures/images/side2.png +0 -0
  791. data/ext/ruby/qtruby/examples/opengl/textures/images/side3.png +0 -0
  792. data/ext/ruby/qtruby/examples/opengl/textures/images/side4.png +0 -0
  793. data/ext/ruby/qtruby/examples/opengl/textures/images/side5.png +0 -0
  794. data/ext/ruby/qtruby/examples/opengl/textures/images/side6.png +0 -0
  795. data/ext/ruby/qtruby/examples/opengl/textures/main.rb +32 -0
  796. data/ext/ruby/qtruby/examples/opengl/textures/window.rb +77 -0
  797. data/ext/ruby/qtruby/examples/painting/basicdrawing/images/brick.png +0 -0
  798. data/ext/ruby/qtruby/examples/painting/basicdrawing/images/qt-logo.png +0 -0
  799. data/ext/ruby/qtruby/examples/painting/basicdrawing/main.rb +32 -0
  800. data/ext/ruby/qtruby/examples/painting/basicdrawing/renderarea.rb +166 -0
  801. data/ext/ruby/qtruby/examples/painting/basicdrawing/window.rb +215 -0
  802. data/ext/ruby/qtruby/examples/painting/concentriccircles/circlewidget.rb +88 -0
  803. data/ext/ruby/qtruby/examples/painting/concentriccircles/main.rb +32 -0
  804. data/ext/ruby/qtruby/examples/painting/concentriccircles/window.rb +72 -0
  805. data/ext/ruby/qtruby/examples/painting/fontsampler/main.rb +32 -0
  806. data/ext/ruby/qtruby/examples/painting/fontsampler/mainwindow.rb +368 -0
  807. data/ext/ruby/qtruby/examples/painting/fontsampler/mainwindowbase.ui +136 -0
  808. data/ext/ruby/qtruby/examples/painting/fontsampler/makefile +8 -0
  809. data/ext/ruby/qtruby/examples/painting/fontsampler/previewdialog.rb +256 -0
  810. data/ext/ruby/qtruby/examples/painting/fontsampler/previewdialogbase.ui +224 -0
  811. data/ext/ruby/qtruby/examples/painting/fontsampler/previewlabel.rb +43 -0
  812. data/ext/ruby/qtruby/examples/painting/imagecomposition/imagecomposer.rb +152 -0
  813. data/ext/ruby/qtruby/examples/painting/imagecomposition/imagecomposition.qrc +6 -0
  814. data/ext/ruby/qtruby/examples/painting/imagecomposition/images/background.png +0 -0
  815. data/ext/ruby/qtruby/examples/painting/imagecomposition/images/blackrectangle.png +0 -0
  816. data/ext/ruby/qtruby/examples/painting/imagecomposition/images/butterfly.png +0 -0
  817. data/ext/ruby/qtruby/examples/painting/imagecomposition/images/checker.png +0 -0
  818. data/ext/ruby/qtruby/examples/painting/imagecomposition/main.rb +33 -0
  819. data/ext/ruby/qtruby/examples/painting/imagecomposition/makefile +2 -0
  820. data/ext/ruby/qtruby/examples/painting/painterpaths/main.rb +32 -0
  821. data/ext/ruby/qtruby/examples/painting/painterpaths/renderarea.rb +97 -0
  822. data/ext/ruby/qtruby/examples/painting/painterpaths/window.rb +247 -0
  823. data/ext/ruby/qtruby/examples/painting/svgviewer/files/bubbles.svg +212 -0
  824. data/ext/ruby/qtruby/examples/painting/svgviewer/files/cubic.svg +77 -0
  825. data/ext/ruby/qtruby/examples/painting/svgviewer/files/spheres.svg +79 -0
  826. data/ext/ruby/qtruby/examples/painting/svgviewer/main.rb +38 -0
  827. data/ext/ruby/qtruby/examples/painting/svgviewer/mainwindow.rb +99 -0
  828. data/ext/ruby/qtruby/examples/painting/svgviewer/makefile +2 -0
  829. data/ext/ruby/qtruby/examples/painting/svgviewer/svgview.rb +156 -0
  830. data/ext/ruby/qtruby/examples/painting/svgviewer/svgviewer.qrc +6 -0
  831. data/ext/ruby/qtruby/examples/painting/svgviewer/svgwindow.rb +87 -0
  832. data/ext/ruby/qtruby/examples/painting/transformations/main.rb +32 -0
  833. data/ext/ruby/qtruby/examples/painting/transformations/renderarea.rb +127 -0
  834. data/ext/ruby/qtruby/examples/painting/transformations/window.rb +153 -0
  835. data/ext/ruby/qtruby/examples/passivepopup/passivepopup.rb +38 -0
  836. data/ext/ruby/qtruby/examples/qdbus/chat/chat.rb +146 -0
  837. data/ext/ruby/qtruby/examples/qdbus/chat/chat_adaptor.rb +12 -0
  838. data/ext/ruby/qtruby/examples/qdbus/chat/chat_interface.rb +13 -0
  839. data/ext/ruby/qtruby/examples/qdbus/chat/chatmainwindow.ui +184 -0
  840. data/ext/ruby/qtruby/examples/qdbus/chat/chatsetnickname.ui +145 -0
  841. data/ext/ruby/qtruby/examples/qdbus/chat/makefile +8 -0
  842. data/ext/ruby/qtruby/examples/qdbus/complexpingpong/complexping.rb +92 -0
  843. data/ext/ruby/qtruby/examples/qdbus/complexpingpong/complexpong.rb +83 -0
  844. data/ext/ruby/qtruby/examples/qdbus/complexpingpong/ping-common.rb +1 -0
  845. data/ext/ruby/qtruby/examples/qdbus/listnames/listnames.rb +69 -0
  846. data/ext/ruby/qtruby/examples/qdbus/pingpong/ping-common.rb +1 -0
  847. data/ext/ruby/qtruby/examples/qdbus/pingpong/ping.rb +52 -0
  848. data/ext/ruby/qtruby/examples/qdbus/pingpong/pong.rb +55 -0
  849. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/car/car.rb +151 -0
  850. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/car/main.rb +50 -0
  851. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/controller.rb +66 -0
  852. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/controller.ui +61 -0
  853. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/main.rb +32 -0
  854. data/ext/ruby/qtruby/examples/qdbus/remotecontrolledcar/controller/makefile +2 -0
  855. data/ext/ruby/qtruby/examples/qtscribble/scribble.rb +270 -0
  856. data/ext/ruby/qtruby/examples/richtext/calendar/main.rb +33 -0
  857. data/ext/ruby/qtruby/examples/richtext/calendar/mainwindow.rb +173 -0
  858. data/ext/ruby/qtruby/examples/richtext/orderform/detailsdialog.rb +130 -0
  859. data/ext/ruby/qtruby/examples/richtext/orderform/main.rb +34 -0
  860. data/ext/ruby/qtruby/examples/richtext/orderform/mainwindow.rb +194 -0
  861. data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/examples/example +79 -0
  862. data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/highlighter.rb +90 -0
  863. data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/main.rb +34 -0
  864. data/ext/ruby/qtruby/examples/richtext/syntaxhighlighter/mainwindow.rb +105 -0
  865. data/ext/ruby/qtruby/examples/ruboids/Manifest +26 -0
  866. data/ext/ruby/qtruby/examples/ruboids/README +53 -0
  867. data/ext/ruby/qtruby/examples/ruboids/TODO +29 -0
  868. data/ext/ruby/qtruby/examples/ruboids/boids.properties +33 -0
  869. data/ext/ruby/qtruby/examples/ruboids/generateManifest.rb +42 -0
  870. data/ext/ruby/qtruby/examples/ruboids/index.html +147 -0
  871. data/ext/ruby/qtruby/examples/ruboids/release.rb +152 -0
  872. data/ext/ruby/qtruby/examples/ruboids/ruboids/Boid.rb +141 -0
  873. data/ext/ruby/qtruby/examples/ruboids/ruboids/BoidView.rb +159 -0
  874. data/ext/ruby/qtruby/examples/ruboids/ruboids/Camera.rb +24 -0
  875. data/ext/ruby/qtruby/examples/ruboids/ruboids/CameraDialog.rb +218 -0
  876. data/ext/ruby/qtruby/examples/ruboids/ruboids/Canvas.rb +143 -0
  877. data/ext/ruby/qtruby/examples/ruboids/ruboids/Cloud.rb +61 -0
  878. data/ext/ruby/qtruby/examples/ruboids/ruboids/CloudView.rb +54 -0
  879. data/ext/ruby/qtruby/examples/ruboids/ruboids/Flock.rb +47 -0
  880. data/ext/ruby/qtruby/examples/ruboids/ruboids/Graphics.rb +278 -0
  881. data/ext/ruby/qtruby/examples/ruboids/ruboids/Params.rb +87 -0
  882. data/ext/ruby/qtruby/examples/ruboids/ruboids/Point.rb +153 -0
  883. data/ext/ruby/qtruby/examples/ruboids/ruboids/Thing.rb +34 -0
  884. data/ext/ruby/qtruby/examples/ruboids/ruboids/Triangle.rb +21 -0
  885. data/ext/ruby/qtruby/examples/ruboids/ruboids/View.rb +88 -0
  886. data/ext/ruby/qtruby/examples/ruboids/ruboids/World.rb +82 -0
  887. data/ext/ruby/qtruby/examples/ruboids/ruboids/WorldWindow.rb +52 -0
  888. data/ext/ruby/qtruby/examples/ruboids/ruboids/info.rb +12 -0
  889. data/ext/ruby/qtruby/examples/ruboids/ruboids/ruboids.rb +29 -0
  890. data/ext/ruby/qtruby/examples/textedit/textedit.rb +150 -0
  891. data/ext/ruby/qtruby/examples/tutorial/t1/t1.rb +10 -0
  892. data/ext/ruby/qtruby/examples/tutorial/t10/cannon.rb +72 -0
  893. data/ext/ruby/qtruby/examples/tutorial/t10/lcdrange.rb +45 -0
  894. data/ext/ruby/qtruby/examples/tutorial/t10/t10.rb +55 -0
  895. data/ext/ruby/qtruby/examples/tutorial/t11/cannon.rb +124 -0
  896. data/ext/ruby/qtruby/examples/tutorial/t11/lcdrange.rb +45 -0
  897. data/ext/ruby/qtruby/examples/tutorial/t11/t11.rb +65 -0
  898. data/ext/ruby/qtruby/examples/tutorial/t12/cannon.rb +158 -0
  899. data/ext/ruby/qtruby/examples/tutorial/t12/lcdrange.rb +59 -0
  900. data/ext/ruby/qtruby/examples/tutorial/t12/t12.rb +66 -0
  901. data/ext/ruby/qtruby/examples/tutorial/t13/cannon.rb +208 -0
  902. data/ext/ruby/qtruby/examples/tutorial/t13/gamebrd.rb +113 -0
  903. data/ext/ruby/qtruby/examples/tutorial/t13/lcdrange.rb +60 -0
  904. data/ext/ruby/qtruby/examples/tutorial/t13/t13.rb +11 -0
  905. data/ext/ruby/qtruby/examples/tutorial/t14/cannon.rb +263 -0
  906. data/ext/ruby/qtruby/examples/tutorial/t14/gamebrd.rb +123 -0
  907. data/ext/ruby/qtruby/examples/tutorial/t14/lcdrange.rb +63 -0
  908. data/ext/ruby/qtruby/examples/tutorial/t14/t14.rb +11 -0
  909. data/ext/ruby/qtruby/examples/tutorial/t2/t2.rb +16 -0
  910. data/ext/ruby/qtruby/examples/tutorial/t3/t3.rb +18 -0
  911. data/ext/ruby/qtruby/examples/tutorial/t4/t4.rb +25 -0
  912. data/ext/ruby/qtruby/examples/tutorial/t5/t5.rb +37 -0
  913. data/ext/ruby/qtruby/examples/tutorial/t6/t6.rb +52 -0
  914. data/ext/ruby/qtruby/examples/tutorial/t7/lcdrange.rb +32 -0
  915. data/ext/ruby/qtruby/examples/tutorial/t7/t7.rb +42 -0
  916. data/ext/ruby/qtruby/examples/tutorial/t8/cannon.rb +38 -0
  917. data/ext/ruby/qtruby/examples/tutorial/t8/lcdrange.rb +45 -0
  918. data/ext/ruby/qtruby/examples/tutorial/t8/t8.rb +43 -0
  919. data/ext/ruby/qtruby/examples/tutorial/t9/cannon.rb +45 -0
  920. data/ext/ruby/qtruby/examples/tutorial/t9/lcdrange.rb +46 -0
  921. data/ext/ruby/qtruby/examples/tutorial/t9/t9.rb +43 -0
  922. data/ext/ruby/qtruby/examples/widgets/analogclock/analogclock.rb +94 -0
  923. data/ext/ruby/qtruby/examples/widgets/analogclock/main.rb +9 -0
  924. data/ext/ruby/qtruby/examples/widgets/calculator/button.rb +45 -0
  925. data/ext/ruby/qtruby/examples/widgets/calculator/calculator.rb +382 -0
  926. data/ext/ruby/qtruby/examples/widgets/calculator/main.rb +32 -0
  927. data/ext/ruby/qtruby/examples/widgets/charactermap/characterwidget.rb +110 -0
  928. data/ext/ruby/qtruby/examples/widgets/charactermap/main.rb +32 -0
  929. data/ext/ruby/qtruby/examples/widgets/charactermap/mainwindow.rb +118 -0
  930. data/ext/ruby/qtruby/examples/widgets/digitalclock/digitalclock.rb +30 -0
  931. data/ext/ruby/qtruby/examples/widgets/digitalclock/main.rb +9 -0
  932. data/ext/ruby/qtruby/examples/widgets/groupbox/main.rb +32 -0
  933. data/ext/ruby/qtruby/examples/widgets/groupbox/window.rb +134 -0
  934. data/ext/ruby/qtruby/examples/widgets/icons/iconpreviewarea.rb +111 -0
  935. data/ext/ruby/qtruby/examples/widgets/icons/iconsizespinbox.rb +39 -0
  936. data/ext/ruby/qtruby/examples/widgets/icons/imagedelegate.rb +73 -0
  937. data/ext/ruby/qtruby/examples/widgets/icons/images/designer.png +0 -0
  938. data/ext/ruby/qtruby/examples/widgets/icons/images/find_disabled.png +0 -0
  939. data/ext/ruby/qtruby/examples/widgets/icons/images/find_normal.png +0 -0
  940. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_128x128.png +0 -0
  941. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_16x16.png +0 -0
  942. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_32x32.png +0 -0
  943. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_off_64x64.png +0 -0
  944. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_128x128.png +0 -0
  945. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_16x16.png +0 -0
  946. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_32x32.png +0 -0
  947. data/ext/ruby/qtruby/examples/widgets/icons/images/monkey_on_64x64.png +0 -0
  948. data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_16x16.png +0 -0
  949. data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_32x32.png +0 -0
  950. data/ext/ruby/qtruby/examples/widgets/icons/images/qtopia_48x48.png +0 -0
  951. data/ext/ruby/qtruby/examples/widgets/icons/main.rb +32 -0
  952. data/ext/ruby/qtruby/examples/widgets/icons/mainwindow.rb +351 -0
  953. data/ext/ruby/qtruby/examples/widgets/imageviewer/imageviewer.rb +219 -0
  954. data/ext/ruby/qtruby/examples/widgets/imageviewer/main.rb +32 -0
  955. data/ext/ruby/qtruby/examples/widgets/lineedits/main.rb +32 -0
  956. data/ext/ruby/qtruby/examples/widgets/lineedits/window.rb +199 -0
  957. data/ext/ruby/qtruby/examples/widgets/movie/images/open.png +0 -0
  958. data/ext/ruby/qtruby/examples/widgets/movie/images/pause.png +0 -0
  959. data/ext/ruby/qtruby/examples/widgets/movie/images/play.png +0 -0
  960. data/ext/ruby/qtruby/examples/widgets/movie/images/quit.png +0 -0
  961. data/ext/ruby/qtruby/examples/widgets/movie/images/stop.png +0 -0
  962. data/ext/ruby/qtruby/examples/widgets/movie/main.rb +32 -0
  963. data/ext/ruby/qtruby/examples/widgets/movie/movieplayer.rb +201 -0
  964. data/ext/ruby/qtruby/examples/widgets/movie/movies/fire.mng +0 -0
  965. data/ext/ruby/qtruby/examples/widgets/screenshot/main.rb +32 -0
  966. data/ext/ruby/qtruby/examples/widgets/screenshot/screenshot.rb +155 -0
  967. data/ext/ruby/qtruby/examples/widgets/scribble/main.rb +32 -0
  968. data/ext/ruby/qtruby/examples/widgets/scribble/mainwindow.rb +202 -0
  969. data/ext/ruby/qtruby/examples/widgets/scribble/scribblearea.rb +154 -0
  970. data/ext/ruby/qtruby/examples/widgets/sliders/main.rb +32 -0
  971. data/ext/ruby/qtruby/examples/widgets/sliders/slidersgroup.rb +97 -0
  972. data/ext/ruby/qtruby/examples/widgets/sliders/window.rb +124 -0
  973. data/ext/ruby/qtruby/examples/widgets/spinboxes/main.rb +32 -0
  974. data/ext/ruby/qtruby/examples/widgets/spinboxes/window.rb +213 -0
  975. data/ext/ruby/qtruby/examples/widgets/tetrix/main.rb +33 -0
  976. data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixboard.rb +346 -0
  977. data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixpiece.rb +135 -0
  978. data/ext/ruby/qtruby/examples/widgets/tetrix/tetrixwindow.rb +88 -0
  979. data/ext/ruby/qtruby/examples/widgets/tooltips/images/circle.png +0 -0
  980. data/ext/ruby/qtruby/examples/widgets/tooltips/images/square.png +0 -0
  981. data/ext/ruby/qtruby/examples/widgets/tooltips/images/triangle.png +0 -0
  982. data/ext/ruby/qtruby/examples/widgets/tooltips/main.rb +32 -0
  983. data/ext/ruby/qtruby/examples/widgets/tooltips/shapeitem.rb +31 -0
  984. data/ext/ruby/qtruby/examples/widgets/tooltips/sortingbox.rb +222 -0
  985. data/ext/ruby/qtruby/examples/widgets/wiggly/dialog.rb +48 -0
  986. data/ext/ruby/qtruby/examples/widgets/wiggly/main.rb +9 -0
  987. data/ext/ruby/qtruby/examples/widgets/wiggly/wigglywidget.rb +76 -0
  988. data/ext/ruby/qtruby/examples/widgets/windowflags/controllerwindow.rb +195 -0
  989. data/ext/ruby/qtruby/examples/widgets/windowflags/main.rb +32 -0
  990. data/ext/ruby/qtruby/examples/widgets/windowflags/previewwindow.rb +103 -0
  991. data/ext/ruby/qtruby/examples/xml/dombookmarks/frank.xbel +230 -0
  992. data/ext/ruby/qtruby/examples/xml/dombookmarks/jennifer.xbel +93 -0
  993. data/ext/ruby/qtruby/examples/xml/dombookmarks/main.rb +34 -0
  994. data/ext/ruby/qtruby/examples/xml/dombookmarks/mainwindow.rb +129 -0
  995. data/ext/ruby/qtruby/examples/xml/dombookmarks/xbeltree.rb +172 -0
  996. data/ext/ruby/qtruby/examples/xml/saxbookmarks/frank.xbel +230 -0
  997. data/ext/ruby/qtruby/examples/xml/saxbookmarks/jennifer.xbel +93 -0
  998. data/ext/ruby/qtruby/examples/xml/saxbookmarks/main.rb +34 -0
  999. data/ext/ruby/qtruby/examples/xml/saxbookmarks/mainwindow.rb +144 -0
  1000. data/ext/ruby/qtruby/examples/xml/saxbookmarks/xbelgenerator.rb +95 -0
  1001. data/ext/ruby/qtruby/examples/xml/saxbookmarks/xbelhandler.rb +122 -0
  1002. data/ext/ruby/qtruby/rails_support/CMakeLists.txt +1 -0
  1003. data/ext/ruby/qtruby/rails_support/active_item_model.rb +234 -0
  1004. data/ext/ruby/qtruby/rails_support/active_table_model.rb +122 -0
  1005. data/ext/ruby/qtruby/src/CMakeLists.txt +103 -0
  1006. data/ext/ruby/qtruby/src/Qt.cpp +1279 -0
  1007. data/ext/ruby/qtruby/src/extconf.rb +11 -0
  1008. data/ext/ruby/qtruby/src/handlers.cpp +2622 -0
  1009. data/ext/ruby/qtruby/src/lib/CMakeLists.txt +16 -0
  1010. data/ext/ruby/qtruby/src/lib/Qt.rb +1 -0
  1011. data/ext/ruby/qtruby/src/lib/Qt/CMakeLists.txt +9 -0
  1012. data/ext/ruby/qtruby/src/lib/Qt/qtruby4.rb +3177 -0
  1013. data/ext/ruby/qtruby/src/lib/Qt3.rb +6 -0
  1014. data/ext/ruby/qtruby/src/lib/Qt4.rb +6 -0
  1015. data/ext/ruby/qtruby/src/marshall.h +66 -0
  1016. data/ext/ruby/qtruby/src/marshall_basetypes.h +208 -0
  1017. data/ext/ruby/qtruby/src/marshall_complex.h +175 -0
  1018. data/ext/ruby/qtruby/src/marshall_macros.h +647 -0
  1019. data/ext/ruby/qtruby/src/marshall_primitives.h +290 -0
  1020. data/ext/ruby/qtruby/src/marshall_types.cpp +815 -0
  1021. data/ext/ruby/qtruby/src/marshall_types.h +240 -0
  1022. data/ext/ruby/qtruby/src/qtruby.cpp +2483 -0
  1023. data/ext/ruby/qtruby/src/qtruby.h +185 -0
  1024. data/ext/ruby/qtruby/src/smokeruby.h +164 -0
  1025. data/ext/ruby/qtruby/test/opoverloading.rb +46 -0
  1026. data/ext/ruby/qtruby/test/unittests.rb +151 -0
  1027. data/ext/ruby/qtruby/tools/CMakeLists.txt +2 -0
  1028. data/ext/ruby/qtruby/tools/rbrcc/CMakeLists.txt +6 -0
  1029. data/ext/ruby/qtruby/tools/rbrcc/Messages.sh +7 -0
  1030. data/ext/ruby/qtruby/tools/rbrcc/main.cpp +173 -0
  1031. data/ext/ruby/qtruby/tools/rbrcc/rbrcc.pro +14 -0
  1032. data/ext/ruby/qtruby/tools/rbrcc/rcc.cpp +648 -0
  1033. data/ext/ruby/qtruby/tools/rbrcc/rcc.h +165 -0
  1034. data/ext/ruby/qtruby/tools/rbuic/CMakeLists.txt +35 -0
  1035. data/ext/ruby/qtruby/tools/rbuic/LICENSE.GPL +280 -0
  1036. data/ext/ruby/qtruby/tools/rbuic/Messages.sh +7 -0
  1037. data/ext/ruby/qtruby/tools/rbuic/TODO +4 -0
  1038. data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.cpp +106 -0
  1039. data/ext/ruby/qtruby/tools/rbuic/customwidgetsinfo.h +95 -0
  1040. data/ext/ruby/qtruby/tools/rbuic/databaseinfo.cpp +102 -0
  1041. data/ext/ruby/qtruby/tools/rbuic/databaseinfo.h +85 -0
  1042. data/ext/ruby/qtruby/tools/rbuic/driver.cpp +384 -0
  1043. data/ext/ruby/qtruby/tools/rbuic/driver.h +141 -0
  1044. data/ext/ruby/qtruby/tools/rbuic/globaldefs.h +60 -0
  1045. data/ext/ruby/qtruby/tools/rbuic/main.cpp +201 -0
  1046. data/ext/ruby/qtruby/tools/rbuic/option.h +107 -0
  1047. data/ext/ruby/qtruby/tools/rbuic/rbuic.pri +23 -0
  1048. data/ext/ruby/qtruby/tools/rbuic/rbuic4.pro +43 -0
  1049. data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.cpp +150 -0
  1050. data/ext/ruby/qtruby/tools/rbuic/ruby/rbextractimages.h +83 -0
  1051. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.cpp +217 -0
  1052. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.h +85 -0
  1053. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.cpp +185 -0
  1054. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondata.h +86 -0
  1055. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.cpp +88 -0
  1056. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteicondeclaration.h +83 -0
  1057. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.cpp +126 -0
  1058. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteiconinitialization.h +87 -0
  1059. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp +2478 -0
  1060. data/ext/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.h +314 -0
  1061. data/ext/ruby/qtruby/tools/rbuic/ruby/ruby.pri +18 -0
  1062. data/ext/ruby/qtruby/tools/rbuic/treewalker.cpp +318 -0
  1063. data/ext/ruby/qtruby/tools/rbuic/treewalker.h +139 -0
  1064. data/ext/ruby/qtruby/tools/rbuic/ui4.cpp +7623 -0
  1065. data/ext/ruby/qtruby/tools/rbuic/ui4.h +3180 -0
  1066. data/ext/ruby/qtruby/tools/rbuic/uic.cpp +438 -0
  1067. data/ext/ruby/qtruby/tools/rbuic/uic.h +154 -0
  1068. data/ext/ruby/qtruby/tools/rbuic/utils.h +125 -0
  1069. data/ext/ruby/qtruby/tools/rbuic/validator.cpp +100 -0
  1070. data/ext/ruby/qtruby/tools/rbuic/validator.h +80 -0
  1071. data/ext/ruby/qtscript/CMakeLists.txt +19 -0
  1072. data/ext/ruby/qtscript/qtscript.cpp +82 -0
  1073. data/ext/ruby/qtscript/qtscript.rb +40 -0
  1074. data/ext/ruby/qtscript/qtscripthandlers.cpp +36 -0
  1075. data/ext/ruby/qtscript/smokedata.cpp +1403 -0
  1076. data/ext/ruby/qttest/CMakeLists.txt +18 -0
  1077. data/ext/ruby/qttest/ChangeLog +9 -0
  1078. data/ext/ruby/qttest/examples/myfirsttest.rb +30 -0
  1079. data/ext/ruby/qttest/qttest.cpp +82 -0
  1080. data/ext/ruby/qttest/qttest.rb +166 -0
  1081. data/ext/ruby/qttest/qttesthandlers.cpp +35 -0
  1082. data/ext/ruby/qtuitools/CMakeLists.txt +16 -0
  1083. data/ext/ruby/qtuitools/qtuitools.cpp +82 -0
  1084. data/ext/ruby/qtuitools/qtuitools.rb +17 -0
  1085. data/ext/ruby/qtuitools/qtuitoolshandlers.cpp +31 -0
  1086. data/ext/ruby/qtwebkit/CMakeLists.txt +17 -0
  1087. data/ext/ruby/qtwebkit/qtwebkit.cpp +66 -0
  1088. data/ext/ruby/qtwebkit/qtwebkit.rb +17 -0
  1089. data/ext/ruby/qtwebkit/qtwebkithandlers.cpp +39 -0
  1090. data/ext/smoke/CMakeLists.txt +35 -0
  1091. data/ext/smoke/deptool/CMakeLists.txt +7 -0
  1092. data/ext/smoke/deptool/main.cpp +128 -0
  1093. data/ext/smoke/qt_smoke.h +16 -0
  1094. data/ext/smoke/qtcore/CMakeLists.txt +88 -0
  1095. data/ext/smoke/qtcore/QtGuess.txt +181 -0
  1096. data/ext/smoke/qtcore/config.xml.cmake +10 -0
  1097. data/ext/smoke/qtcore/qt-config.xml.cmake +21 -0
  1098. data/ext/smoke/qtcore/qtcore_includes.h +1 -0
  1099. data/ext/smoke/qtcore/smokeconfig.xml +189 -0
  1100. data/ext/smoke/qtcore/tests/CMakeLists.txt +13 -0
  1101. data/ext/smoke/qtcore/tests/test.cpp +846 -0
  1102. data/ext/smoke/qtcore_smoke.h +16 -0
  1103. data/ext/smoke/qtdbus/CMakeLists.txt +38 -0
  1104. data/ext/smoke/qtdbus/config.xml.cmake +11 -0
  1105. data/ext/smoke/qtdbus/qtdbus_includes.h +2 -0
  1106. data/ext/smoke/qtdbus/smokeconfig.xml +63 -0
  1107. data/ext/smoke/qtdbus_smoke.h +16 -0
  1108. data/ext/smoke/qtgui/CMakeLists.txt +76 -0
  1109. data/ext/smoke/qtgui/config.xml.cmake +11 -0
  1110. data/ext/smoke/qtgui/qtgui_includes.h +7 -0
  1111. data/ext/smoke/qtgui/smokeconfig.xml +490 -0
  1112. data/ext/smoke/qtgui_smoke.h +16 -0
  1113. data/ext/smoke/qtmultimedia/CMakeLists.txt +42 -0
  1114. data/ext/smoke/qtmultimedia/config.xml.cmake +12 -0
  1115. data/ext/smoke/qtmultimedia/qtmultimedia_includes.h +3 -0
  1116. data/ext/smoke/qtmultimedia/smokeconfig.xml +50 -0
  1117. data/ext/smoke/qtmultimedia_smoke.h +16 -0
  1118. data/ext/smoke/qtnetwork/CMakeLists.txt +38 -0
  1119. data/ext/smoke/qtnetwork/config.xml.cmake +11 -0
  1120. data/ext/smoke/qtnetwork/qtnetwork_includes.h +2 -0
  1121. data/ext/smoke/qtnetwork/smokeconfig.xml +76 -0
  1122. data/ext/smoke/qtnetwork_smoke.h +16 -0
  1123. data/ext/smoke/qtopengl/CMakeLists.txt +43 -0
  1124. data/ext/smoke/qtopengl/config.xml.cmake +12 -0
  1125. data/ext/smoke/qtopengl/qtopengl_includes.h +3 -0
  1126. data/ext/smoke/qtopengl/smokeconfig.xml +56 -0
  1127. data/ext/smoke/qtopengl_smoke.h +16 -0
  1128. data/ext/smoke/qtscript/CMakeLists.txt +31 -0
  1129. data/ext/smoke/qtscript/config.xml.cmake +11 -0
  1130. data/ext/smoke/qtscript/qtscript_includes.h +14 -0
  1131. data/ext/smoke/qtscript/smokeconfig.xml +39 -0
  1132. data/ext/smoke/qtscript_smoke.h +16 -0
  1133. data/ext/smoke/qtsql/CMakeLists.txt +41 -0
  1134. data/ext/smoke/qtsql/config.xml.cmake +11 -0
  1135. data/ext/smoke/qtsql/qtsql_includes.h +2 -0
  1136. data/ext/smoke/qtsql/smokeconfig.xml +56 -0
  1137. data/ext/smoke/qtsql_smoke.h +16 -0
  1138. data/ext/smoke/qtsvg/CMakeLists.txt +43 -0
  1139. data/ext/smoke/qtsvg/config.xml.cmake +12 -0
  1140. data/ext/smoke/qtsvg/qtsvg_includes.h +3 -0
  1141. data/ext/smoke/qtsvg/smokeconfig.xml +45 -0
  1142. data/ext/smoke/qtsvg_smoke.h +16 -0
  1143. data/ext/smoke/qttest/CMakeLists.txt +35 -0
  1144. data/ext/smoke/qttest/config.xml.cmake +12 -0
  1145. data/ext/smoke/qttest/qttest_includes.h +14 -0
  1146. data/ext/smoke/qttest/smokeconfig.xml +36 -0
  1147. data/ext/smoke/qttest_smoke.h +16 -0
  1148. data/ext/smoke/qtuitools/CMakeLists.txt +30 -0
  1149. data/ext/smoke/qtuitools/config.xml.cmake +12 -0
  1150. data/ext/smoke/qtuitools/qtuitools_includes.h +1 -0
  1151. data/ext/smoke/qtuitools/smokeconfig.xml +20 -0
  1152. data/ext/smoke/qtuitools_smoke.h +16 -0
  1153. data/ext/smoke/qtwebkit/CMakeLists.txt +36 -0
  1154. data/ext/smoke/qtwebkit/config.xml.cmake +11 -0
  1155. data/ext/smoke/qtwebkit/qtwebkit_includes.h +1 -0
  1156. data/ext/smoke/qtwebkit/smokeconfig.xml +45 -0
  1157. data/ext/smoke/qtwebkit_smoke.h +16 -0
  1158. data/ext/smoke/qtxml/CMakeLists.txt +41 -0
  1159. data/ext/smoke/qtxml/config.xml.cmake +11 -0
  1160. data/ext/smoke/qtxml/qtxml_includes.h +2 -0
  1161. data/ext/smoke/qtxml/smokeconfig.xml +70 -0
  1162. data/ext/smoke/qtxml_smoke.h +16 -0
  1163. data/ext/smoke/qtxmlpatterns/CMakeLists.txt +42 -0
  1164. data/ext/smoke/qtxmlpatterns/config.xml.cmake +12 -0
  1165. data/ext/smoke/qtxmlpatterns/qtxmlpatterns_includes.h +3 -0
  1166. data/ext/smoke/qtxmlpatterns/smokeconfig.xml +80 -0
  1167. data/ext/smoke/qtxmlpatterns_smoke.h +16 -0
  1168. data/ext/smoke/smoke.h +557 -0
  1169. data/ext/smoke/smokeapi/CMakeLists.txt +9 -0
  1170. data/ext/smoke/smokeapi/main.cpp +309 -0
  1171. data/ext/smoke/smokebase/CMakeLists.txt +11 -0
  1172. data/ext/smoke/smokebase/smokebase.cpp +6 -0
  1173. data/ext/smoke/solid_smoke.h +16 -0
  1174. data/extconf.rb +231 -0
  1175. data/lib/1.8/libqtruby4shared.dll +0 -0
  1176. data/lib/1.8/libsmokebase.dll +0 -0
  1177. data/lib/1.8/libsmokeqtcore.dll +0 -0
  1178. data/lib/1.8/libsmokeqtgui.dll +0 -0
  1179. data/lib/1.8/libsmokeqtmultimedia.dll +0 -0
  1180. data/lib/1.8/libsmokeqtnetwork.dll +0 -0
  1181. data/lib/1.8/libsmokeqtopengl.dll +0 -0
  1182. data/lib/1.8/libsmokeqtscript.dll +0 -0
  1183. data/lib/1.8/libsmokeqtsql.dll +0 -0
  1184. data/lib/1.8/libsmokeqtsvg.dll +0 -0
  1185. data/lib/1.8/libsmokeqttest.dll +0 -0
  1186. data/lib/1.8/libsmokeqtuitools.dll +0 -0
  1187. data/lib/1.8/libsmokeqtwebkit.dll +0 -0
  1188. data/lib/1.8/libsmokeqtxml.dll +0 -0
  1189. data/lib/1.8/libsmokeqtxmlpatterns.dll +0 -0
  1190. data/lib/1.8/qtruby4.so +0 -0
  1191. data/lib/1.8/qtscript.so +0 -0
  1192. data/lib/1.8/qttest.so +0 -0
  1193. data/lib/1.8/qtuitools.so +0 -0
  1194. data/lib/1.8/qtwebkit.so +0 -0
  1195. data/lib/1.9/libqtruby4shared.dll +0 -0
  1196. data/lib/1.9/libsmokebase.dll +0 -0
  1197. data/lib/1.9/libsmokeqtcore.dll +0 -0
  1198. data/lib/1.9/libsmokeqtgui.dll +0 -0
  1199. data/lib/1.9/libsmokeqtmultimedia.dll +0 -0
  1200. data/lib/1.9/libsmokeqtnetwork.dll +0 -0
  1201. data/lib/1.9/libsmokeqtopengl.dll +0 -0
  1202. data/lib/1.9/libsmokeqtscript.dll +0 -0
  1203. data/lib/1.9/libsmokeqtsql.dll +0 -0
  1204. data/lib/1.9/libsmokeqtsvg.dll +0 -0
  1205. data/lib/1.9/libsmokeqttest.dll +0 -0
  1206. data/lib/1.9/libsmokeqtuitools.dll +0 -0
  1207. data/lib/1.9/libsmokeqtwebkit.dll +0 -0
  1208. data/lib/1.9/libsmokeqtxml.dll +0 -0
  1209. data/lib/1.9/libsmokeqtxmlpatterns.dll +0 -0
  1210. data/lib/1.9/qtruby4.so +0 -0
  1211. data/lib/1.9/qtscript.so +0 -0
  1212. data/lib/1.9/qttest.so +0 -0
  1213. data/lib/1.9/qtuitools.so +0 -0
  1214. data/lib/1.9/qtwebkit.so +0 -0
  1215. data/lib/Qt.rb +1 -0
  1216. data/lib/Qt/qtruby4.rb +3177 -0
  1217. data/lib/Qt4.rb +20 -0
  1218. data/lib/qtbindings_version.rb +2 -0
  1219. data/lib/qtscript/qtscript.rb +40 -0
  1220. data/lib/qttest/qttest.rb +166 -0
  1221. data/lib/qtuitools/qtuitools.rb +17 -0
  1222. data/lib/qtwebkit/qtwebkit.rb +17 -0
  1223. data/qtbindings.gemspec +18 -0
  1224. data/qtbindingsnative.gemspec +18 -0
  1225. metadata +1297 -0
@@ -0,0 +1,126 @@
1
+ /****************************************************************************
2
+ **
3
+ ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4
+ **
5
+ ** This file is part of the tools applications of the Qt Toolkit.
6
+ **
7
+ ** This file may be used under the terms of the GNU General Public
8
+ ** License versions 2.0 or 3.0 as published by the Free Software
9
+ ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
10
+ ** included in the packaging of this file. Alternatively you may (at
11
+ ** your option) use any later version of the GNU General Public
12
+ ** License if such license has been publicly approved by Trolltech ASA
13
+ ** (or its successors, if any) and the KDE Free Qt Foundation. In
14
+ ** addition, as a special exception, Trolltech gives you certain
15
+ ** additional rights. These rights are described in the Trolltech GPL
16
+ ** Exception version 1.2, which can be found at
17
+ ** http://www.trolltech.com/products/qt/gplexception/ and in the file
18
+ ** GPL_EXCEPTION.txt in this package.
19
+ **
20
+ ** Please review the following information to ensure GNU General
21
+ ** Public Licensing requirements will be met:
22
+ ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
23
+ ** you are unsure which license is appropriate for your use, please
24
+ ** review the following information:
25
+ ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
26
+ ** or contact the sales department at sales@trolltech.com.
27
+ **
28
+ ** In addition, as a special exception, Trolltech, as the sole
29
+ ** copyright holder for Qt Designer, grants users of the Qt/Eclipse
30
+ ** Integration plug-in the right for the Qt/Eclipse Integration to
31
+ ** link to functionality provided by Qt Designer and its related
32
+ ** libraries.
33
+ **
34
+ ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
35
+ ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
36
+ ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
37
+ ** granted herein.
38
+ **
39
+ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
40
+ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41
+ **
42
+ ****************************************************************************/
43
+
44
+ #include "rbwriteiconinitialization.h"
45
+ #include "rbwriteicondata.h"
46
+ #include "driver.h"
47
+ #include "ui4.h"
48
+ #include "utils.h"
49
+ #include "uic.h"
50
+
51
+ #include <QtCore/QTextStream>
52
+ #include <QtCore/QString>
53
+
54
+ #if defined(QT_BEGIN_NAMESPACE)
55
+ QT_BEGIN_NAMESPACE
56
+ #endif
57
+
58
+ namespace Ruby {
59
+
60
+ WriteIconInitialization::WriteIconInitialization(Uic *uic)
61
+ : driver(uic->driver()), output(uic->output()), option(uic->option())
62
+ {
63
+ this->uic = uic;
64
+ }
65
+
66
+ void WriteIconInitialization::acceptUI(DomUI *node)
67
+ {
68
+ if (node->elementImages() == 0)
69
+ return;
70
+
71
+ QString className = node->elementClass() + option.postfix;
72
+
73
+ output << option.indent << "def self.icon(id)\n";
74
+
75
+ WriteIconData(uic).acceptUI(node);
76
+
77
+ output << option.indent << option.indent << "case id\n";
78
+
79
+ TreeWalker::acceptUI(node);
80
+
81
+ output << option.indent << option.indent << "else\n";
82
+ output << option.indent << option.indent << option.indent << "return Qt::Pixmap.new\n";
83
+
84
+ output << option.indent << option.indent << "end\n"
85
+ << option.indent << "end\n\n";
86
+ }
87
+
88
+ QString WriteIconInitialization::iconFromDataFunction()
89
+ {
90
+ return QLatin1String("qt_get_icon");
91
+ }
92
+
93
+ void WriteIconInitialization::acceptImages(DomImages *images)
94
+ {
95
+ TreeWalker::acceptImages(images);
96
+ }
97
+
98
+ void WriteIconInitialization::acceptImage(DomImage *image)
99
+ {
100
+ QString img = image->attributeName() + QLatin1String("_data");
101
+ QString data = image->elementData()->text();
102
+ QString fmt = image->elementData()->attributeFormat();
103
+
104
+ QString imageId = image->attributeName() + QLatin1String("_ID");
105
+ QString imageData = image->attributeName() + QLatin1String("_data");
106
+ QString ind = option.indent + option.indent;
107
+
108
+ output << ind << "when " << imageId << "\n";
109
+
110
+ if (fmt == QLatin1String("XPM.GZ")) {
111
+ output << option.indent << option.indent << option.indent << "return " << "Qt::Pixmap.new(" << imageData << ")\n";
112
+ } else {
113
+ output << option.indent << option.indent << option.indent <<
114
+ " img = Qt::Image.new\n";
115
+ output << option.indent << option.indent << option.indent << "img.loadFromData(" << imageData << ", " <<
116
+ "imageData.length, " << fixString(fmt, ind) << ")\n";
117
+ output << option.indent << option.indent << option.indent <<
118
+ "return Qt::Pixmap.fromImage(img)\n";
119
+ }
120
+ }
121
+
122
+ } // namespace Ruby
123
+
124
+ #if defined(QT_END_NAMESPACE)
125
+ QT_END_NAMESPACE
126
+ #endif
@@ -0,0 +1,87 @@
1
+ /****************************************************************************
2
+ **
3
+ ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4
+ **
5
+ ** This file is part of the tools applications of the Qt Toolkit.
6
+ **
7
+ ** This file may be used under the terms of the GNU General Public
8
+ ** License versions 2.0 or 3.0 as published by the Free Software
9
+ ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
10
+ ** included in the packaging of this file. Alternatively you may (at
11
+ ** your option) use any later version of the GNU General Public
12
+ ** License if such license has been publicly approved by Trolltech ASA
13
+ ** (or its successors, if any) and the KDE Free Qt Foundation. In
14
+ ** addition, as a special exception, Trolltech gives you certain
15
+ ** additional rights. These rights are described in the Trolltech GPL
16
+ ** Exception version 1.2, which can be found at
17
+ ** http://www.trolltech.com/products/qt/gplexception/ and in the file
18
+ ** GPL_EXCEPTION.txt in this package.
19
+ **
20
+ ** Please review the following information to ensure GNU General
21
+ ** Public Licensing requirements will be met:
22
+ ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
23
+ ** you are unsure which license is appropriate for your use, please
24
+ ** review the following information:
25
+ ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
26
+ ** or contact the sales department at sales@trolltech.com.
27
+ **
28
+ ** In addition, as a special exception, Trolltech, as the sole
29
+ ** copyright holder for Qt Designer, grants users of the Qt/Eclipse
30
+ ** Integration plug-in the right for the Qt/Eclipse Integration to
31
+ ** link to functionality provided by Qt Designer and its related
32
+ ** libraries.
33
+ **
34
+ ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
35
+ ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
36
+ ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
37
+ ** granted herein.
38
+ **
39
+ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
40
+ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41
+ **
42
+ ****************************************************************************/
43
+
44
+ #ifndef RBWRITEICONINITIALIZATION_H
45
+ #define RBWRITEICONINITIALIZATION_H
46
+
47
+ #include "treewalker.h"
48
+
49
+ class QString;
50
+
51
+ #if defined(QT_BEGIN_NAMESPACE)
52
+ QT_BEGIN_NAMESPACE
53
+ #endif
54
+
55
+ class QTextStream;
56
+ class Driver;
57
+ class Uic;
58
+
59
+ struct Option;
60
+
61
+ namespace Ruby {
62
+
63
+ class WriteIconInitialization : public TreeWalker
64
+ {
65
+ public:
66
+ WriteIconInitialization(Uic *uic);
67
+
68
+ void acceptUI(DomUI *node);
69
+ void acceptImages(DomImages *images);
70
+ void acceptImage(DomImage *image);
71
+
72
+ static QString iconFromDataFunction();
73
+
74
+ private:
75
+ Uic *uic;
76
+ Driver *driver;
77
+ QTextStream &output;
78
+ const Option &option;
79
+ };
80
+
81
+ } // namespace Ruby
82
+
83
+ #if defined(QT_END_NAMESPACE)
84
+ QT_END_NAMESPACE
85
+ #endif
86
+
87
+ #endif // RBWRITEICONINITIALIZATION_H
@@ -0,0 +1,2478 @@
1
+ /****************************************************************************
2
+ **
3
+ ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4
+ **
5
+ ** This file is part of the tools applications of the Qt Toolkit.
6
+ **
7
+ ** This file may be used under the terms of the GNU General Public
8
+ ** License versions 2.0 or 3.0 as published by the Free Software
9
+ ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
10
+ ** included in the packaging of this file. Alternatively you may (at
11
+ ** your option) use any later version of the GNU General Public
12
+ ** License if such license has been publicly approved by Trolltech ASA
13
+ ** (or its successors, if any) and the KDE Free Qt Foundation. In
14
+ ** addition, as a special exception, Trolltech gives you certain
15
+ ** additional rights. These rights are described in the Trolltech GPL
16
+ ** Exception version 1.2, which can be found at
17
+ ** http://www.trolltech.com/products/qt/gplexception/ and in the file
18
+ ** GPL_EXCEPTION.txt in this package.
19
+ **
20
+ ** Please review the following information to ensure GNU General
21
+ ** Public Licensing requirements will be met:
22
+ ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
23
+ ** you are unsure which license is appropriate for your use, please
24
+ ** review the following information:
25
+ ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
26
+ ** or contact the sales department at sales@trolltech.com.
27
+ **
28
+ ** In addition, as a special exception, Trolltech, as the sole
29
+ ** copyright holder for Qt Designer, grants users of the Qt/Eclipse
30
+ ** Integration plug-in the right for the Qt/Eclipse Integration to
31
+ ** link to functionality provided by Qt Designer and its related
32
+ ** libraries.
33
+ **
34
+ ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
35
+ ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
36
+ ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
37
+ ** granted herein.
38
+ **
39
+ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
40
+ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41
+ **
42
+ ****************************************************************************/
43
+
44
+ #include "rbwriteinitialization.h"
45
+ #include "rbwriteiconinitialization.h"
46
+ #include "driver.h"
47
+ #include "ui4.h"
48
+ #include "utils.h"
49
+ #include "uic.h"
50
+ #include "databaseinfo.h"
51
+ #include "globaldefs.h"
52
+
53
+ #include <QtCore/QTextStream>
54
+ #include <QtCore/QDebug>
55
+
56
+ #if defined(QT_BEGIN_NAMESPACE)
57
+ QT_BEGIN_NAMESPACE
58
+ #endif
59
+
60
+ namespace {
61
+ // Fixup an enumeration name from class Qt.
62
+ // They are currently stored as "BottomToolBarArea" instead of "Qt::BottomToolBarArea".
63
+ // due to MO issues. This might be fixed in the future.
64
+ void fixQtEnumerationName(QString& name) {
65
+ static const QLatin1String prefix("Qt::");
66
+ if (name.indexOf(prefix) != 0)
67
+ name.prepend(prefix);
68
+ }
69
+ // figure out the toolbar area of a DOM attrib list.
70
+ // By legacy, it is stored as an integer. As of 4.3.0, it is the enumeration value.
71
+ QString toolBarAreaStringFromDOMAttributes(const Ruby::WriteInitialization::DomPropertyMap &attributes) {
72
+ const DomProperty *pstyle = attributes.value(QLatin1String("toolBarArea"));
73
+ if (!pstyle)
74
+ return QString();
75
+
76
+ switch (pstyle->kind()) {
77
+ case DomProperty::Number: {
78
+ QString area = QLatin1String("(");
79
+ area += QString::number(pstyle->elementNumber());
80
+ area += QLatin1String("), ");
81
+ return area;
82
+ }
83
+ case DomProperty::Enum: {
84
+ QString area = pstyle->elementEnum();
85
+ fixQtEnumerationName(area);
86
+ area += QLatin1String(", ");
87
+ return area;
88
+ }
89
+ default:
90
+ break;
91
+ }
92
+ return QString();
93
+ }
94
+
95
+ // Write a statement to create a spacer item.
96
+ void writeSpacerItem(const DomSpacer *node, QTextStream &output) {
97
+ const QHash<QString, DomProperty *> properties = propertyMap(node->elementProperty());
98
+ output << "Qt::SpacerItem.new(";
99
+
100
+ if (properties.contains(QLatin1String("sizeHint"))) {
101
+ const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize();
102
+ output << sizeHint->elementWidth() << ", " << sizeHint->elementHeight() << ", ";
103
+ }
104
+
105
+ // size type
106
+ QString sizeType = properties.contains(QLatin1String("sizeType")) ?
107
+ properties.value(QLatin1String("sizeType"))->elementEnum() :
108
+ QString::fromLatin1("Expanding");
109
+
110
+ sizeType.replace("QSizePolicy", "Qt::SizePolicy");
111
+ if (!sizeType.startsWith(QLatin1String("Qt::SizePolicy::")))
112
+ sizeType.prepend(QLatin1String("Qt::SizePolicy::"));
113
+ // orientation
114
+ bool isVspacer = false;
115
+ if (properties.contains(QLatin1String("orientation"))) {
116
+ const QString orientation = properties.value(QLatin1String("orientation"))->elementEnum();
117
+ if (orientation == QLatin1String("Qt::Vertical") || orientation == QLatin1String("Vertical")) isVspacer = true;
118
+ }
119
+
120
+ if (isVspacer)
121
+ output << "Qt::SizePolicy::Minimum, " << sizeType << ')';
122
+ else
123
+ output << sizeType << ", Qt::SizePolicy::Minimum)";
124
+ }
125
+
126
+
127
+ // Helper for implementing comparison functions for integers.
128
+ int compareInt(int i1, int i2) {
129
+ if (i1 < i2) return -1;
130
+ if (i1 > i2) return 1;
131
+ return 0;
132
+ }
133
+
134
+ // Write object.setFoo(x)
135
+ template <class Value>
136
+ void writeSetter(const QString &indent, const QString &varName,const QString &setter, Value v, QTextStream &str) {
137
+ QString setFunction(setter[3].toLower());
138
+ setFunction += setter.mid(4);
139
+ str << indent << varName << "." << setFunction << " = " << v << "\n";
140
+ }
141
+
142
+
143
+ static inline bool isIconFormat44(const DomResourceIcon *i) {
144
+ return i->hasElementNormalOff() || i->hasElementNormalOn() ||
145
+ i->hasElementDisabledOff() || i->hasElementDisabledOn() ||
146
+ i->hasElementActiveOff() || i->hasElementActiveOn() ||
147
+ i->hasElementSelectedOff() || i->hasElementSelectedOn();
148
+ }
149
+
150
+ // Check on properties. Filter out empty legacy pixmap/icon properties
151
+ // as Designer pre 4.4 used to remove missing resource references.
152
+ // This can no longer be handled by the code as we have 'setIcon(QIcon())' as well as 'QIcon icon'
153
+ static bool checkProperty(const QString &fileName, const DomProperty *p) {
154
+ switch (p->kind()) {
155
+ case DomProperty::IconSet:
156
+ if (const DomResourceIcon *dri = p->elementIconSet()) {
157
+ if (!isIconFormat44(dri)) {
158
+ if (dri->text().isEmpty()) {
159
+ const QString msg = QString::fromUtf8("%1: An invalid icon property '%2' was encountered.").arg(fileName).arg(p->attributeName());
160
+ qWarning("%s", msg.toUtf8().constData());
161
+ return false;
162
+ }
163
+ }
164
+ }
165
+ break;
166
+ case DomProperty::Pixmap:
167
+ if (const DomResourcePixmap *drp = p->elementPixmap())
168
+ if (drp->text().isEmpty()) {
169
+ const QString msg = QString::fromUtf8("%1: An invalid pixmap property '%2' was encountered.").arg(fileName).arg(p->attributeName());
170
+ qWarning("%s", msg.toUtf8().constData());
171
+ return false;
172
+ }
173
+ break;
174
+ default:
175
+ break;
176
+ }
177
+ return true;
178
+ }
179
+ }
180
+
181
+ namespace Ruby {
182
+
183
+ FontHandle::FontHandle(const DomFont *domFont) :
184
+ m_domFont(domFont)
185
+ {
186
+ }
187
+
188
+ int FontHandle::compare(const FontHandle &rhs) const
189
+ {
190
+ const QString family = m_domFont->hasElementFamily() ? m_domFont->elementFamily() : QString();
191
+ const QString rhsFamily = rhs.m_domFont->hasElementFamily() ? rhs.m_domFont->elementFamily() : QString();
192
+
193
+ if (const int frc = family.compare(rhsFamily))
194
+ return frc;
195
+
196
+ const int pointSize = m_domFont->hasElementPointSize() ? m_domFont->elementPointSize() : -1;
197
+ const int rhsPointSize = rhs.m_domFont->hasElementPointSize() ? rhs.m_domFont->elementPointSize() : -1;
198
+
199
+ if (const int crc = compareInt(pointSize, rhsPointSize))
200
+ return crc;
201
+
202
+ const int bold = m_domFont->hasElementBold() ? (m_domFont->elementBold() ? 1 : 0) : -1;
203
+ const int rhsBold = rhs.m_domFont->hasElementBold() ? (rhs.m_domFont->elementBold() ? 1 : 0) : -1;
204
+ if (const int crc = compareInt(bold, rhsBold))
205
+ return crc;
206
+
207
+ const int italic = m_domFont->hasElementItalic() ? (m_domFont->elementItalic() ? 1 : 0) : -1;
208
+ const int rhsItalic = rhs.m_domFont->hasElementItalic() ? (rhs.m_domFont->elementItalic() ? 1 : 0) : -1;
209
+ if (const int crc = compareInt(italic, rhsItalic))
210
+ return crc;
211
+
212
+ const int underline = m_domFont->hasElementUnderline() ? (m_domFont->elementUnderline() ? 1 : 0) : -1;
213
+ const int rhsUnderline = rhs.m_domFont->hasElementUnderline() ? (rhs.m_domFont->elementUnderline() ? 1 : 0) : -1;
214
+ if (const int crc = compareInt(underline, rhsUnderline))
215
+ return crc;
216
+
217
+ const int weight = m_domFont->hasElementWeight() ? m_domFont->elementWeight() : -1;
218
+ const int rhsWeight = rhs.m_domFont->hasElementWeight() ? rhs.m_domFont->elementWeight() : -1;
219
+ if (const int crc = compareInt(weight, rhsWeight))
220
+ return crc;
221
+
222
+ const int strikeOut = m_domFont->hasElementStrikeOut() ? (m_domFont->elementStrikeOut() ? 1 : 0) : -1;
223
+ const int rhsStrikeOut = rhs.m_domFont->hasElementStrikeOut() ? (rhs.m_domFont->elementStrikeOut() ? 1 : 0) : -1;
224
+ if (const int crc = compareInt(strikeOut, rhsStrikeOut))
225
+ return crc;
226
+
227
+ const int kerning = m_domFont->hasElementKerning() ? (m_domFont->elementKerning() ? 1 : 0) : -1;
228
+ const int rhsKerning = rhs.m_domFont->hasElementKerning() ? (rhs.m_domFont->elementKerning() ? 1 : 0) : -1;
229
+ if (const int crc = compareInt(kerning, rhsKerning))
230
+ return crc;
231
+
232
+ const int antialiasing = m_domFont->hasElementAntialiasing() ? (m_domFont->elementAntialiasing() ? 1 : 0) : -1;
233
+ const int rhsAntialiasing = rhs.m_domFont->hasElementAntialiasing() ? (rhs.m_domFont->elementAntialiasing() ? 1 : 0) : -1;
234
+ if (const int crc = compareInt(antialiasing, rhsAntialiasing))
235
+ return crc;
236
+
237
+ const QString styleStrategy = m_domFont->hasElementStyleStrategy() ? m_domFont->elementStyleStrategy() : QString();
238
+ const QString rhsStyleStrategy = rhs.m_domFont->hasElementStyleStrategy() ? rhs.m_domFont->elementStyleStrategy() : QString();
239
+
240
+ if (const int src = styleStrategy.compare(rhsStyleStrategy))
241
+ return src;
242
+
243
+ return 0;
244
+ }
245
+
246
+ IconHandle::IconHandle(const DomResourceIcon *domIcon) :
247
+ m_domIcon(domIcon)
248
+ {
249
+ }
250
+
251
+ int IconHandle::compare(const IconHandle &rhs) const
252
+ {
253
+ const QString normalOff = m_domIcon->hasElementNormalOff() ? m_domIcon->elementNormalOff()->text() : QString();
254
+ const QString rhsNormalOff = rhs.m_domIcon->hasElementNormalOff() ? rhs.m_domIcon->elementNormalOff()->text() : QString();
255
+ if (const int comp = normalOff.compare(rhsNormalOff))
256
+ return comp;
257
+
258
+ const QString normalOn = m_domIcon->hasElementNormalOn() ? m_domIcon->elementNormalOn()->text() : QString();
259
+ const QString rhsNormalOn = rhs.m_domIcon->hasElementNormalOn() ? rhs.m_domIcon->elementNormalOn()->text() : QString();
260
+ if (const int comp = normalOn.compare(rhsNormalOn))
261
+ return comp;
262
+
263
+ const QString disabledOff = m_domIcon->hasElementDisabledOff() ? m_domIcon->elementDisabledOff()->text() : QString();
264
+ const QString rhsDisabledOff = rhs.m_domIcon->hasElementDisabledOff() ? rhs.m_domIcon->elementDisabledOff()->text() : QString();
265
+ if (const int comp = disabledOff.compare(rhsDisabledOff))
266
+ return comp;
267
+
268
+ const QString disabledOn = m_domIcon->hasElementDisabledOn() ? m_domIcon->elementDisabledOn()->text() : QString();
269
+ const QString rhsDisabledOn = rhs.m_domIcon->hasElementDisabledOn() ? rhs.m_domIcon->elementDisabledOn()->text() : QString();
270
+ if (const int comp = disabledOn.compare(rhsDisabledOn))
271
+ return comp;
272
+
273
+ const QString activeOff = m_domIcon->hasElementActiveOff() ? m_domIcon->elementActiveOff()->text() : QString();
274
+ const QString rhsActiveOff = rhs.m_domIcon->hasElementActiveOff() ? rhs.m_domIcon->elementActiveOff()->text() : QString();
275
+ if (const int comp = activeOff.compare(rhsActiveOff))
276
+ return comp;
277
+
278
+ const QString activeOn = m_domIcon->hasElementActiveOn() ? m_domIcon->elementActiveOn()->text() : QString();
279
+ const QString rhsActiveOn = rhs.m_domIcon->hasElementActiveOn() ? rhs.m_domIcon->elementActiveOn()->text() : QString();
280
+ if (const int comp = activeOn.compare(rhsActiveOn))
281
+ return comp;
282
+
283
+ const QString selectedOff = m_domIcon->hasElementSelectedOff() ? m_domIcon->elementSelectedOff()->text() : QString();
284
+ const QString rhsSelectedOff = rhs.m_domIcon->hasElementSelectedOff() ? rhs.m_domIcon->elementSelectedOff()->text() : QString();
285
+ if (const int comp = selectedOff.compare(rhsSelectedOff))
286
+ return comp;
287
+
288
+ const QString selectedOn = m_domIcon->hasElementSelectedOn() ? m_domIcon->elementSelectedOn()->text() : QString();
289
+ const QString rhsSelectedOn = rhs.m_domIcon->hasElementSelectedOn() ? rhs.m_domIcon->elementSelectedOn()->text() : QString();
290
+ if (const int comp = selectedOn.compare(rhsSelectedOn))
291
+ return comp;
292
+ // Pre 4.4 Legacy
293
+ if (const int comp = m_domIcon->text().compare(rhs.m_domIcon->text()))
294
+ return comp;
295
+
296
+ return 0;
297
+ }
298
+
299
+
300
+ #if defined(Q_OS_MAC) && defined(Q_CC_GNU) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3)
301
+ inline uint qHash(const SizePolicyHandle &handle) { return qHash(handle.m_domSizePolicy); }
302
+ inline uint qHash(const FontHandle &handle) { return qHash(handle.m_domFont); }
303
+ inline uint qHash(const IconHandle &handle) { return qHash(handle.m_domIcon); }
304
+ #endif
305
+
306
+ SizePolicyHandle::SizePolicyHandle(const DomSizePolicy *domSizePolicy) :
307
+ m_domSizePolicy(domSizePolicy)
308
+ {
309
+ }
310
+
311
+ int SizePolicyHandle::compare(const SizePolicyHandle &rhs) const
312
+ {
313
+
314
+ const int hSizeType = m_domSizePolicy->hasElementHSizeType() ? m_domSizePolicy->elementHSizeType() : -1;
315
+ const int rhsHSizeType = rhs.m_domSizePolicy->hasElementHSizeType() ? rhs.m_domSizePolicy->elementHSizeType() : -1;
316
+ if (const int crc = compareInt(hSizeType, rhsHSizeType))
317
+ return crc;
318
+
319
+ const int vSizeType = m_domSizePolicy->hasElementVSizeType() ? m_domSizePolicy->elementVSizeType() : -1;
320
+ const int rhsVSizeType = rhs.m_domSizePolicy->hasElementVSizeType() ? rhs.m_domSizePolicy->elementVSizeType() : -1;
321
+ if (const int crc = compareInt(vSizeType, rhsVSizeType))
322
+ return crc;
323
+
324
+ const int hStretch = m_domSizePolicy->hasElementHorStretch() ? m_domSizePolicy->elementHorStretch() : -1;
325
+ const int rhsHStretch = rhs.m_domSizePolicy->hasElementHorStretch() ? rhs.m_domSizePolicy->elementHorStretch() : -1;
326
+ if (const int crc = compareInt(hStretch, rhsHStretch))
327
+ return crc;
328
+
329
+ const int vStretch = m_domSizePolicy->hasElementVerStretch() ? m_domSizePolicy->elementVerStretch() : -1;
330
+ const int rhsVStretch = rhs.m_domSizePolicy->hasElementVerStretch() ? rhs.m_domSizePolicy->elementVerStretch() : -1;
331
+ if (const int crc = compareInt(vStretch, rhsVStretch))
332
+ return crc;
333
+
334
+ const QString attributeHSizeType = m_domSizePolicy->hasAttributeHSizeType() ? m_domSizePolicy->attributeHSizeType() : QString();
335
+ const QString rhsAttributeHSizeType = rhs.m_domSizePolicy->hasAttributeHSizeType() ? rhs.m_domSizePolicy->attributeHSizeType() : QString();
336
+
337
+ if (const int hrc = attributeHSizeType.compare(rhsAttributeHSizeType))
338
+ return hrc;
339
+
340
+ const QString attributeVSizeType = m_domSizePolicy->hasAttributeVSizeType() ? m_domSizePolicy->attributeVSizeType() : QString();
341
+ const QString rhsAttributeVSizeType = rhs.m_domSizePolicy->hasAttributeVSizeType() ? rhs.m_domSizePolicy->attributeVSizeType() : QString();
342
+
343
+ return attributeVSizeType.compare(rhsAttributeVSizeType);
344
+ }
345
+
346
+ // --- WriteInitialization: LayoutDefaultHandler
347
+
348
+ WriteInitialization::LayoutDefaultHandler::LayoutDefaultHandler()
349
+ {
350
+ qFill(m_state, m_state + NumProperties, 0u);
351
+ qFill(m_defaultValues, m_defaultValues + NumProperties, 0);
352
+ }
353
+
354
+
355
+
356
+ void WriteInitialization::LayoutDefaultHandler::acceptLayoutDefault(DomLayoutDefault *node)
357
+ {
358
+ if (!node)
359
+ return;
360
+ if (node->hasAttributeMargin()) {
361
+ m_state[Margin] |= HasDefaultValue;
362
+ m_defaultValues[Margin] = node->attributeMargin();
363
+ }
364
+ if (node->hasAttributeSpacing()) {
365
+ m_state[Spacing] |= HasDefaultValue;
366
+ m_defaultValues[Spacing] = node->attributeSpacing();
367
+ }
368
+ }
369
+
370
+ void WriteInitialization::LayoutDefaultHandler::acceptLayoutFunction(DomLayoutFunction *node)
371
+ {
372
+ if (!node)
373
+ return;
374
+ if (node->hasAttributeMargin()) {
375
+ m_state[Margin] |= HasDefaultFunction;
376
+ m_functions[Margin] = node->attributeMargin();
377
+ m_functions[Margin] += QLatin1String("()");
378
+ }
379
+ if (node->hasAttributeSpacing()) {
380
+ m_state[Spacing] |= HasDefaultFunction;
381
+ m_functions[Spacing] = node->attributeSpacing();
382
+ m_functions[Spacing] += QLatin1String("()");
383
+ }
384
+ }
385
+
386
+ void WriteInitialization::LayoutDefaultHandler::writeProperty(int p, const QString &indent, const QString &objectName,
387
+ const DomPropertyMap &properties, const QString &propertyName, const QString &setter,
388
+ int /*defaultStyleValue*/, bool suppressDefault, QTextStream &str) const
389
+ {
390
+ // User value
391
+ const DomPropertyMap::const_iterator mit = properties.constFind(propertyName);
392
+ const bool found = mit != properties.constEnd();
393
+ if (found) {
394
+ const int value = mit.value()->elementNumber();
395
+ // Emulate the pre 4.3 behaviour: The value form default value was only used to determine
396
+ // the default value, layout properties were always written
397
+ const bool useLayoutFunctionPre43 = !suppressDefault && (m_state[p] == (HasDefaultFunction|HasDefaultValue)) && value == m_defaultValues[p];
398
+ if (!useLayoutFunctionPre43) {
399
+ writeSetter(indent, objectName, setter, value, str);
400
+ return;
401
+ }
402
+ }
403
+ if (suppressDefault)
404
+ return;
405
+ // get default
406
+ if (m_state[p] & HasDefaultFunction) {
407
+ writeSetter(indent, objectName, setter, m_functions[p], str);
408
+ return;
409
+ }
410
+ if (m_state[p] & HasDefaultValue) {
411
+ writeSetter(indent, objectName, setter, m_defaultValues[p], str);
412
+ }
413
+ return;
414
+ }
415
+
416
+
417
+ void WriteInitialization::LayoutDefaultHandler::writeProperties(const QString &indent, const QString &varName,
418
+ const DomPropertyMap &properties, int marginType,
419
+ bool suppressMarginDefault,
420
+ QTextStream &str) const {
421
+ // Write out properties and ignore the ones found in
422
+ // subsequent writing of the property list.
423
+ int defaultSpacing = marginType == WriteInitialization::Use43UiFile ? -1 : 6;
424
+ writeProperty(Spacing, indent, varName, properties, QLatin1String("spacing"), QLatin1String("setSpacing"),
425
+ defaultSpacing, false, str);
426
+ // We use 9 as TopLevelMargin, since Designer seem to always use 9.
427
+ static const int layoutmargins[4] = {-1, 9, 9, 0};
428
+ writeProperty(Margin, indent, varName, properties, QLatin1String("margin"), QLatin1String("setMargin"),
429
+ layoutmargins[marginType], suppressMarginDefault, str);
430
+ }
431
+
432
+ // --- WriteInitialization
433
+ WriteInitialization::WriteInitialization(Uic *uic) :
434
+ m_uic(uic),
435
+ m_driver(uic->driver()), m_output(uic->output()), m_option(uic->option()),
436
+ m_layoutMarginType(TopLevelMargin),
437
+ m_delayedOut(&m_delayedInitialization, QIODevice::WriteOnly),
438
+ m_refreshOut(&m_refreshInitialization, QIODevice::WriteOnly),
439
+ m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly),
440
+ m_layoutWidget(false)
441
+ {
442
+ }
443
+
444
+ void WriteInitialization::acceptUI(DomUI *node)
445
+ {
446
+ m_registeredImages.clear();
447
+ m_actionGroupChain.push(0);
448
+ m_widgetChain.push(0);
449
+ m_layoutChain.push(0);
450
+
451
+ acceptLayoutDefault(node->elementLayoutDefault());
452
+ acceptLayoutFunction(node->elementLayoutFunction());
453
+
454
+ if (node->elementCustomWidgets())
455
+ TreeWalker::acceptCustomWidgets(node->elementCustomWidgets());
456
+
457
+ if (node->elementImages())
458
+ TreeWalker::acceptImages(node->elementImages());
459
+
460
+ m_stdsetdef = true;
461
+ if (node->hasAttributeStdSetDef())
462
+ m_stdsetdef = node->attributeStdSetDef();
463
+
464
+ const QString className = node->elementClass() + m_option.postfix;
465
+ m_generatedClass = className;
466
+
467
+ m_mainWidget = m_driver->findOrInsertWidget(node->elementWidget());
468
+ m_registeredWidgets.insert(m_mainWidget, node->elementWidget()); // register the main widget
469
+
470
+ m_mainWidget = m_mainWidget.mid(0, 1).toLower() + m_mainWidget.mid(1);
471
+
472
+ const QString widgetClassName = node->elementWidget()->attributeClass();
473
+
474
+ m_output << m_option.indent << "def " << "setupUi(" << m_mainWidget << ")\n";
475
+
476
+ const QStringList connections = m_uic->databaseInfo()->connections();
477
+ for (int i=0; i<connections.size(); ++i) {
478
+ QString connection = connections.at(i);
479
+
480
+ if (connection == QLatin1String("(default)"))
481
+ continue;
482
+
483
+ QString varConn = QLatin1String("@") + connection + QLatin1String("Connection");
484
+ m_output << m_option.indent << varConn << " = Qt::SqlDatabase.database(" << fixString(connection, m_option.indent) << ")\n";
485
+ }
486
+
487
+ acceptWidget(node->elementWidget());
488
+
489
+ for (int i=0; i<m_buddies.size(); ++i) {
490
+ const Buddy &b = m_buddies.at(i);
491
+ QString name(b.objName);
492
+ name.replace("@", "");
493
+ QString buddyName(b.buddy);
494
+ buddyName.replace("@", "");
495
+
496
+ if (!m_registeredWidgets.contains(name) && !m_registeredWidgets.contains(name)) {
497
+ fprintf(stderr, "'@%s' isn't a valid widget\n", name.toLatin1().data());
498
+ continue;
499
+ } else if (!m_registeredWidgets.contains(b.buddy) && !m_registeredWidgets.contains(buddyName)) {
500
+ fprintf(stderr, "'@%s' isn't a valid widget\n", buddyName.toLatin1().data());
501
+ continue;
502
+ }
503
+
504
+ m_output << m_option.indent << "@" << name << ".buddy = @" << buddyName << "\n";
505
+ }
506
+
507
+ if (node->elementTabStops())
508
+ acceptTabStops(node->elementTabStops());
509
+
510
+ if (m_delayedActionInitialization.size())
511
+ m_output << "\n" << m_delayedActionInitialization;
512
+
513
+ m_output << "\n" << m_option.indent << "retranslateUi(" << m_mainWidget << ")\n";
514
+
515
+ if (node->elementConnections())
516
+ acceptConnections(node->elementConnections());
517
+
518
+ if (!m_delayedInitialization.isEmpty())
519
+ m_output << "\n" << m_delayedInitialization << "\n";
520
+
521
+ if (m_option.autoConnection)
522
+ m_output << "\n" << m_option.indent << "Qt::MetaObject.connectSlotsByName(" << m_mainWidget << ")\n";
523
+
524
+ m_output << m_option.indent << "end # setupUi\n\n";
525
+
526
+ m_output << m_option.indent << "def " << "setup_ui(" << m_mainWidget << ")\n";
527
+ m_output << m_option.indent << " setupUi(" << m_mainWidget << ")\n";
528
+ m_output << m_option.indent << "end\n\n";
529
+
530
+ m_output << m_option.indent << "def " << "retranslateUi(" << m_mainWidget << ")\n"
531
+ << m_refreshInitialization
532
+ << m_option.indent << "end # retranslateUi\n\n";
533
+
534
+ m_output << m_option.indent << "def " << "retranslate_ui(" << m_mainWidget << ")\n";
535
+ m_output << m_option.indent << " retranslateUi(" << m_mainWidget << ")\n";
536
+ m_output << m_option.indent << "end\n\n";
537
+
538
+ m_layoutChain.pop();
539
+ m_widgetChain.pop();
540
+ m_actionGroupChain.pop();
541
+ }
542
+
543
+ void WriteInitialization::acceptWidget(DomWidget *node)
544
+ {
545
+ m_layoutMarginType = m_widgetChain.count() == 1 ? TopLevelMargin : ChildMargin;
546
+ const QString className = node->attributeClass();
547
+ QString varName = m_driver->findOrInsertWidget(node);
548
+ m_registeredWidgets.insert(varName, node); // register the current widget
549
+
550
+ varName = varName.mid(0, 1).toLower() + varName.mid(1);
551
+
552
+ if (m_layoutMarginType == ChildMargin) {
553
+ varName.prepend("@");
554
+ }
555
+
556
+ QString parentWidget, parentClass;
557
+ if (m_widgetChain.top()) {
558
+ parentWidget = m_driver->findOrInsertWidget(m_widgetChain.top());
559
+ parentWidget = parentWidget.mid(0, 1).toLower() + parentWidget.mid(1);
560
+ if (m_widgetChain.count() != 2) {
561
+ parentWidget.prepend("@");
562
+ }
563
+ parentClass = m_widgetChain.top()->attributeClass();
564
+ }
565
+
566
+ const QString savedParentWidget = parentWidget;
567
+
568
+ if (m_uic->isContainer(parentClass) || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3ToolBar")))
569
+ parentWidget.clear();
570
+
571
+ if (m_widgetChain.size() != 1) {
572
+ m_output << m_option.indent << varName << " = " << m_driver->rubyClassName(m_uic->customWidgetsInfo()->realClassName(className)) << ".new(" << parentWidget << ")\n";
573
+ }
574
+
575
+ parentWidget = savedParentWidget;
576
+
577
+ if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))) {
578
+ initializeComboBox(node);
579
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) {
580
+ initializeListWidget(node);
581
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTreeWidget"))) {
582
+ initializeTreeWidget(node);
583
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTableWidget"))) {
584
+ initializeTableWidget(node);
585
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListBox"))) {
586
+ initializeQ3ListBox(node);
587
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ListView"))) {
588
+ initializeQ3ListView(node);
589
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3IconView"))) {
590
+ initializeQ3IconView(node);
591
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3Table"))) {
592
+ initializeQ3Table(node);
593
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataTable"))) {
594
+ initializeQ3SqlDataTable(node);
595
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DataBrowser"))) {
596
+ initializeQ3SqlDataBrowser(node);
597
+ }
598
+
599
+ if (m_uic->isButton(className)) {
600
+ const DomPropertyMap attributes = propertyMap(node->elementAttribute());
601
+ if (const DomProperty *prop = attributes.value(QLatin1String("buttonGroup"))) {
602
+ const QString groupName = toString(prop->elementString());
603
+ if (!m_buttonGroups.contains(groupName)) {
604
+ m_buttonGroups.insert(groupName, m_driver->findOrInsertName(groupName));
605
+ const QString g = QString("@") + m_buttonGroups.value(groupName);
606
+ m_output << m_option.indent << g << " = Qt::ButtonGroup.new(" << m_generatedClass << ")\n";
607
+ }
608
+
609
+ const QString g = QString("@") + m_buttonGroups.value(groupName);
610
+ m_output << m_option.indent << g << ".addButton(" << varName << ")\n";
611
+ }
612
+ }
613
+
614
+ writeProperties(varName, className, node->elementProperty());
615
+
616
+ if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenu")) && parentWidget.size()) {
617
+ initializeMenu(node, parentWidget);
618
+ }
619
+
620
+ if (node->elementLayout().isEmpty())
621
+ m_layoutChain.push(0);
622
+
623
+ m_layoutWidget = false;
624
+ if (className == QLatin1String("QWidget") && !node->hasAttributeNative()) {
625
+ if (m_widgetChain.top()
626
+ && m_widgetChain.top()->attributeClass() != QLatin1String("QMainWindow")
627
+ && !m_uic->isContainer(m_widgetChain.top()->attributeClass()))
628
+ m_layoutWidget = true;
629
+ }
630
+ m_widgetChain.push(node);
631
+ m_layoutChain.push(0);
632
+ TreeWalker::acceptWidget(node);
633
+ m_layoutChain.pop();
634
+ m_widgetChain.pop();
635
+ m_layoutWidget = false;
636
+
637
+ const DomPropertyMap attributes = propertyMap(node->elementAttribute());
638
+
639
+ QString title = QLatin1String("Page");
640
+ if (const DomProperty *ptitle = attributes.value(QLatin1String("title"))) {
641
+ title = toString(ptitle->elementString());
642
+ }
643
+
644
+ QString label = QLatin1String("Page");
645
+ if (const DomProperty *plabel = attributes.value(QLatin1String("label"))) {
646
+ label = toString(plabel->elementString());
647
+ }
648
+
649
+ int id = -1;
650
+ if (const DomProperty *pid = attributes.value(QLatin1String("id"))) {
651
+ id = pid->elementNumber();
652
+ }
653
+
654
+ if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMainWindow"))
655
+ || m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow"))) {
656
+
657
+ if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"))) {
658
+ if (!m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3MainWindow")))
659
+ m_output << m_option.indent << parentWidget << ".setMenuBar(" << varName <<")\n";
660
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBar"))) {
661
+ m_output << m_option.indent << parentWidget << ".addToolBar("
662
+ << toolBarAreaStringFromDOMAttributes(attributes) << varName << ")\n";
663
+
664
+ if (const DomProperty *pbreak = attributes.value(QLatin1String("toolBarBreak"))) {
665
+ if (pbreak->elementBool() == QLatin1String("true")) {
666
+ m_output << m_option.indent << parentWidget << ".insertToolBarBreak(" << varName << ")\n";
667
+ }
668
+ }
669
+
670
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QDockWidget"))) {
671
+ QString area;
672
+ if (DomProperty *pstyle = attributes.value(QLatin1String("dockWidgetArea"))) {
673
+ area += QLatin1String("(");
674
+ area += QString::number(pstyle->elementNumber());
675
+ area += QLatin1String("), ");
676
+ }
677
+
678
+ m_output << m_option.indent << parentWidget << ".addDockWidget(" << area << varName << ")\n";
679
+ } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) {
680
+ m_output << m_option.indent << parentWidget << ".statusBar = " << varName << "\n";
681
+ } else if (className == QLatin1String("QWidget")) {
682
+ m_output << m_option.indent << parentWidget << ".centralWidget = " << varName << "\n";
683
+ }
684
+ }
685
+
686
+ // Check for addPageMethod of a custom plugin first
687
+ const QString addPageMethod = m_uic->customWidgetsInfo()->customWidgetAddPageMethod(parentClass);
688
+ if (!addPageMethod.isEmpty()) {
689
+ m_output << m_option.indent << parentWidget << "." << addPageMethod << '(' << varName << ")\n";
690
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QStackedWidget"))) {
691
+ m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ")\n";
692
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBar"))) {
693
+ m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ")\n";
694
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3WidgetStack"))) {
695
+ m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ", " << id << ")\n";
696
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QDockWidget"))) {
697
+ m_output << m_option.indent << parentWidget << ".setWidget(" << varName << ")\n";
698
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QScrollArea"))) {
699
+ m_output << m_option.indent << parentWidget << ".setWidget(" << varName << ")\n";
700
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QSplitter"))) {
701
+ m_output << m_option.indent << parentWidget << ".addWidget(" << varName << ")\n";
702
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMdiArea"))) {
703
+ m_output << m_option.indent << parentWidget << ".addSubWindow(" << varName << ")\n";
704
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWorkspace"))) {
705
+ m_output << m_option.indent << parentWidget << ".addWindow(" << varName << ")\n";
706
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWizard"))) {
707
+ m_output << m_option.indent << parentWidget << ".addPage(" << varName << ")\n";
708
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBox"))) {
709
+ QString icon;
710
+ if (DomProperty *picon = attributes.value(QLatin1String("icon"))) {
711
+ icon += QLatin1String(", ") ;
712
+ icon += iconCall(picon);
713
+ }
714
+
715
+ m_output << m_option.indent << parentWidget << ".addItem(" << varName << icon << ", " << trCall(label) << ")\n";
716
+
717
+ m_refreshOut << m_option.indent << parentWidget << ".setItemText("
718
+ << parentWidget << ".indexOf(" << varName << "), " << trCall(label) << ")\n";
719
+
720
+ if (DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
721
+ m_refreshOut << m_option.indent << parentWidget << ".setItemToolTip("
722
+ << parentWidget << ".indexOf(" << varName << "), " << trCall(ptoolTip->elementString()) << ")\n";
723
+ }
724
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QTabWidget"))) {
725
+ QString icon;
726
+ if (const DomProperty *picon = attributes.value(QLatin1String("icon"))) {
727
+ icon += QLatin1String(", ");
728
+ icon += iconCall(picon);
729
+ }
730
+
731
+ m_output << m_option.indent << parentWidget << ".addTab(" << varName << icon << ", " << trCall(title) << ")\n";
732
+
733
+ m_refreshOut << m_option.indent << parentWidget << ".setTabText("
734
+ << parentWidget << ".indexOf(" << varName << "), " << trCall(title) << ")\n";
735
+
736
+ if (const DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
737
+ m_refreshOut << m_option.indent << parentWidget << ".setTabToolTip("
738
+ << parentWidget << ".indexOf(" << varName << "), " << trCall(ptoolTip->elementString()) << ")\n";
739
+ }
740
+ } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("Q3Wizard"))) {
741
+ m_output << m_option.indent << parentWidget << ".addPage(" << varName << ", " << trCall(title) << ")\n";
742
+
743
+ m_refreshOut << m_option.indent << parentWidget << ".setTitle("
744
+ << varName << ", " << trCall(title) << ")\n";
745
+
746
+ }
747
+
748
+ if (node->elementLayout().isEmpty())
749
+ m_layoutChain.pop();
750
+
751
+ const QStringList zOrder = node->elementZOrder();
752
+ for (int i = 0; i < zOrder.size(); ++i) {
753
+ const QString name = zOrder.at(i);
754
+
755
+ if (!m_registeredWidgets.contains(name)) {
756
+ fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
757
+ continue;
758
+ }
759
+
760
+ if (name.isEmpty()) {
761
+ continue;
762
+ }
763
+
764
+ m_output << m_option.indent << name << ".raise()\n";
765
+ }
766
+ }
767
+
768
+ void WriteInitialization::acceptLayout(DomLayout *node)
769
+ {
770
+ QString className = node->attributeClass();
771
+ QString varName = toRubyIdentifier(m_driver->findOrInsertLayout(node));
772
+
773
+ const DomPropertyMap properties = propertyMap(node->elementProperty());
774
+ const bool oldLayoutProperties = properties.constFind(QLatin1String("margin")) != properties.constEnd();
775
+
776
+ bool isGroupBox = false;
777
+
778
+ if (m_widgetChain.top()) {
779
+ const QString parentWidget = m_widgetChain.top()->attributeClass();
780
+
781
+ if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox"))
782
+ || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) {
783
+ const QString parent = toRubyIdentifier(m_driver->findOrInsertWidget(m_widgetChain.top()));
784
+
785
+ isGroupBox = true;
786
+ // special case for group box
787
+
788
+ m_output << m_option.indent << parent << ".setColumnLayout(0, Qt::Vertical)\n";
789
+ QString objectName = parent;
790
+ objectName += QLatin1String(".layout");
791
+ int marginType = Use43UiFile;
792
+ if (oldLayoutProperties)
793
+ marginType = m_layoutMarginType;
794
+
795
+ m_LayoutDefaultHandler.writeProperties(m_option.indent,
796
+ objectName, properties, marginType, false, m_output);
797
+ }
798
+ }
799
+
800
+ m_output << m_option.indent << varName << " = " << m_driver->rubyClassName(className) << ".new(";
801
+
802
+ if (!m_layoutChain.top() && !isGroupBox) {
803
+ QString parentWidget = m_driver->findOrInsertWidget(m_widgetChain.top());
804
+ parentWidget = parentWidget.mid(0, 1).toLower() + parentWidget.mid(1);
805
+ if (m_widgetChain.count() != 2) {
806
+ parentWidget.prepend("@");
807
+ }
808
+ m_output << parentWidget;
809
+ }
810
+
811
+ m_output << ")\n";
812
+
813
+ if (isGroupBox) {
814
+ const QString tempName = m_driver->unique(QLatin1String("boxlayout"));
815
+ QString widget = m_driver->findOrInsertWidget(m_widgetChain.top());
816
+ widget = widget.mid(0, 1).toLower() + widget.mid(1);
817
+ widget.prepend("@");
818
+
819
+ m_output << m_option.indent << "" << tempName << " = " <<
820
+ widget << ".layout\n";
821
+ m_output << m_option.indent << "if " << tempName << "\n";
822
+ m_output << m_option.indent << " " << tempName << ".addLayout(" << varName << ")\n";
823
+ m_output << m_option.indent << "end " << "\n";
824
+ }
825
+
826
+ if (isGroupBox) {
827
+ m_output << m_option.indent << varName << ".alignment = Qt::AlignTop\n";
828
+ } else {
829
+ // Suppress margin on a read child layout
830
+ const bool suppressMarginDefault = m_layoutChain.top();
831
+ int marginType = Use43UiFile;
832
+ if (oldLayoutProperties)
833
+ marginType = m_layoutMarginType;
834
+ m_LayoutDefaultHandler.writeProperties(m_option.indent, varName, properties, marginType, suppressMarginDefault, m_output);
835
+ }
836
+
837
+ m_layoutMarginType = SubLayoutMargin;
838
+
839
+ DomPropertyList propList = node->elementProperty();
840
+ if (m_layoutWidget) {
841
+ bool left, top, right, bottom;
842
+ left = top = right = bottom = false;
843
+ for (int i = 0; i < propList.size(); ++i) {
844
+ const DomProperty *p = propList.at(i);
845
+ const QString propertyName = p->attributeName();
846
+ if (propertyName == QLatin1String("leftMargin") && p->kind() == DomProperty::Number)
847
+ left = true;
848
+ else if (propertyName == QLatin1String("topMargin") && p->kind() == DomProperty::Number)
849
+ top = true;
850
+ else if (propertyName == QLatin1String("rightMargin") && p->kind() == DomProperty::Number)
851
+ right = true;
852
+ else if (propertyName == QLatin1String("bottomMargin") && p->kind() == DomProperty::Number)
853
+ bottom = true;
854
+ }
855
+ if (!left) {
856
+ DomProperty *p = new DomProperty();
857
+ p->setAttributeName(QLatin1String("leftMargin"));
858
+ p->setElementNumber(0);
859
+ propList.append(p);
860
+ }
861
+ if (!top) {
862
+ DomProperty *p = new DomProperty();
863
+ p->setAttributeName(QLatin1String("topMargin"));
864
+ p->setElementNumber(0);
865
+ propList.append(p);
866
+ }
867
+ if (!right) {
868
+ DomProperty *p = new DomProperty();
869
+ p->setAttributeName(QLatin1String("rightMargin"));
870
+ p->setElementNumber(0);
871
+ propList.append(p);
872
+ }
873
+ if (!bottom) {
874
+ DomProperty *p = new DomProperty();
875
+ p->setAttributeName(QLatin1String("bottomMargin"));
876
+ p->setElementNumber(0);
877
+ propList.append(p);
878
+ }
879
+ m_layoutWidget = false;
880
+ }
881
+
882
+ writeProperties(varName, className, propList, WritePropertyIgnoreMargin|WritePropertyIgnoreSpacing);
883
+
884
+
885
+ m_layoutChain.push(node);
886
+ TreeWalker::acceptLayout(node);
887
+ m_layoutChain.pop();
888
+ }
889
+
890
+ void WriteInitialization::acceptSpacer(DomSpacer *node)
891
+ {
892
+ m_output << m_option.indent << "@" << m_driver->findOrInsertSpacer(node) << " = ";
893
+ writeSpacerItem(node, m_output);
894
+ m_output << "\n";
895
+ }
896
+
897
+ void WriteInitialization::acceptLayoutItem(DomLayoutItem *node)
898
+ {
899
+ TreeWalker::acceptLayoutItem(node);
900
+
901
+ DomLayout *layout = m_layoutChain.top();
902
+
903
+ if (!layout)
904
+ return;
905
+
906
+ const QString layoutName = toRubyIdentifier(m_driver->findOrInsertLayout(layout));
907
+ const QString itemName = toRubyIdentifier(m_driver->findOrInsertLayoutItem(node));
908
+
909
+ QString addArgs;
910
+ QString methodPrefix = QLatin1String("add"); //Consistent API-design galore!
911
+ if (layout->attributeClass() == QLatin1String("QGridLayout")) {
912
+ const int row = node->attributeRow();
913
+ const int col = node->attributeColumn();
914
+
915
+ int rowSpan = 1;
916
+ if (node->hasAttributeRowSpan())
917
+ rowSpan = node->attributeRowSpan();
918
+
919
+ int colSpan = 1;
920
+ if (node->hasAttributeColSpan())
921
+ colSpan = node->attributeColSpan();
922
+
923
+ addArgs = QString::fromLatin1("%1, %2, %3, %4, %5").arg(itemName).arg(row).arg(col).arg(rowSpan).arg(colSpan);
924
+ } else {
925
+ if (layout->attributeClass() == QLatin1String("QFormLayout")) {
926
+ methodPrefix = QLatin1String("set");
927
+ const int row = node->attributeRow();
928
+ const QString role = node->attributeColumn() == 0 ? QLatin1String("Qt::FormLayout::LabelRole") : QLatin1String("Qt::FormLayout::FieldRole");
929
+ addArgs = QString::fromLatin1("%1, %2, %3").arg(row).arg(role).arg(itemName);
930
+ } else {
931
+ addArgs = itemName;
932
+ }
933
+ }
934
+
935
+ // figure out "add" method
936
+ m_output << "\n" << m_option.indent << layoutName << ".";
937
+ switch (node->kind()) {
938
+ case DomLayoutItem::Widget:
939
+ m_output << methodPrefix << "Widget(" << addArgs;
940
+ break;
941
+ case DomLayoutItem::Layout:
942
+ m_output << methodPrefix << "Layout(" << addArgs;
943
+ break;
944
+ case DomLayoutItem::Spacer:
945
+ m_output << methodPrefix << "Item(" << addArgs;
946
+ break;
947
+ case DomLayoutItem::Unknown:
948
+ Q_ASSERT( 0 );
949
+ break;
950
+ }
951
+ m_output << ")\n\n";
952
+ }
953
+
954
+ void WriteInitialization::acceptActionGroup(DomActionGroup *node)
955
+ {
956
+ QString actionName = toRubyIdentifier(m_driver->findOrInsertActionGroup(node));
957
+
958
+ QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
959
+ varName = varName.mid(0, 1).toLower() + varName.mid(1);
960
+ if (m_widgetChain.count() > 2) {
961
+ varName.prepend("@");
962
+ }
963
+
964
+ if (m_actionGroupChain.top())
965
+ varName = m_driver->findOrInsertActionGroup(m_actionGroupChain.top());
966
+
967
+ m_output << m_option.indent << actionName << " = Qt:ActionGroup.new(" << varName << ")\n";
968
+ writeProperties(actionName, QLatin1String("QActionGroup"), node->elementProperty());
969
+
970
+ m_actionGroupChain.push(node);
971
+ TreeWalker::acceptActionGroup(node);
972
+ m_actionGroupChain.pop();
973
+ }
974
+
975
+ void WriteInitialization::acceptAction(DomAction *node)
976
+ {
977
+ if (node->hasAttributeMenu())
978
+ return;
979
+
980
+ const QString actionName = toRubyIdentifier(m_driver->findOrInsertAction(node));
981
+
982
+ m_registeredActions.insert(actionName, node);
983
+ QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
984
+ varName = varName.mid(0, 1).toLower() + varName.mid(1);
985
+ if (m_widgetChain.count() > 2) {
986
+ varName.prepend("@");
987
+ }
988
+
989
+ if (m_actionGroupChain.top()) {
990
+ varName = toRubyIdentifier(m_driver->findOrInsertActionGroup(m_actionGroupChain.top()));
991
+ }
992
+
993
+ m_output << m_option.indent << actionName << " = Qt::Action.new(" << varName << ")\n";
994
+ writeProperties(actionName, QLatin1String("QAction"), node->elementProperty());
995
+ }
996
+
997
+ void WriteInitialization::acceptActionRef(DomActionRef *node)
998
+ {
999
+ QString actionName = node->attributeName();
1000
+ QString rubyActionName = toRubyIdentifier(node->attributeName());
1001
+ bool isSeparator = actionName == QLatin1String("separator");
1002
+ bool isMenu = false;
1003
+
1004
+ QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
1005
+ varName = varName.mid(0, 1).toLower() + varName.mid(1);
1006
+ if (m_widgetChain.count() > 2) {
1007
+ varName.prepend("@");
1008
+ }
1009
+
1010
+ if (actionName.isEmpty() || !m_widgetChain.top()) {
1011
+ return;
1012
+ } else if (m_driver->actionGroupByName(actionName)) {
1013
+ return;
1014
+ } else if (DomWidget *w = m_driver->widgetByName(actionName)) {
1015
+ isMenu = m_uic->isMenu(w->attributeClass());
1016
+ bool inQ3ToolBar = m_uic->customWidgetsInfo()->extends(m_widgetChain.top()->attributeClass(), QLatin1String("Q3ToolBar"));
1017
+ if (!isMenu && inQ3ToolBar) {
1018
+ m_actionOut << m_option.indent << rubyActionName << ".parent = " << varName << "\n";
1019
+ return;
1020
+ }
1021
+ } else if (!(m_driver->actionByName(actionName) || isSeparator)) {
1022
+ fprintf(stderr, "Warning: action `%s' not declared\n", actionName.toLatin1().data());
1023
+ return;
1024
+ }
1025
+
1026
+ if (m_widgetChain.top() && isSeparator) {
1027
+ // separator is always reserved!
1028
+ m_actionOut << m_option.indent << varName << ".addSeparator()\n";
1029
+ return;
1030
+ }
1031
+
1032
+ if (isMenu)
1033
+ rubyActionName += QLatin1String(".menuAction()");
1034
+
1035
+ m_actionOut << m_option.indent << varName << ".addAction(" << rubyActionName << ")\n";
1036
+ }
1037
+
1038
+ void WriteInitialization::writeProperties(const QString &varName,
1039
+ const QString &className,
1040
+ const DomPropertyList &lst,
1041
+ unsigned flags)
1042
+ {
1043
+ bool isTopLevel = m_widgetChain.count() == 1;
1044
+
1045
+ if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
1046
+ DomPropertyMap properties = propertyMap(lst);
1047
+ if (properties.contains(QLatin1String("control"))) {
1048
+ DomProperty *p = properties.value(QLatin1String("control"));
1049
+ m_output << m_option.indent << varName << ".setControl("
1050
+ << fixString(toString(p->elementString()), m_option.indent) << ")\n";
1051
+ }
1052
+ }
1053
+
1054
+ DomWidget *buttonGroupWidget = findWidget(QLatin1String("Q3ButtonGroup"));
1055
+
1056
+ QString indent;
1057
+ if (!m_widgetChain.top()) {
1058
+ indent = QLatin1String(" ");
1059
+ m_output << m_option.indent << "if " << varName << ".objectName.nil?\n";
1060
+ }
1061
+
1062
+ if (varName.startsWith("@")) {
1063
+ m_output << m_option.indent << indent << varName << ".objectName = " << fixString(varName.mid(1), m_option.indent) << "\n";
1064
+ } else {
1065
+ m_output << m_option.indent << indent << varName << ".objectName = " << fixString(varName.mid(0,1).toLower() + varName.mid(1), m_option.indent) << "\n";
1066
+ }
1067
+
1068
+ if (!m_widgetChain.top()) {
1069
+ indent = QLatin1String(" ");
1070
+ m_output << m_option.indent << "end\n";
1071
+ }
1072
+
1073
+ int leftMargin, topMargin, rightMargin, bottomMargin;
1074
+ leftMargin = topMargin = rightMargin = bottomMargin = -1;
1075
+ bool frameShadowEncountered = false;
1076
+
1077
+ for (int i=0; i<lst.size(); ++i) {
1078
+ DomProperty *p = lst.at(i);
1079
+ if (!checkProperty(m_option.inputFile, p))
1080
+ continue;
1081
+ QString propertyName = p->attributeName();
1082
+ QString propertyValue;
1083
+
1084
+ // special case for the property `geometry': Do not use position
1085
+ if (isTopLevel && propertyName == QLatin1String("geometry") && p->elementRect()) {
1086
+ const DomRect *r = p->elementRect();
1087
+ m_output << m_option.indent << varName << ".resize(" << r->elementWidth() << ", " << r->elementHeight() << ")\n";
1088
+ continue;
1089
+ } else if (propertyName == QLatin1String("buttonGroupId") && buttonGroupWidget) { // Q3ButtonGroup support
1090
+ m_output << m_option.indent << m_driver->findOrInsertWidget(buttonGroupWidget) << ".insert("
1091
+ << varName << ", " << p->elementNumber() << ")\n";
1092
+ continue;
1093
+ } else if (propertyName == QLatin1String("currentRow") // QListWidget::currentRow
1094
+ && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) {
1095
+ m_delayedOut << m_option.indent << varName << ".setCurrentRow("
1096
+ << p->elementNumber() << ")\n";
1097
+ continue;
1098
+ } else if (propertyName == QLatin1String("currentIndex") // set currentIndex later
1099
+ && (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QComboBox"))
1100
+ || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStackedWidget"))
1101
+ || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QTabWidget"))
1102
+ || m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox")))) {
1103
+ m_delayedOut << m_option.indent << varName << ".setCurrentIndex("
1104
+ << p->elementNumber() << ")\n";
1105
+ continue;
1106
+ } else if (propertyName == QLatin1String("tabSpacing")
1107
+ && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))) {
1108
+ m_delayedOut << m_option.indent << varName << ".layout().setSpacing("
1109
+ << p->elementNumber() << ")\n";
1110
+ continue;
1111
+ } else if (propertyName == QLatin1String("control") // ActiveQt support
1112
+ && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
1113
+ // already done ;)
1114
+ continue;
1115
+ } else if (propertyName == QLatin1String("database")
1116
+ && p->elementStringList()) {
1117
+ // Sql support
1118
+ continue;
1119
+ } else if (propertyName == QLatin1String("frameworkCode")
1120
+ && p->kind() == DomProperty::Bool) {
1121
+ // Sql support
1122
+ continue;
1123
+ } else if (propertyName == QLatin1String("orientation")
1124
+ && m_uic->customWidgetsInfo()->extends(className, QLatin1String("Line"))) {
1125
+ // Line support
1126
+ QString shape = QLatin1String("Qt::Frame::HLine");
1127
+ if (p->elementEnum() == QLatin1String("Qt::Vertical"))
1128
+ shape = QLatin1String("Qt::Frame::VLine");
1129
+
1130
+ m_output << m_option.indent << varName << ".setFrameShape(" << shape << ")\n";
1131
+ // QFrame Default is 'Plain'. Make the line 'Sunken' unless otherwise specified
1132
+ if (!frameShadowEncountered)
1133
+ m_output << m_option.indent << varName << ".setFrameShadow(Qt::Frame::Sunken)\n";
1134
+ continue;
1135
+ } else if ((flags & WritePropertyIgnoreMargin) && propertyName == QLatin1String("margin")) {
1136
+ continue;
1137
+ } else if ((flags & WritePropertyIgnoreSpacing) && propertyName == QLatin1String("spacing")) {
1138
+ continue;
1139
+ } else if (propertyName == QLatin1String("leftMargin") && p->kind() == DomProperty::Number) {
1140
+ leftMargin = p->elementNumber();
1141
+ continue;
1142
+ } else if (propertyName == QLatin1String("topMargin") && p->kind() == DomProperty::Number) {
1143
+ topMargin = p->elementNumber();
1144
+ continue;
1145
+ } else if (propertyName == QLatin1String("rightMargin") && p->kind() == DomProperty::Number) {
1146
+ rightMargin = p->elementNumber();
1147
+ continue;
1148
+ } else if (propertyName == QLatin1String("bottomMargin") && p->kind() == DomProperty::Number) {
1149
+ bottomMargin = p->elementNumber();
1150
+ continue;
1151
+ } else if (propertyName == QLatin1String("frameShadow"))
1152
+ frameShadowEncountered = true;
1153
+
1154
+ bool stdset = m_stdsetdef;
1155
+ if (p->hasAttributeStdset())
1156
+ stdset = p->attributeStdset();
1157
+
1158
+ QString setFunction;
1159
+
1160
+ if (stdset) {
1161
+ setFunction = QLatin1String(".")
1162
+ + propertyName
1163
+ + QLatin1String(" = ");
1164
+ } else {
1165
+ setFunction = QLatin1String(".setProperty(\"")
1166
+ + propertyName
1167
+ + QLatin1String("\", Qt::Variant.new(");
1168
+ }
1169
+
1170
+ QString varNewName = varName;
1171
+
1172
+ switch (p->kind()) {
1173
+ case DomProperty::Bool: {
1174
+ propertyValue = p->elementBool();
1175
+ break;
1176
+ }
1177
+ case DomProperty::Color: {
1178
+ DomColor *c = p->elementColor();
1179
+ propertyValue = QString::fromLatin1("Qt::Color.new(%1, %2, %3)")
1180
+ .arg(c->elementRed())
1181
+ .arg(c->elementGreen())
1182
+ .arg(c->elementBlue()); }
1183
+ break;
1184
+ case DomProperty::Cstring:
1185
+ if (propertyName == QLatin1String("buddy") && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QLabel"))) {
1186
+ m_buddies.append(Buddy(varName, p->elementCstring()));
1187
+ } else {
1188
+ if (stdset)
1189
+ propertyValue = fixString(p->elementCstring(), m_option.indent);
1190
+ else
1191
+ propertyValue = QLatin1String("Qt::ByteArray.new(") + fixString(p->elementCstring(), m_option.indent) + QLatin1String(")");
1192
+ }
1193
+ break;
1194
+ case DomProperty::Cursor:
1195
+ propertyValue = QString::fromLatin1("Qt::Cursor.new(%1)")
1196
+ .arg(p->elementCursor());
1197
+ break;
1198
+ case DomProperty::CursorShape:
1199
+ if (p->hasAttributeStdset() && !p->attributeStdset())
1200
+ varNewName += QLatin1String(".viewport()");
1201
+ propertyValue = QString::fromLatin1("Qt::Cursor.new(Qt::%1)")
1202
+ .arg(p->elementCursorShape());
1203
+ break;
1204
+ case DomProperty::Enum:
1205
+ propertyValue = p->elementEnum();
1206
+ if (!propertyValue.contains(QLatin1String("::")))
1207
+ propertyValue.prepend(className + QLatin1String(QLatin1String("::")));
1208
+ propertyValue = m_driver->rubyClassName(propertyValue);
1209
+ break;
1210
+ case DomProperty::Set:
1211
+ propertyValue = p->elementSet();
1212
+ if (!propertyValue.contains(QLatin1String("::")))
1213
+ propertyValue.prepend(className + QLatin1String(QLatin1String("::")));
1214
+ propertyValue = m_driver->rubyClassName(propertyValue);
1215
+ propertyValue.replace("|", "|");
1216
+ break;
1217
+ case DomProperty::Font:
1218
+ propertyValue = writeFontProperties(p->elementFont());
1219
+ break;
1220
+ case DomProperty::IconSet:
1221
+ propertyValue = writeIconProperties(p->elementIconSet());
1222
+ break;
1223
+
1224
+ case DomProperty::Pixmap:
1225
+ propertyValue = pixCall(p);
1226
+ break;
1227
+
1228
+ case DomProperty::Palette: {
1229
+ DomPalette *pal = p->elementPalette();
1230
+ QString paletteName = QString("@") + m_driver->unique(QLatin1String("palette"));
1231
+ m_output << m_option.indent << paletteName << " = Qt::Palette.new\n";
1232
+
1233
+ writeColorGroup(pal->elementActive(), QLatin1String("Qt::Palette::Active"), paletteName);
1234
+ writeColorGroup(pal->elementInactive(), QLatin1String("Qt::Palette::Inactive"), paletteName);
1235
+ writeColorGroup(pal->elementDisabled(), QLatin1String("Qt::Palette::Disabled"), paletteName);
1236
+
1237
+ propertyValue = paletteName;
1238
+ break;
1239
+ }
1240
+ case DomProperty::Point: {
1241
+ DomPoint *po = p->elementPoint();
1242
+ propertyValue = QString::fromLatin1("Qt::Point.new(%1, %2)")
1243
+ .arg(po->elementX()).arg(po->elementY());
1244
+ break;
1245
+ }
1246
+ case DomProperty::PointF: {
1247
+ DomPointF *pof = p->elementPointF();
1248
+ propertyValue = QString::fromLatin1("Qt::PointF.new(%1, %2)")
1249
+ .arg(pof->elementX()).arg(pof->elementY());
1250
+ break;
1251
+ }
1252
+ case DomProperty::Rect: {
1253
+ DomRect *r = p->elementRect();
1254
+ propertyValue = QString::fromLatin1("Qt::Rect.new(%1, %2, %3, %4)")
1255
+ .arg(r->elementX()).arg(r->elementY())
1256
+ .arg(r->elementWidth()).arg(r->elementHeight());
1257
+ break;
1258
+ }
1259
+ case DomProperty::RectF: {
1260
+ DomRectF *rf = p->elementRectF();
1261
+ propertyValue = QString::fromLatin1("Qt::RectF.new(%1, %2, %3, %4)")
1262
+ .arg(rf->elementX()).arg(rf->elementY())
1263
+ .arg(rf->elementWidth()).arg(rf->elementHeight());
1264
+ break;
1265
+ }
1266
+ case DomProperty::Locale: {
1267
+ const DomLocale *locale = p->elementLocale();
1268
+ propertyValue = QString::fromLatin1("Qt::Locale.new(Qt::Locale::%1, Qt::Locale::%2)")
1269
+ .arg(locale->attributeLanguage()).arg(locale->attributeCountry());
1270
+ break;
1271
+ }
1272
+ case DomProperty::SizePolicy: {
1273
+ const QString spName = writeSizePolicy( p->elementSizePolicy());
1274
+ m_output << m_option.indent << spName << QString::fromLatin1(
1275
+ ".heightForWidth = %1.sizePolicy.hasHeightForWidth\n")
1276
+ .arg(varName);
1277
+
1278
+ propertyValue = spName;
1279
+ break;
1280
+ }
1281
+ case DomProperty::Size: {
1282
+ DomSize *s = p->elementSize();
1283
+ propertyValue = QString::fromLatin1("Qt::Size.new(%1, %2)")
1284
+ .arg(s->elementWidth()).arg(s->elementHeight());
1285
+ break;
1286
+ }
1287
+ case DomProperty::SizeF: {
1288
+ DomSizeF *sf = p->elementSizeF();
1289
+ propertyValue = QString::fromLatin1("Qt::SizeF.new(%1, %2)")
1290
+ .arg(sf->elementWidth()).arg(sf->elementHeight());
1291
+ break;
1292
+ }
1293
+ case DomProperty::String: {
1294
+ if (propertyName == QLatin1String("objectName")) {
1295
+ QString v = p->elementString()->text();
1296
+ if ( (varName.startsWith("@") && v == varName.mid(1))
1297
+ || v.mid(0,1).toLower() + v.mid(1) == varName )
1298
+ break;
1299
+
1300
+ // ### qWarning("Deprecated: the property `objectName' is different from the variable name");
1301
+ }
1302
+
1303
+ if (p->elementString()->hasAttributeNotr()
1304
+ && toBool(p->elementString()->attributeNotr())) {
1305
+ propertyValue = fixString(p->elementString()->text(), m_option.indent);
1306
+ } else {
1307
+ propertyValue = trCall(p->elementString());
1308
+ }
1309
+ break;
1310
+ }
1311
+ case DomProperty::Number:
1312
+ propertyValue = QString::number(p->elementNumber());
1313
+ break;
1314
+ case DomProperty::UInt:
1315
+ propertyValue = QString::number(p->elementUInt());
1316
+ break;
1317
+ case DomProperty::LongLong:
1318
+ propertyValue = QString::number(p->elementLongLong());
1319
+ break;
1320
+ case DomProperty::ULongLong:
1321
+ propertyValue += QString::number(p->elementULongLong());
1322
+ break;
1323
+ case DomProperty::Float:
1324
+ propertyValue = QString::number(p->elementFloat());
1325
+ break;
1326
+ case DomProperty::Double:
1327
+ propertyValue = QString::number(p->elementDouble());
1328
+ break;
1329
+ case DomProperty::Char: {
1330
+ DomChar *c = p->elementChar();
1331
+ propertyValue = QString::fromLatin1("Qt::Char.new(%1)")
1332
+ .arg(c->elementUnicode());
1333
+ break;
1334
+ }
1335
+ case DomProperty::Date: {
1336
+ DomDate *d = p->elementDate();
1337
+ propertyValue = QString::fromLatin1("Qt::Date.new(%1, %2, %3)")
1338
+ .arg(d->elementYear())
1339
+ .arg(d->elementMonth())
1340
+ .arg(d->elementDay());
1341
+ break;
1342
+ }
1343
+ case DomProperty::Time: {
1344
+ DomTime *t = p->elementTime();
1345
+ propertyValue = QString::fromLatin1("Qt::Time.new(%1, %2, %3)")
1346
+ .arg(t->elementHour())
1347
+ .arg(t->elementMinute())
1348
+ .arg(t->elementSecond());
1349
+ break;
1350
+ }
1351
+ case DomProperty::DateTime: {
1352
+ DomDateTime *dt = p->elementDateTime();
1353
+ propertyValue = QString::fromLatin1("Qt::DateTime.new(Qt::Date.new(%1, %2, %3), Qt::Time.new(%4, %5, %6))")
1354
+ .arg(dt->elementYear())
1355
+ .arg(dt->elementMonth())
1356
+ .arg(dt->elementDay())
1357
+ .arg(dt->elementHour())
1358
+ .arg(dt->elementMinute())
1359
+ .arg(dt->elementSecond());
1360
+ break;
1361
+ }
1362
+ case DomProperty::StringList:
1363
+ propertyValue = QLatin1String("[]");
1364
+ if (p->elementStringList()->elementString().size()) {
1365
+ QStringList lst = p->elementStringList()->elementString();
1366
+ for (int i=0; i<lst.size(); ++i) {
1367
+ propertyValue += QLatin1String(" << ") + fixString(lst.at(i), m_option.indent);
1368
+ }
1369
+ }
1370
+ break;
1371
+
1372
+ case DomProperty::Url: {
1373
+ DomUrl* u = p->elementUrl();
1374
+ propertyValue = QString::fromLatin1("Qt::Url.new(%1)")
1375
+ .arg(fixString(u->elementString()->text(), m_option.indent));
1376
+ break;
1377
+ }
1378
+ case DomProperty::Brush:
1379
+ propertyValue = writeBrushInitialization(p->elementBrush());
1380
+ break;
1381
+ case DomProperty::Unknown:
1382
+ break;
1383
+ }
1384
+
1385
+ if (propertyValue.size()) {
1386
+ const bool needsTranslation = p->kind() == DomProperty::String && (!p->elementString()->hasAttributeNotr() || !toBool(p->elementString()->attributeNotr()));
1387
+
1388
+ QTextStream &o = needsTranslation ? m_refreshOut : m_output;
1389
+
1390
+ o << m_option.indent << varNewName << setFunction << propertyValue;
1391
+ if (!stdset) {
1392
+ o << "))";
1393
+ }
1394
+ o << "\n";
1395
+ }
1396
+ }
1397
+ if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) {
1398
+ QString objectName = varName;
1399
+ if (m_widgetChain.top()) {
1400
+ const QString parentWidget = m_widgetChain.top()->attributeClass();
1401
+
1402
+ if (!m_layoutChain.top() && (m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3GroupBox"))
1403
+ || m_uic->customWidgetsInfo()->extends(parentWidget, QLatin1String("Q3ButtonGroup")))) {
1404
+ objectName = m_driver->findOrInsertWidget(m_widgetChain.top()) + QLatin1String(".layout()");
1405
+ }
1406
+ }
1407
+ m_output << m_option.indent << objectName << QLatin1String(".setContentsMargins(")
1408
+ << leftMargin << QLatin1String(", ")
1409
+ << topMargin << QLatin1String(", ")
1410
+ << rightMargin << QLatin1String(", ")
1411
+ << bottomMargin << QLatin1String(")\n");
1412
+ }
1413
+ }
1414
+
1415
+ QString WriteInitialization::writeSizePolicy(const DomSizePolicy *sp)
1416
+ {
1417
+
1418
+ // check cache
1419
+ const SizePolicyHandle sizePolicyHandle(sp);
1420
+ const SizePolicyNameMap::const_iterator it = m_sizePolicyNameMap.constFind(sizePolicyHandle);
1421
+ if ( it != m_sizePolicyNameMap.constEnd()) {
1422
+ return it.value();
1423
+ }
1424
+
1425
+
1426
+ // insert with new name
1427
+ const QString spName = QString("@") + m_driver->unique(QLatin1String("sizePolicy"));
1428
+ m_sizePolicyNameMap.insert(sizePolicyHandle, spName);
1429
+
1430
+ m_output << m_option.indent << spName << " = Qt::SizePolicy.new";
1431
+ do {
1432
+ if (sp->hasElementHSizeType() && sp->hasElementVSizeType()) {
1433
+ m_output << "(" << sp->elementHSizeType()
1434
+ << ", " << sp->elementVSizeType() << ")\n";
1435
+ break;
1436
+ }
1437
+ if (sp->hasAttributeHSizeType() && sp->hasAttributeVSizeType()) {
1438
+ m_output << "(Qt::SizePolicy::" << sp->attributeHSizeType() << ", Qt::SizePolicy::"
1439
+ << sp->attributeVSizeType() << ")\n";
1440
+ break;
1441
+ }
1442
+ m_output << "\n";
1443
+ } while (false);
1444
+
1445
+ m_output << m_option.indent << spName << ".setHorizontalStretch("
1446
+ << sp->elementHorStretch() << ")\n";
1447
+ m_output << m_option.indent << spName << ".setVerticalStretch("
1448
+ << sp->elementVerStretch() << ")\n";
1449
+ return spName;
1450
+ }
1451
+ // Check for a font with the given properties in the FontPropertiesNameMap
1452
+ // or create a new one. Returns the name.
1453
+
1454
+ QString WriteInitialization::writeFontProperties(const DomFont *f)
1455
+ {
1456
+ // check cache
1457
+ const FontHandle fontHandle(f);
1458
+ const FontPropertiesNameMap::const_iterator it = m_fontPropertiesNameMap.constFind(fontHandle);
1459
+ if ( it != m_fontPropertiesNameMap.constEnd()) {
1460
+ return it.value();
1461
+ }
1462
+
1463
+ // insert with new name
1464
+ const QString fontName = QString("@") + m_driver->unique(QLatin1String("font"));
1465
+ m_fontPropertiesNameMap.insert(FontHandle(f), fontName);
1466
+
1467
+ m_output << m_option.indent << fontName << " = Qt::Font.new\n";
1468
+ if (f->hasElementFamily() && !f->elementFamily().isEmpty()) {
1469
+ m_output << m_option.indent << fontName << ".family = " << fixString(f->elementFamily(), m_option.indent)
1470
+ << "\n";
1471
+ }
1472
+ if (f->hasElementPointSize() && f->elementPointSize() > 0) {
1473
+ m_output << m_option.indent << fontName << ".pointSize = " << f->elementPointSize()
1474
+ << "\n";
1475
+ }
1476
+
1477
+ if (f->hasElementBold()) {
1478
+ m_output << m_option.indent << fontName << ".bold = "
1479
+ << (f->elementBold() ? "true" : "false") << "\n";
1480
+ }
1481
+ if (f->hasElementItalic()) {
1482
+ m_output << m_option.indent << fontName << ".italic = "
1483
+ << (f->elementItalic() ? "true" : "false") << "\n";
1484
+ }
1485
+ if (f->hasElementUnderline()) {
1486
+ m_output << m_option.indent << fontName << ".underline = "
1487
+ << (f->elementUnderline() ? "true" : "false") << "\n";
1488
+ }
1489
+ if (f->hasElementWeight() && f->elementWeight() > 0) {
1490
+ m_output << m_option.indent << fontName << ".weight = "
1491
+ << f->elementWeight() << "" << endl;
1492
+ }
1493
+ if (f->hasElementStrikeOut()) {
1494
+ m_output << m_option.indent << fontName << ".strikeOut = "
1495
+ << (f->elementStrikeOut() ? "true" : "false") << "\n";
1496
+ }
1497
+ if (f->hasElementKerning()) {
1498
+ m_output << m_option.indent << fontName << ".kerning = "
1499
+ << (f->elementKerning() ? "true" : "false") << "\n";
1500
+ }
1501
+ if (f->hasElementAntialiasing()) {
1502
+ m_output << m_option.indent << fontName << ".styleStrategy = "
1503
+ << (f->elementAntialiasing() ? "Qt::Font::PreferDefault" : "Qt::Font::NoAntialias") << "\n";
1504
+ }
1505
+ if (f->hasElementStyleStrategy()) {
1506
+ m_output << m_option.indent << fontName << ".styleStrategy = Qt::Font::"
1507
+ << f->elementStyleStrategy() << "\n";
1508
+ }
1509
+ return fontName;
1510
+ }
1511
+
1512
+ QString WriteInitialization::writeIconProperties(const DomResourceIcon *i)
1513
+ {
1514
+ // check cache
1515
+ const IconHandle iconHandle(i);
1516
+ const IconPropertiesNameMap::const_iterator it = m_iconPropertiesNameMap.constFind(iconHandle);
1517
+ if (it != m_iconPropertiesNameMap.constEnd()) {
1518
+ return it.value();
1519
+ }
1520
+
1521
+ // insert with new name
1522
+ const QString iconName = m_driver->unique(QLatin1String("icon"));
1523
+ m_iconPropertiesNameMap.insert(IconHandle(i), iconName);
1524
+ if (isIconFormat44(i)) {
1525
+ const QString pixmap = QLatin1String("Qt::Pixmap.new");
1526
+ m_output << m_option.indent << iconName << " = Qt::Icon.new\n";
1527
+ if (i->hasElementNormalOff())
1528
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementNormalOff()->text()) << ", Qt::Icon::Normal, Qt::Icon::Off)\n";
1529
+ if (i->hasElementNormalOn())
1530
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementNormalOn()->text()) << ", Qt::Icon::Normal, Qt::Icon::On)\n";
1531
+ if (i->hasElementDisabledOff())
1532
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementDisabledOff()->text()) << ", Qt::Icon::Disabled, Qt::Icon::Off)\n";
1533
+ if (i->hasElementDisabledOn())
1534
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementDisabledOn()->text()) << ", Qt::Icon::Disabled, Qt::Icon::On)\n";
1535
+ if (i->hasElementActiveOff())
1536
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementActiveOff()->text()) << ", Qt::Icon::Active, Qt::Icon::Off)\n";
1537
+ if (i->hasElementActiveOn())
1538
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementActiveOn()->text()) << ", Qt::Icon::Active, Qt::Icon::On)\n";
1539
+ if (i->hasElementSelectedOff())
1540
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementSelectedOff()->text()) << ", Qt::Icon::Selected, Qt::Icon::Off)\n";
1541
+ if (i->hasElementSelectedOn())
1542
+ m_output << m_option.indent << iconName << ".addPixmap(" << pixCall(pixmap, i->elementSelectedOn()->text()) << ", Qt::Icon::Selected, Qt::Icon::On)\n";
1543
+ } else { // pre-4.4 legacy
1544
+ m_output << m_option.indent << iconName << " = " << pixCall(QLatin1String("Qt::Icon.new"), i->text())<< "\n";
1545
+ }
1546
+ return iconName;
1547
+ }
1548
+
1549
+ QString WriteInitialization::domColor2QString(const DomColor *c)
1550
+ {
1551
+ if (c->hasAttributeAlpha())
1552
+ return QString::fromLatin1("Qt::Color.new(%1, %2, %3, %4)")
1553
+ .arg(c->elementRed())
1554
+ .arg(c->elementGreen())
1555
+ .arg(c->elementBlue())
1556
+ .arg(c->attributeAlpha());
1557
+ return QString::fromLatin1("Qt::Color.new(%1, %2, %3)")
1558
+ .arg(c->elementRed())
1559
+ .arg(c->elementGreen())
1560
+ .arg(c->elementBlue());
1561
+ }
1562
+
1563
+ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName)
1564
+ {
1565
+ if (!colorGroup)
1566
+ return;
1567
+
1568
+ // old format
1569
+ QList<DomColor*> colors = colorGroup->elementColor();
1570
+ for (int i=0; i<colors.size(); ++i) {
1571
+ DomColor *color = colors.at(i);
1572
+
1573
+ m_output << m_option.indent << paletteName << ".setColor(" << group
1574
+ << ", " << i
1575
+ << ", " << domColor2QString(color)
1576
+ << ")\n";
1577
+ }
1578
+
1579
+ // new format
1580
+ const QList<DomColorRole *> colorRoles = colorGroup->elementColorRole();
1581
+ QListIterator<DomColorRole *> itRole(colorRoles);
1582
+ while (itRole.hasNext()) {
1583
+ const DomColorRole *colorRole = itRole.next();
1584
+ if (colorRole->hasAttributeRole()) {
1585
+ const QString brushName = writeBrushInitialization(colorRole->elementBrush());
1586
+ m_output << m_option.indent << paletteName << ".setBrush(" << group
1587
+ << ", " << "Qt::Palette::" << colorRole->attributeRole()
1588
+ << ", " << brushName << ")\n";
1589
+ }
1590
+ }
1591
+ }
1592
+ // Write initialization for brush unless it is found in the cache. Returns the name to use
1593
+ // in an expression.
1594
+ QString WriteInitialization::writeBrushInitialization(const DomBrush *brush)
1595
+ {
1596
+ // Simple solid, colored brushes are cached
1597
+ const bool solidColoredBrush = !brush->hasAttributeBrushStyle() || brush->attributeBrushStyle() == QLatin1String("SolidPattern");
1598
+ uint rgb = 0;
1599
+ if (solidColoredBrush) {
1600
+ if (const DomColor *color = brush->elementColor()) {
1601
+ rgb = ((color->elementRed() & 0xFF) << 24) |
1602
+ ((color->elementGreen() & 0xFF) << 16) |
1603
+ ((color->elementBlue() & 0xFF) << 8) |
1604
+ ((color->attributeAlpha() & 0xFF));
1605
+ const ColorBrushHash::const_iterator cit = m_colorBrushHash.constFind(rgb);
1606
+ if (cit != m_colorBrushHash.constEnd())
1607
+ return cit.value();
1608
+ }
1609
+ }
1610
+ // Create and enter into cache if simple
1611
+ const QString brushName = m_driver->unique(QLatin1String("brush"));
1612
+ writeBrush(brush, brushName);
1613
+ if (solidColoredBrush)
1614
+ m_colorBrushHash.insert(rgb, brushName);
1615
+ return brushName;
1616
+ }
1617
+
1618
+ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brushName)
1619
+ {
1620
+ QString style = QLatin1String("SolidPattern");
1621
+ if (brush->hasAttributeBrushStyle())
1622
+ style = brush->attributeBrushStyle();
1623
+
1624
+ if (style == QLatin1String("LinearGradientPattern") ||
1625
+ style == QLatin1String("RadialGradientPattern") ||
1626
+ style == QLatin1String("ConicalGradientPattern")) {
1627
+ DomGradient *gradient = brush->elementGradient();
1628
+ QString gradientType = gradient->attributeType();
1629
+ QString gradientName = m_driver->unique(QLatin1String("gradient"));
1630
+ if (gradientType == QLatin1String("LinearGradient")) {
1631
+ m_output << m_option.indent << gradientName << " = Qt::LinearGradient.new"
1632
+ << "(" << gradient->attributeStartX()
1633
+ << ", " << gradient->attributeStartY()
1634
+ << ", " << gradient->attributeEndX()
1635
+ << ", " << gradient->attributeEndY() << ")\n";
1636
+ } else if (gradientType == QLatin1String("RadialGradient")) {
1637
+ m_output << m_option.indent << gradientName << " = Qt::RadialGradient.new"
1638
+ << "(" << gradient->attributeCentralX()
1639
+ << ", " << gradient->attributeCentralY()
1640
+ << ", " << gradient->attributeRadius()
1641
+ << ", " << gradient->attributeFocalX()
1642
+ << ", " << gradient->attributeFocalY() << ")\n";
1643
+ } else if (gradientType == QLatin1String("ConicalGradient")) {
1644
+ m_output << m_option.indent << gradientName << " = Qt::ConicalGradient.new"
1645
+ << "(" << gradient->attributeCentralX()
1646
+ << ", " << gradient->attributeCentralY()
1647
+ << ", " << gradient->attributeAngle() << ")\n";
1648
+ }
1649
+
1650
+ m_output << m_option.indent << gradientName << ".spread = Qt::Gradient::"
1651
+ << gradient->attributeSpread() << "\n";
1652
+
1653
+ if (gradient->hasAttributeCoordinateMode()) {
1654
+ m_output << m_option.indent << gradientName << ".coordinateMode = Qt::Gradient::"
1655
+ << gradient->attributeCoordinateMode() << "\n";
1656
+ }
1657
+
1658
+ const QList<DomGradientStop *> stops = gradient->elementGradientStop();
1659
+ QListIterator<DomGradientStop *> it(stops);
1660
+ while (it.hasNext()) {
1661
+ const DomGradientStop *stop = it.next();
1662
+ const DomColor *color = stop->elementColor();
1663
+ m_output << m_option.indent << gradientName << ".setColorAt("
1664
+ << stop->attributePosition() << ", "
1665
+ << domColor2QString(color) << ")\n";
1666
+ }
1667
+ m_output << m_option.indent << brushName << " = Qt::Brush.new" << "("
1668
+ << gradientName << ")\n";
1669
+ } else if (style == QLatin1String("TexturePattern")) {
1670
+ DomProperty *property = brush->elementTexture();
1671
+
1672
+ m_output << m_option.indent << brushName << " = Qt::Brush.new" << "("
1673
+ << pixCall(property) << ")\n";
1674
+ } else {
1675
+ DomColor *color = brush->elementColor();
1676
+ m_output << m_option.indent << brushName << " = Qt::Brush.new" << "("
1677
+ << domColor2QString(color) << ")\n";
1678
+
1679
+ m_output << m_option.indent << brushName << ".style = "
1680
+ << "Qt::" << style << "\n";
1681
+ }
1682
+ }
1683
+
1684
+ void WriteInitialization::acceptCustomWidget(DomCustomWidget *node)
1685
+ {
1686
+ Q_UNUSED(node);
1687
+ }
1688
+
1689
+ void WriteInitialization::acceptCustomWidgets(DomCustomWidgets *node)
1690
+ {
1691
+ Q_UNUSED(node);
1692
+ }
1693
+
1694
+ void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
1695
+ {
1696
+ QString lastName;
1697
+
1698
+ const QStringList l = tabStops->elementTabStop();
1699
+ for (int i=0; i<l.size(); ++i) {
1700
+ QString name = l.at(i);
1701
+
1702
+ if (!m_registeredWidgets.contains(name)) {
1703
+ fprintf(stderr, "'%s' isn't a valid widget\n", name.toLatin1().data());
1704
+ continue;
1705
+ }
1706
+
1707
+ if (i == 0) {
1708
+ lastName = name;
1709
+ continue;
1710
+ } else if (name.isEmpty() || lastName.isEmpty()) {
1711
+ continue;
1712
+ }
1713
+
1714
+ m_output << m_option.indent << "Qt::Widget.setTabOrder(@" << lastName << ", @" << name << ")\n";
1715
+
1716
+ lastName = name;
1717
+ }
1718
+ }
1719
+
1720
+ void WriteInitialization::initializeQ3ListBox(DomWidget *w)
1721
+ {
1722
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
1723
+ QString className = w->attributeClass();
1724
+
1725
+ QList<DomItem*> items = w->elementItem();
1726
+
1727
+ if (items.isEmpty())
1728
+ return;
1729
+
1730
+ m_refreshOut << m_option.indent << varName << ".clear()\n";
1731
+
1732
+ for (int i=0; i<items.size(); ++i) {
1733
+ DomItem *item = items.at(i);
1734
+
1735
+ QHash<QString, DomProperty*> properties = propertyMap(item->elementProperty());
1736
+ DomProperty *text = properties.value(QLatin1String("text"));
1737
+ DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
1738
+ if (!(text || pixmap))
1739
+ continue;
1740
+
1741
+ m_refreshOut << m_option.indent << varName << ".insertItem(";
1742
+ if (pixmap) {
1743
+ m_refreshOut << pixCall(pixmap);
1744
+
1745
+ if (text)
1746
+ m_refreshOut << ", ";
1747
+ }
1748
+ if (text)
1749
+ m_refreshOut << trCall(text->elementString());
1750
+ m_refreshOut << ")\n";
1751
+ }
1752
+ }
1753
+
1754
+ void WriteInitialization::initializeQ3IconView(DomWidget *w)
1755
+ {
1756
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
1757
+ QString className = w->attributeClass();
1758
+
1759
+ QList<DomItem*> items = w->elementItem();
1760
+
1761
+ if (items.isEmpty())
1762
+ return;
1763
+
1764
+ m_refreshOut << m_option.indent << varName << ".clear()\n";
1765
+
1766
+ for (int i=0; i<items.size(); ++i) {
1767
+ DomItem *item = items.at(i);
1768
+
1769
+ QHash<QString, DomProperty*> properties = propertyMap(item->elementProperty());
1770
+ DomProperty *text = properties.value(QLatin1String("text"));
1771
+ DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
1772
+ if (!(text || pixmap))
1773
+ continue;
1774
+
1775
+ QString itemName = m_driver->unique(QLatin1String("__item"));
1776
+ m_refreshOut << "\n";
1777
+ m_refreshOut << m_option.indent << itemName << " = Qt::3IconViewItem.new(" << varName << ")\n";
1778
+
1779
+ if (pixmap) {
1780
+ m_refreshOut << m_option.indent << itemName << ".pixmap = " << pixCall(pixmap) << "\n";
1781
+ }
1782
+
1783
+ if (text) {
1784
+ m_refreshOut << m_option.indent << itemName << ".text = " << trCall(text->elementString()) << "\n";
1785
+ }
1786
+ }
1787
+ }
1788
+
1789
+ void WriteInitialization::initializeQ3ListView(DomWidget *w)
1790
+ {
1791
+ const QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
1792
+ const QString className = w->attributeClass();
1793
+
1794
+ // columns
1795
+ QList<DomColumn*> columns = w->elementColumn();
1796
+ for (int i=0; i<columns.size(); ++i) {
1797
+ DomColumn *column = columns.at(i);
1798
+
1799
+ const DomPropertyMap properties = propertyMap(column->elementProperty());
1800
+ const DomProperty *text = properties.value(QLatin1String("text"));
1801
+ const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
1802
+ const DomProperty *clickable = properties.value(QLatin1String("clickable"));
1803
+ const DomProperty *resizable = properties.value(QLatin1String("resizable"));
1804
+
1805
+ QString txt = trCall(text->elementString());
1806
+ m_output << m_option.indent << varName << ".addColumn(" << txt << ")\n";
1807
+ m_refreshOut << m_option.indent << varName << ".header.setLabel(" << i << ", " << txt << ")\n";
1808
+
1809
+ if (pixmap) {
1810
+ m_output << m_option.indent << varName << ".header.setLabel("
1811
+ << varName << ".header.count - 1, " << pixCall(pixmap) << ", " << txt << ")\n";
1812
+ }
1813
+
1814
+ if (clickable != 0) {
1815
+ m_output << m_option.indent << varName << ".header.setClickEnabled(" << clickable->elementBool() << ", " << varName << ".header().count() - 1)\n";
1816
+ }
1817
+
1818
+ if (resizable != 0) {
1819
+ m_output << m_option.indent << varName << ".header.setResizeEnabled(" << resizable->elementBool() << ", " << varName << ".header().count() - 1)\n";
1820
+ }
1821
+ }
1822
+
1823
+ if (w->elementItem().size()) {
1824
+ m_refreshOut << m_option.indent << varName << ".clear\n";
1825
+
1826
+ initializeQ3ListViewItems(className, varName, w->elementItem());
1827
+ }
1828
+ }
1829
+
1830
+ void WriteInitialization::initializeQ3ListViewItems(const QString &className, const QString &varName, const QList<DomItem *> &items)
1831
+ {
1832
+ if (items.isEmpty())
1833
+ return;
1834
+
1835
+ // items
1836
+ for (int i=0; i<items.size(); ++i) {
1837
+ DomItem *item = items.at(i);
1838
+
1839
+ QString itemName = m_driver->unique(QLatin1String("__item"));
1840
+ m_refreshOut << "\n";
1841
+ m_refreshOut << m_option.indent << itemName << " = new Qt3::ListViewItem.new(" << varName << ")\n";
1842
+
1843
+ int textCount = 0, pixCount = 0;
1844
+ const DomPropertyList properties = item->elementProperty();
1845
+ for (int i=0; i<properties.size(); ++i) {
1846
+ const DomProperty *p = properties.at(i);
1847
+ if (p->attributeName() == QLatin1String("text"))
1848
+ m_refreshOut << m_option.indent << itemName << ".setText(" << textCount++ << ", "
1849
+ << trCall(p->elementString()) << ")\n";
1850
+
1851
+ if (p->attributeName() == QLatin1String("pixmap"))
1852
+ m_refreshOut << m_option.indent << itemName << ".setPixmap(" << pixCount++ << ", "
1853
+ << pixCall(p) << ")\n";
1854
+ }
1855
+
1856
+ if (item->elementItem().size()) {
1857
+ m_refreshOut << m_option.indent << itemName << ".open = true\n";
1858
+ initializeQ3ListViewItems(className, itemName, item->elementItem());
1859
+ }
1860
+ }
1861
+ }
1862
+
1863
+ void WriteInitialization::initializeQ3Table(DomWidget *w)
1864
+ {
1865
+ const QString varName = m_driver->findOrInsertWidget(w);
1866
+ const QString className = w->attributeClass();
1867
+
1868
+ // columns
1869
+ const QList<DomColumn*> columns = w->elementColumn();
1870
+
1871
+ for (int i=0; i<columns.size(); ++i) {
1872
+ const DomColumn *column = columns.at(i);
1873
+
1874
+ const DomPropertyMap properties = propertyMap(column->elementProperty());
1875
+ const DomProperty *text = properties.value(QLatin1String("text"));
1876
+ const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
1877
+
1878
+ m_refreshOut << m_option.indent << varName << ".horizontalHeader.setLabel(" << i << ", ";
1879
+ if (pixmap) {
1880
+ m_refreshOut << pixCall(pixmap) << ", ";
1881
+ }
1882
+ m_refreshOut << trCall(text->elementString()) << ")\n";
1883
+ }
1884
+
1885
+ // rows
1886
+ const QList<DomRow*> rows = w->elementRow();
1887
+ for (int i=0; i<rows.size(); ++i) {
1888
+ const DomRow *row = rows.at(i);
1889
+
1890
+ const DomPropertyMap properties = propertyMap(row->elementProperty());
1891
+ const DomProperty *text = properties.value(QLatin1String("text"));
1892
+ const DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
1893
+
1894
+ m_refreshOut << m_option.indent << varName << ".verticalHeader.setLabel(" << i << ", ";
1895
+ if (pixmap) {
1896
+ m_refreshOut << pixCall(pixmap) << ", ";
1897
+ }
1898
+ m_refreshOut << trCall(text->elementString()) << ")\n";
1899
+ }
1900
+
1901
+
1902
+ //initializeQ3TableItems(className, varName, w->elementItem());
1903
+ }
1904
+
1905
+ void WriteInitialization::initializeQ3TableItems(const QString &className, const QString &varName, const QList<DomItem *> &items)
1906
+ {
1907
+ Q_UNUSED(className);
1908
+ Q_UNUSED(varName);
1909
+ Q_UNUSED(items);
1910
+ }
1911
+
1912
+ QString WriteInitialization::iconCall(const DomProperty *icon)
1913
+ {
1914
+ if (icon->kind() == DomProperty::IconSet)
1915
+ return writeIconProperties(icon->elementIconSet());
1916
+ return pixCall(icon);
1917
+ }
1918
+
1919
+ QString WriteInitialization::pixCall(const DomProperty *p) const
1920
+ {
1921
+ QString type, s;
1922
+ switch (p->kind()) {
1923
+ case DomProperty::IconSet:
1924
+ type = QLatin1String("Qt::Icon.new");
1925
+ s = p->elementIconSet()->text();
1926
+ break;
1927
+ case DomProperty::Pixmap:
1928
+ type = QLatin1String("Qt::Pixmap.new");
1929
+ s = p->elementPixmap()->text();
1930
+ break;
1931
+ default:
1932
+ qWarning() << "Warning: Unknown icon format encountered. The ui-file was generated with a too-recent version of Designer.";
1933
+ return QLatin1String("QIcon()");
1934
+ break;
1935
+ }
1936
+ return pixCall(type, s);
1937
+ }
1938
+
1939
+ QString WriteInitialization::pixCall(const QString &t, const QString &text) const
1940
+ {
1941
+ QString type = t;
1942
+ if (text.isEmpty()) {
1943
+ type += QLatin1String("()");
1944
+ return type;
1945
+ }
1946
+ if (const DomImage *image = findImage(text)) {
1947
+
1948
+ if (m_option.extractImages) {
1949
+ const QString format = image->elementData()->attributeFormat();
1950
+ const QString extension = format.left(format.indexOf(QLatin1Char('.'))).toLower();
1951
+ QString rc = QLatin1String("Qt::Pixmap.new(\":/");
1952
+ rc += m_generatedClass;
1953
+ rc += QLatin1String("/images/");
1954
+ rc += text;
1955
+ rc += QLatin1Char('.');
1956
+ rc += extension;
1957
+ rc += QLatin1String("\")");
1958
+ return rc;
1959
+ }
1960
+
1961
+ QString rc = WriteIconInitialization::iconFromDataFunction();
1962
+ rc += QLatin1Char('(');
1963
+ rc += text;
1964
+ rc += QLatin1String("_ID)");
1965
+ return rc;
1966
+ }
1967
+
1968
+ QString pixFunc = m_uic->pixmapFunction();
1969
+ type += pixFunc;
1970
+ type += QLatin1Char('(');
1971
+ type += fixString(text, m_option.indent);
1972
+ type += QLatin1String(")");
1973
+ return type;
1974
+ }
1975
+
1976
+ void WriteInitialization::initializeComboBox(DomWidget *w)
1977
+ {
1978
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
1979
+ const QString className = w->attributeClass();
1980
+
1981
+ const QList<DomItem*> items = w->elementItem();
1982
+
1983
+ if (items.isEmpty())
1984
+ return;
1985
+
1986
+ // If possible use qcombobox's addItems() which is much faster than a bunch of addItem() calls
1987
+ bool noIcons = true;
1988
+ QStringList list;
1989
+ for (int i=0; i<items.size(); ++i) {
1990
+ const DomItem *item = items.at(i);
1991
+ const DomPropertyMap properties = propertyMap(item->elementProperty());
1992
+ const DomProperty *text = properties.value(QLatin1String("text"));
1993
+ const DomProperty *pixmap = properties.value(QLatin1String("icon"));
1994
+ if (pixmap != 0) {
1995
+ noIcons = false;
1996
+ break;
1997
+ }
1998
+ list.append(trCall(text->elementString()));
1999
+ }
2000
+
2001
+ if (noIcons) {
2002
+ m_refreshOut << m_option.indent << varName << ".insertItems(0, [" ;
2003
+ for (int i = 0; i < list.size(); ++i) {
2004
+ m_refreshOut << list.at(i);
2005
+ if (i != (list.size() - 1)) {
2006
+ m_refreshOut << ",\n" << m_option.indent << m_option.indent;
2007
+ }
2008
+ }
2009
+ m_refreshOut << "])\n";
2010
+ } else {
2011
+ for (int i = 0; i < items.size(); ++i) {
2012
+ const DomItem *item = items.at(i);
2013
+ const DomPropertyMap properties = propertyMap(item->elementProperty());
2014
+ const DomProperty *text = properties.value(QLatin1String("text"));
2015
+ const DomProperty *icon = properties.value(QLatin1String("icon"));
2016
+
2017
+ QString iconValue;
2018
+ if (icon)
2019
+ iconValue = iconCall(icon);
2020
+
2021
+ m_output << m_option.indent << varName << ".addItem(";
2022
+ if (icon)
2023
+ m_output << iconValue << ", ";
2024
+ m_output << "\"\")\n";
2025
+
2026
+ if (!toString(text->elementString()).isEmpty())
2027
+ m_refreshOut << m_option.indent << varName << ".setItemText(" << i << ", " << trCall(text->elementString()) << ")\n";
2028
+ }
2029
+ m_refreshOut << "\n";
2030
+ }
2031
+ }
2032
+
2033
+ QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName)
2034
+ {
2035
+ // turn off sortingEnabled to force programmatic item order (setItem())
2036
+ QString tempName;
2037
+ if (!w->elementItem().isEmpty()) {
2038
+ tempName = m_driver->unique(QLatin1String("__sortingEnabled"));
2039
+ m_refreshOut << "\n";
2040
+ m_refreshOut << m_option.indent << tempName
2041
+ << " = " << varName << ".sortingEnabled?\n";
2042
+ m_refreshOut << m_option.indent << varName << ".sortingEnabled = false\n";
2043
+ }
2044
+ return tempName;
2045
+ }
2046
+
2047
+ void WriteInitialization::enableSorting(DomWidget *w, const QString &varName, const QString &tempName)
2048
+ {
2049
+ if (!w->elementItem().isEmpty()) {
2050
+ m_refreshOut << "\n";
2051
+ m_refreshOut << m_option.indent << varName << ".sortingEnabled = " << tempName << "\n";
2052
+ }
2053
+ }
2054
+
2055
+ void WriteInitialization::initializeListWidget(DomWidget *w)
2056
+ {
2057
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
2058
+ const QString className = w->attributeClass();
2059
+
2060
+ const QList<DomItem*> items = w->elementItem();
2061
+
2062
+ if (items.isEmpty())
2063
+ return;
2064
+
2065
+ QString tempName = disableSorting(w, varName);
2066
+ // items
2067
+ for (int i = 0; i < items.size(); ++i) {
2068
+ const DomItem *item = items.at(i);
2069
+
2070
+ const DomPropertyMap properties = propertyMap(item->elementProperty());
2071
+ const DomProperty *text = properties.value(QLatin1String("text"));
2072
+ const DomProperty *icon = properties.value(QLatin1String("icon"));
2073
+
2074
+ QString itemCreation = QLatin1String("Qt::ListWidgetItem.new(") + varName + QLatin1String(")\n");
2075
+ if (icon) {
2076
+ const QString iconValue = iconCall(icon);
2077
+ const QString itemName = m_driver->unique(QLatin1String("__listItem"));
2078
+ m_output << m_option.indent << itemName << " = " << itemCreation;
2079
+ m_output << m_option.indent << itemName << ".icon = " << iconValue << "\n";
2080
+ } else {
2081
+ m_output << m_option.indent << itemCreation;
2082
+ }
2083
+
2084
+ if (!toString(text->elementString()).isEmpty()) {
2085
+ m_refreshOut << m_option.indent << varName << ".item(" << i << ").text = " << trCall(text->elementString()) << "\n";
2086
+ }
2087
+ }
2088
+ enableSorting(w, varName, tempName);
2089
+ }
2090
+
2091
+ void WriteInitialization::initializeTreeWidget(DomWidget *w)
2092
+ {
2093
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
2094
+ const QString className = w->attributeClass();
2095
+
2096
+ // columns
2097
+ const QList<DomColumn*> columns = w->elementColumn();
2098
+ for (int i = 0; i < columns.size(); ++i) {
2099
+ const DomColumn *column = columns.at(i);
2100
+
2101
+ const DomPropertyMap properties = propertyMap(column->elementProperty());
2102
+ const DomProperty *text = properties.value(QLatin1String("text"));
2103
+ const DomProperty *icon = properties.value(QLatin1String("icon"));
2104
+
2105
+ if (!toString(text->elementString()).isEmpty()) {
2106
+ const QString txt = trCall(text->elementString());
2107
+ m_refreshOut << m_option.indent << varName << ".headerItem.setText(" << i << ", " << txt << ")\n";
2108
+ }
2109
+
2110
+ if (icon) {
2111
+ const QString iconValue = iconCall(icon);
2112
+ m_output << m_option.indent << varName << ".headerItem.setIcon("
2113
+ << i << ", " << iconValue << ")\n";
2114
+ }
2115
+ }
2116
+
2117
+ if (w->elementItem().size()) {
2118
+ QString tempName = disableSorting(w, varName);
2119
+
2120
+ initializeTreeWidgetItems(className, varName, w->elementItem(), varName + QLatin1String(".topLevelItem("));
2121
+
2122
+ enableSorting(w, varName, tempName);
2123
+ }
2124
+ }
2125
+
2126
+ void WriteInitialization::initializeTreeWidgetItems(const QString &className, const QString &varName, const QList<DomItem *> &items, const QString &parentPath)
2127
+ {
2128
+ if (items.isEmpty())
2129
+ return;
2130
+
2131
+ // items
2132
+ for (int i = 0; i < items.size(); ++i) {
2133
+ const DomItem *item = items.at(i);
2134
+
2135
+ int textCount = 0;
2136
+ const DomPropertyList properties = item->elementProperty();
2137
+ QStringList icons;
2138
+ for (int j = 0; j < properties.size(); ++j) {
2139
+ const DomProperty *p = properties.at(j);
2140
+ if (p->attributeName() == QLatin1String("text")) {
2141
+ if (!toString(p->elementString()).isEmpty()) {
2142
+ m_refreshOut << m_option.indent << parentPath << i << ").setText(" << textCount << ", "
2143
+ << trCall(p->elementString()) << ")\n";
2144
+ }
2145
+ textCount++;
2146
+ }
2147
+
2148
+ if (p->attributeName() == QLatin1String("icon")) {
2149
+ const QString iconValue = iconCall(p);
2150
+ icons << QLatin1String(".setIcon(")
2151
+ + QString::number(textCount - 1)
2152
+ + QLatin1String(", ") + iconValue + QLatin1String(")\n");
2153
+ }
2154
+ }
2155
+ if (icons.isEmpty() && (item->elementItem().size() == 0)) {
2156
+ m_output << m_option.indent << "Qt::TreeWidgetItem.new(" << varName << ")\n";
2157
+ } else {
2158
+ const QString itemName = m_driver->unique(QLatin1String("__treeItem"));
2159
+ m_output << m_option.indent << itemName << " = Qt::TreeWidgetItem.new(" << varName << ")\n";
2160
+
2161
+ QStringListIterator it(icons);
2162
+ while (it.hasNext())
2163
+ m_output << m_option.indent << itemName << it.next();
2164
+
2165
+ if (item->elementItem().size()) {
2166
+ const QString childPath = parentPath + QString::number(i) + QLatin1String(").child(");
2167
+ initializeTreeWidgetItems(className, itemName, item->elementItem(), childPath);
2168
+ }
2169
+ }
2170
+
2171
+ }
2172
+ m_output << "\n";
2173
+ }
2174
+
2175
+ void WriteInitialization::initializeTableWidget(DomWidget *w)
2176
+ {
2177
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
2178
+ QString className = w->attributeClass();
2179
+
2180
+ // columns
2181
+ QList<DomColumn *> columns = w->elementColumn();
2182
+
2183
+ if (columns.size() != 0) {
2184
+ m_refreshOut << m_option.indent << "if " << varName << ".columnCount < " << columns.size() << "\n"
2185
+ << m_option.indent << m_option.indent << varName << ".columnCount = " << columns.size() << "\n"
2186
+ << m_option.indent << "end\n";
2187
+ }
2188
+
2189
+ for (int i = 0; i < columns.size(); ++i) {
2190
+ DomColumn *column = columns.at(i);
2191
+
2192
+ QHash<QString, DomProperty*> properties = propertyMap(column->elementProperty());
2193
+ DomProperty *text = properties.value(QLatin1String("text"));
2194
+ DomProperty *icon = properties.value(QLatin1String("icon"));
2195
+ if (text || icon) {
2196
+ QString itemName = m_driver->unique(QLatin1String("__colItem"));
2197
+ m_refreshOut << "\n";
2198
+ m_refreshOut << m_option.indent
2199
+ << itemName << " = Qt::TableWidgetItem.new\n";
2200
+
2201
+ if (text && text->attributeName() == QLatin1String("text"))
2202
+ m_refreshOut << m_option.indent << itemName << ".setText("
2203
+ << trCall(text->elementString()) << ")\n";
2204
+
2205
+ if (icon && icon->attributeName() == QLatin1String("icon"))
2206
+ m_refreshOut << m_option.indent << itemName << ".setIcon("
2207
+ << pixCall(icon) << ")\n";
2208
+ m_refreshOut << m_option.indent << varName << ".setHorizontalHeaderItem("
2209
+ << i << ", " << itemName << ")\n";
2210
+ }
2211
+ }
2212
+
2213
+ // rows
2214
+ QList<DomRow *> rows = w->elementRow();
2215
+
2216
+ if (rows.size() != 0) {
2217
+ m_refreshOut << m_option.indent << "if " << varName << ".rowCount < " << rows.size() << "\n"
2218
+ << m_option.indent << m_option.indent << varName << ".rowCount = " << rows.size() << "\n"
2219
+ << m_option.indent << "end\n";
2220
+ }
2221
+
2222
+ for (int i = 0; i < rows.size(); ++i) {
2223
+ DomRow *row = rows.at(i);
2224
+
2225
+ QHash<QString, DomProperty*> properties = propertyMap(row->elementProperty());
2226
+ DomProperty *text = properties.value(QLatin1String("text"));
2227
+ DomProperty *icon = properties.value(QLatin1String("icon"));
2228
+ if (text || icon) {
2229
+ QString itemName = m_driver->unique(QLatin1String("__rowItem"));
2230
+ m_refreshOut << "\n";
2231
+ m_refreshOut << m_option.indent
2232
+ << itemName << " = Qt::TableWidgetItem.new\n";
2233
+
2234
+ if (text && text->attributeName() == QLatin1String("text"))
2235
+ m_refreshOut << m_option.indent << itemName << ".setText("
2236
+ << trCall(text->elementString()) << ")\n";
2237
+
2238
+ if (icon && icon->attributeName() == QLatin1String("icon"))
2239
+ m_refreshOut << m_option.indent << itemName << ".setIcon("
2240
+ << pixCall(icon) << ")\n";
2241
+ m_refreshOut << m_option.indent << varName << ".setVerticalHeaderItem("
2242
+ << i << ", " << itemName << ")\n";
2243
+ }
2244
+ }
2245
+
2246
+ // items
2247
+ QList<DomItem *> items = w->elementItem();
2248
+ for (int i = 0; i < items.size(); ++i) {
2249
+ DomItem *item = items.at(i);
2250
+ if (item->hasAttributeRow() && item->hasAttributeColumn()) {
2251
+ QHash<QString, DomProperty*> properties = propertyMap(item->elementProperty());
2252
+ DomProperty *text = properties.value(QLatin1String("text"));
2253
+ DomProperty *icon = properties.value(QLatin1String("icon"));
2254
+ if (text || icon) {
2255
+ QString itemName = m_driver->unique(QLatin1String("__item"));
2256
+ m_refreshOut << "\n";
2257
+ m_refreshOut << m_option.indent
2258
+ << itemName << " = Qt::TableWidgetItem.new\n";
2259
+
2260
+ if (text && text->attributeName() == QLatin1String("text"))
2261
+ m_refreshOut << m_option.indent << itemName << ".setText("
2262
+ << trCall(text->elementString()) << ")\n";
2263
+
2264
+ if (icon && icon->attributeName() == QLatin1String("icon"))
2265
+ m_refreshOut << m_option.indent << itemName << ".setIcon("
2266
+ << pixCall(icon) << ")\n";
2267
+ m_refreshOut << m_option.indent << varName << ".setItem("
2268
+ << item->attributeRow() << ", "
2269
+ << item->attributeColumn() << ", "
2270
+ << itemName << ")\n";
2271
+ }
2272
+ }
2273
+ }
2274
+ }
2275
+
2276
+ QString WriteInitialization::trCall(const QString &str, const QString &commentHint) const
2277
+ {
2278
+ if (str.isEmpty())
2279
+ return QLatin1String("''");
2280
+
2281
+ QString result;
2282
+ QString comment = commentHint.isEmpty() ? QString::fromUtf8("nil") : fixString(commentHint, m_option.indent);
2283
+
2284
+ if (m_option.translateFunction.isEmpty()) {
2285
+ result = QLatin1String("Qt::Application.translate(\"");
2286
+ result += m_generatedClass;
2287
+ result += QLatin1String("\"");
2288
+ result += QLatin1String(", ");
2289
+ } else {
2290
+ result = m_option.translateFunction + QLatin1String("(");
2291
+ }
2292
+
2293
+ result += fixString(str, m_option.indent);
2294
+ result += QLatin1String(", ");
2295
+ result += comment;
2296
+
2297
+ if (m_option.translateFunction.isEmpty()) {
2298
+ result += QLatin1String(", ");
2299
+ result += QLatin1String("Qt::Application::UnicodeUTF8");
2300
+ }
2301
+
2302
+ result += QLatin1String(")");
2303
+ return result;
2304
+ }
2305
+
2306
+ void WriteInitialization::initializeQ3SqlDataTable(DomWidget *w)
2307
+ {
2308
+ QHash<QString, DomProperty*> properties = propertyMap(w->elementProperty());
2309
+
2310
+ DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
2311
+ if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
2312
+ return;
2313
+
2314
+ QString connection;
2315
+ QString table;
2316
+ QString field;
2317
+
2318
+ DomProperty *db = properties.value(QLatin1String("database"), 0);
2319
+ if (db && db->elementStringList()) {
2320
+ QStringList info = db->elementStringList()->elementString();
2321
+ connection = info.size() > 0 ? info.at(0) : QString();
2322
+ table = info.size() > 1 ? info.at(1) : QString();
2323
+ field = info.size() > 2 ? info.at(2) : QString();
2324
+ }
2325
+
2326
+ if (table.isEmpty() || connection.isEmpty()) {
2327
+ fprintf(stderr, "invalid database connection\n");
2328
+ return;
2329
+ }
2330
+
2331
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
2332
+
2333
+ m_output << m_option.indent << "if !" << varName << ".sqlCursor.nil?\n";
2334
+
2335
+ m_output << m_option.indent << m_option.indent << varName << ".setSqlCursor(";
2336
+
2337
+ if (connection == QLatin1String("(default)")) {
2338
+ m_output << "Qt3::SqlCursor.new(" << fixString(table, m_option.indent) << "), false, true)\n";
2339
+ } else {
2340
+ m_output << "Qt3::SqlCursor.new(" << fixString(table, m_option.indent) << ", true, " << connection << "Connection" << "), false, true)\n";
2341
+ }
2342
+ m_output << m_option.indent << m_option.indent << varName << ".refresh(Qt3::DataTable::RefreshAll)\n";
2343
+ m_output << m_option.indent << "end\n";
2344
+ }
2345
+
2346
+ void WriteInitialization::initializeQ3SqlDataBrowser(DomWidget *w)
2347
+ {
2348
+ QHash<QString, DomProperty*> properties = propertyMap(w->elementProperty());
2349
+
2350
+ DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
2351
+ if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
2352
+ return;
2353
+
2354
+ QString connection;
2355
+ QString table;
2356
+ QString field;
2357
+
2358
+ DomProperty *db = properties.value(QLatin1String("database"), 0);
2359
+ if (db && db->elementStringList()) {
2360
+ QStringList info = db->elementStringList()->elementString();
2361
+ connection = info.size() > 0 ? info.at(0) : QString();
2362
+ table = info.size() > 1 ? info.at(1) : QString();
2363
+ field = info.size() > 2 ? info.at(2) : QString();
2364
+ }
2365
+
2366
+ if (table.isEmpty() || connection.isEmpty()) {
2367
+ fprintf(stderr, "invalid database connection\n");
2368
+ return;
2369
+ }
2370
+
2371
+ QString varName = toRubyIdentifier(m_driver->findOrInsertWidget(w));
2372
+
2373
+ m_output << m_option.indent << "if !" << varName << ".sqlCursor.nil?\n";
2374
+
2375
+ m_output << m_option.indent << m_option.indent << varName << ".setSqlCursor(";
2376
+
2377
+ if (connection == QLatin1String("(default)")) {
2378
+ m_output << "Qt::SqlCursor.new(" << fixString(table, m_option.indent) << "), true)\n";
2379
+ } else {
2380
+ m_output << "Qt::SqlCursor.new(" << fixString(table, m_option.indent) << ", true, " << connection << "Connection" << "), false, true)\n";
2381
+ }
2382
+ m_output << m_option.indent << m_option.indent << varName << ".refresh\n";
2383
+ m_output << m_option.indent << "end\n";
2384
+ }
2385
+
2386
+ void WriteInitialization::initializeMenu(DomWidget *w, const QString &/*parentWidget*/)
2387
+ {
2388
+ const QString menuName = m_driver->findOrInsertWidget(w);
2389
+ const QString menuAction = menuName + QLatin1String("Action");
2390
+
2391
+ const DomAction *action = m_driver->actionByName(menuAction);
2392
+ if (action && action->hasAttributeMenu()) {
2393
+ m_output << m_option.indent << menuAction << " = " << menuName << ".menuAction\n";
2394
+ }
2395
+ }
2396
+
2397
+ QString WriteInitialization::trCall(DomString *str) const
2398
+ {
2399
+ return trCall(toString(str), str->attributeComment());
2400
+ }
2401
+
2402
+ bool WriteInitialization::isValidObject(const QString &name) const
2403
+ {
2404
+ return m_registeredWidgets.contains(name)
2405
+ || m_registeredActions.contains(name);
2406
+ }
2407
+
2408
+ QString WriteInitialization::findDeclaration(const QString &name)
2409
+ {
2410
+ QString normalized = Driver::normalizedName(name);
2411
+
2412
+ if (DomWidget *widget = m_driver->widgetByName(normalized))
2413
+ return m_driver->findOrInsertWidget(widget);
2414
+ else if (DomAction *action = m_driver->actionByName(normalized))
2415
+ return m_driver->findOrInsertAction(action);
2416
+
2417
+ return QString();
2418
+ }
2419
+
2420
+ void WriteInitialization::acceptConnection(DomConnection *connection)
2421
+ {
2422
+ QString sender = findDeclaration(connection->elementSender());
2423
+ sender = sender.mid(0, 1).toLower() + sender.mid(1);
2424
+
2425
+ if (sender != m_mainWidget) {
2426
+ sender = toRubyIdentifier(sender);
2427
+ }
2428
+
2429
+ QString receiver = findDeclaration(connection->elementReceiver());
2430
+ receiver = receiver.mid(0, 1).toLower() + receiver.mid(1);
2431
+ if (receiver != m_mainWidget) {
2432
+ receiver = toRubyIdentifier(receiver);
2433
+ }
2434
+
2435
+ if (sender.isEmpty() || receiver.isEmpty())
2436
+ return;
2437
+
2438
+ m_output << m_option.indent << "Qt::Object.connect("
2439
+ << sender
2440
+ << ", "
2441
+ << "SIGNAL('" << connection->elementSignal() << "')"
2442
+ << ", "
2443
+ << receiver
2444
+ << ", "
2445
+ << "SLOT('" << connection->elementSlot() << "')"
2446
+ << ")\n";
2447
+ }
2448
+
2449
+ DomImage *WriteInitialization::findImage(const QString &name) const
2450
+ {
2451
+ return m_registeredImages.value(name);
2452
+ }
2453
+
2454
+ DomWidget *WriteInitialization::findWidget(const QString &widgetClass)
2455
+ {
2456
+ for (int i = m_widgetChain.count() - 1; i >= 0; --i) {
2457
+ DomWidget *widget = m_widgetChain.at(i);
2458
+
2459
+ if (widget && m_uic->customWidgetsInfo()->extends(widget->attributeClass(), widgetClass))
2460
+ return widget;
2461
+ }
2462
+
2463
+ return 0;
2464
+ }
2465
+
2466
+ void WriteInitialization::acceptImage(DomImage *image)
2467
+ {
2468
+ if (!image->hasAttributeName())
2469
+ return;
2470
+
2471
+ m_registeredImages.insert(image->attributeName(), image);
2472
+ }
2473
+
2474
+ } // namespace Ruby
2475
+
2476
+ #if defined(QT_END_NAMESPACE)
2477
+ QT_END_NAMESPACE
2478
+ #endif