summaryrefslogtreecommitdiff
path: root/src/designer
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-09-13 20:57:01 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-09-13 20:57:01 +0200
commit7f9aac1d910101267c95a75985a71719682e4ad6 (patch)
treeab50a2d005bc0921f68dbce36416848a437c3c0d /src/designer
parent4b2d6747b51137fd2fbff83c0232d155552d6332 (diff)
parent650dc4fc2856339805a80e3170f4de6ce1003588 (diff)
downloadqttools-7f9aac1d910101267c95a75985a71719682e4ad6.tar.gz
Merge remote-tracking branch 'origin/refactor' into master
Conflicts: src/assistant/help/help.pro src/designer/src/components/formeditor/formwindow.cpp src/designer/src/components/formeditor/formwindow_dnditem.cpp src/designer/src/components/formeditor/layout_propertysheet.cpp src/designer/src/components/formeditor/qdesigner_resource.cpp src/designer/src/components/lib/lib.pro src/designer/src/components/signalsloteditor/signalsloteditor.cpp src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp src/designer/src/components/widgetbox/widgetbox_dnditem.cpp src/designer/src/components/widgetbox/widgetboxtreewidget.cpp src/designer/src/lib/lib.pro src/designer/src/lib/shared/qdesigner_formbuilder.cpp src/designer/src/lib/shared/qdesigner_propertysheet.cpp src/designer/src/lib/shared/shared.pri src/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro src/linguist/lupdate/qdeclarative.cpp src/linguist/shared/profileevaluator.cpp src/linguist/shared/qph.cpp src/linguist/shared/ts.cpp src/qtconfig/mainwindow.cpp src/shared/qtgradienteditor/qtcolorline.cpp src/shared/qtgradienteditor/qtgradientwidget.cpp sync.profile Change-Id: I53f0ce4efae4179257cbf3aab87e1af12c3aa4ff
Diffstat (limited to 'src/designer')
-rw-r--r--src/designer/data/generate_impl.xsl2
-rw-r--r--src/designer/src/components/buddyeditor/buddyeditor.cpp8
-rw-r--r--src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp2
-rw-r--r--src/designer/src/components/buddyeditor/buddyeditor_tool.cpp2
-rw-r--r--src/designer/src/components/formeditor/default_actionprovider.cpp4
-rw-r--r--src/designer/src/components/formeditor/default_actionprovider.h6
-rw-r--r--src/designer/src/components/formeditor/default_container.h10
-rw-r--r--src/designer/src/components/formeditor/deviceprofiledialog.cpp8
-rw-r--r--src/designer/src/components/formeditor/deviceprofiledialog.h2
-rw-r--r--src/designer/src/components/formeditor/dpi_chooser.cpp14
-rw-r--r--src/designer/src/components/formeditor/dpi_chooser.h2
-rw-r--r--src/designer/src/components/formeditor/embeddedoptionspage.cpp18
-rw-r--r--src/designer/src/components/formeditor/embeddedoptionspage.h2
-rw-r--r--src/designer/src/components/formeditor/formeditor_optionspage.cpp8
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp30
-rw-r--r--src/designer/src/components/formeditor/formwindow_dnditem.cpp3
-rw-r--r--src/designer/src/components/formeditor/formwindow_widgetstack.cpp8
-rw-r--r--src/designer/src/components/formeditor/formwindow_widgetstack.h2
-rw-r--r--src/designer/src/components/formeditor/formwindowmanager.cpp18
-rw-r--r--src/designer/src/components/formeditor/formwindowsettings.cpp2
-rw-r--r--src/designer/src/components/formeditor/formwindowsettings.h2
-rw-r--r--src/designer/src/components/formeditor/itemview_propertysheet.cpp4
-rw-r--r--src/designer/src/components/formeditor/itemview_propertysheet.h4
-rw-r--r--src/designer/src/components/formeditor/layout_propertysheet.cpp2
-rw-r--r--src/designer/src/components/formeditor/layout_propertysheet.h2
-rw-r--r--src/designer/src/components/formeditor/line_propertysheet.cpp2
-rw-r--r--src/designer/src/components/formeditor/previewactiongroup.cpp2
-rw-r--r--src/designer/src/components/formeditor/previewactiongroup.h2
-rw-r--r--src/designer/src/components/formeditor/qdesigner_resource.cpp43
-rw-r--r--src/designer/src/components/formeditor/qdesignerundostack.cpp4
-rw-r--r--src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp2
-rw-r--r--src/designer/src/components/formeditor/qmainwindow_container.cpp10
-rw-r--r--src/designer/src/components/formeditor/qmainwindow_container.h2
-rw-r--r--src/designer/src/components/formeditor/qmdiarea_container.cpp6
-rw-r--r--src/designer/src/components/formeditor/qmdiarea_container.h4
-rw-r--r--src/designer/src/components/formeditor/qwizard_container.cpp4
-rw-r--r--src/designer/src/components/formeditor/qwizard_container.h4
-rw-r--r--src/designer/src/components/formeditor/qworkspace_container.cpp2
-rw-r--r--src/designer/src/components/formeditor/qworkspace_container.h2
-rw-r--r--src/designer/src/components/formeditor/spacer_propertysheet.cpp2
-rw-r--r--src/designer/src/components/formeditor/templateoptionspage.h2
-rw-r--r--src/designer/src/components/formeditor/tool_widgeteditor.cpp4
-rw-r--r--src/designer/src/components/formeditor/widgetselection.cpp14
-rw-r--r--src/designer/src/components/lib/lib.pro38
-rw-r--r--src/designer/src/components/objectinspector/objectinspector.cpp16
-rw-r--r--src/designer/src/components/objectinspector/objectinspectormodel.cpp10
-rw-r--r--src/designer/src/components/objectinspector/objectinspectormodel_p.h4
-rw-r--r--src/designer/src/components/propertyeditor/brushpropertymanager.h2
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.cpp20
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.h2
-rw-r--r--src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp2
-rw-r--r--src/designer/src/components/propertyeditor/newdynamicpropertydialog.h2
-rw-r--r--src/designer/src/components/propertyeditor/paletteeditor.cpp6
-rw-r--r--src/designer/src/components/propertyeditor/paletteeditor.h2
-rw-r--r--src/designer/src/components/propertyeditor/paletteeditorbutton.h2
-rw-r--r--src/designer/src/components/propertyeditor/previewframe.cpp4
-rw-r--r--src/designer/src/components/propertyeditor/previewframe.h2
-rw-r--r--src/designer/src/components/propertyeditor/propertyeditor.cpp22
-rw-r--r--src/designer/src/components/propertyeditor/stringlisteditor.cpp2
-rw-r--r--src/designer/src/components/propertyeditor/stringlisteditorbutton.h2
-rw-r--r--src/designer/src/components/signalsloteditor/connectdialog.cpp2
-rw-r--r--src/designer/src/components/signalsloteditor/connectdialog_p.h2
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditor.cpp6
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp2
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp2
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp32
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditorwindow.h2
-rw-r--r--src/designer/src/components/tabordereditor/tabordereditor.cpp4
-rw-r--r--src/designer/src/components/tabordereditor/tabordereditor.h2
-rw-r--r--src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp2
-rw-r--r--src/designer/src/components/tabordereditor/tabordereditor_tool.cpp2
-rw-r--r--src/designer/src/components/taskmenu/button_taskmenu.cpp16
-rw-r--r--src/designer/src/components/taskmenu/button_taskmenu.h6
-rw-r--r--src/designer/src/components/taskmenu/combobox_taskmenu.cpp10
-rw-r--r--src/designer/src/components/taskmenu/combobox_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp20
-rw-r--r--src/designer/src/components/taskmenu/groupbox_taskmenu.cpp6
-rw-r--r--src/designer/src/components/taskmenu/groupbox_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/inplace_widget_helper.cpp6
-rw-r--r--src/designer/src/components/taskmenu/itemlisteditor.cpp2
-rw-r--r--src/designer/src/components/taskmenu/itemlisteditor.h2
-rw-r--r--src/designer/src/components/taskmenu/label_taskmenu.cpp6
-rw-r--r--src/designer/src/components/taskmenu/label_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/layouttaskmenu.cpp2
-rw-r--r--src/designer/src/components/taskmenu/lineedit_taskmenu.cpp6
-rw-r--r--src/designer/src/components/taskmenu/lineedit_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/listwidget_taskmenu.cpp8
-rw-r--r--src/designer/src/components/taskmenu/listwidget_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/listwidgeteditor.cpp6
-rw-r--r--src/designer/src/components/taskmenu/listwidgeteditor.h2
-rw-r--r--src/designer/src/components/taskmenu/menutaskmenu.cpp2
-rw-r--r--src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp10
-rw-r--r--src/designer/src/components/taskmenu/tablewidget_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/tablewidgeteditor.h2
-rw-r--r--src/designer/src/components/taskmenu/textedit_taskmenu.cpp2
-rw-r--r--src/designer/src/components/taskmenu/textedit_taskmenu.h4
-rw-r--r--src/designer/src/components/taskmenu/toolbar_taskmenu.cpp4
-rw-r--r--src/designer/src/components/taskmenu/toolbar_taskmenu.h4
-rw-r--r--src/designer/src/components/taskmenu/treewidget_taskmenu.cpp8
-rw-r--r--src/designer/src/components/taskmenu/treewidget_taskmenu.h2
-rw-r--r--src/designer/src/components/taskmenu/treewidgeteditor.cpp4
-rw-r--r--src/designer/src/components/taskmenu/treewidgeteditor.h2
-rw-r--r--src/designer/src/components/widgetbox/widgetbox.cpp8
-rw-r--r--src/designer/src/components/widgetbox/widgetbox_dnditem.cpp4
-rw-r--r--src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp10
-rw-r--r--src/designer/src/components/widgetbox/widgetboxcategorylistview.h2
-rw-r--r--src/designer/src/components/widgetbox/widgetboxtreewidget.cpp12
-rw-r--r--src/designer/src/components/widgetbox/widgetboxtreewidget.h4
-rw-r--r--src/designer/src/designer/appfontdialog.cpp18
-rw-r--r--src/designer/src/designer/appfontdialog.h4
-rw-r--r--src/designer/src/designer/designer.pro2
-rw-r--r--src/designer/src/designer/mainwindow.cpp14
-rw-r--r--src/designer/src/designer/mainwindow.h4
-rw-r--r--src/designer/src/designer/newform.cpp16
-rw-r--r--src/designer/src/designer/newform.h2
-rw-r--r--src/designer/src/designer/preferencesdialog.cpp4
-rw-r--r--src/designer/src/designer/preferencesdialog.h2
-rw-r--r--src/designer/src/designer/qdesigner.cpp6
-rw-r--r--src/designer/src/designer/qdesigner.h2
-rw-r--r--src/designer/src/designer/qdesigner_actions.cpp24
-rw-r--r--src/designer/src/designer/qdesigner_actions.h2
-rw-r--r--src/designer/src/designer/qdesigner_appearanceoptions.h2
-rw-r--r--src/designer/src/designer/qdesigner_formwindow.cpp12
-rw-r--r--src/designer/src/designer/qdesigner_formwindow.h2
-rw-r--r--src/designer/src/designer/qdesigner_pch.h6
-rw-r--r--src/designer/src/designer/qdesigner_settings.cpp6
-rw-r--r--src/designer/src/designer/qdesigner_toolwindow.cpp2
-rw-r--r--src/designer/src/designer/qdesigner_toolwindow.h2
-rw-r--r--src/designer/src/designer/qdesigner_workbench.cpp22
-rw-r--r--src/designer/src/designer/saveformastemplate.cpp6
-rw-r--r--src/designer/src/designer/versiondialog.cpp10
-rw-r--r--src/designer/src/designer/versiondialog.h2
-rw-r--r--src/designer/src/lib/extension/default_extensionfactory.cpp2
-rw-r--r--src/designer/src/lib/extension/default_extensionfactory.h2
-rw-r--r--src/designer/src/lib/extension/qextensionmanager.h2
-rw-r--r--src/designer/src/lib/lib.pro65
-rw-r--r--src/designer/src/lib/lib_pch.h6
-rw-r--r--src/designer/src/lib/sdk/abstractactioneditor.h2
-rw-r--r--src/designer/src/lib/sdk/abstractdialoggui_p.h4
-rw-r--r--src/designer/src/lib/sdk/abstractformeditor.cpp2
-rw-r--r--src/designer/src/lib/sdk/abstractformwindow.cpp16
-rw-r--r--src/designer/src/lib/sdk/abstractformwindow.h2
-rw-r--r--src/designer/src/lib/sdk/abstractnewformwidget.h2
-rw-r--r--src/designer/src/lib/sdk/abstractobjectinspector.h2
-rw-r--r--src/designer/src/lib/sdk/abstractpropertyeditor.h2
-rw-r--r--src/designer/src/lib/sdk/abstractresourcebrowser.h2
-rw-r--r--src/designer/src/lib/sdk/abstractwidgetbox.h4
-rw-r--r--src/designer/src/lib/shared/actioneditor.cpp24
-rw-r--r--src/designer/src/lib/shared/actionprovider_p.h2
-rw-r--r--src/designer/src/lib/shared/actionrepository.cpp12
-rw-r--r--src/designer/src/lib/shared/actionrepository_p.h10
-rw-r--r--src/designer/src/lib/shared/codedialog.cpp20
-rw-r--r--src/designer/src/lib/shared/codedialog_p.h2
-rw-r--r--src/designer/src/lib/shared/connectionedit.cpp6
-rw-r--r--src/designer/src/lib/shared/connectionedit_p.h4
-rw-r--r--src/designer/src/lib/shared/deviceprofile.cpp10
-rw-r--r--src/designer/src/lib/shared/dialoggui.cpp4
-rw-r--r--src/designer/src/lib/shared/filterwidget.cpp12
-rw-r--r--src/designer/src/lib/shared/filterwidget_p.h6
-rw-r--r--src/designer/src/lib/shared/formlayoutmenu.cpp12
-rw-r--r--src/designer/src/lib/shared/formwindowbase.cpp24
-rw-r--r--src/designer/src/lib/shared/grid.cpp2
-rw-r--r--src/designer/src/lib/shared/gridpanel_p.h2
-rw-r--r--src/designer/src/lib/shared/htmlhighlighter.cpp3
-rw-r--r--src/designer/src/lib/shared/htmlhighlighter_p.h2
-rw-r--r--src/designer/src/lib/shared/iconloader.cpp2
-rw-r--r--src/designer/src/lib/shared/iconselector.cpp26
-rw-r--r--src/designer/src/lib/shared/iconselector_p.h4
-rw-r--r--src/designer/src/lib/shared/invisible_widget_p.h2
-rw-r--r--src/designer/src/lib/shared/layout.cpp20
-rw-r--r--src/designer/src/lib/shared/layout_p.h6
-rw-r--r--src/designer/src/lib/shared/layoutinfo.cpp6
-rw-r--r--src/designer/src/lib/shared/metadatabase.cpp2
-rw-r--r--src/designer/src/lib/shared/morphmenu.cpp36
-rw-r--r--src/designer/src/lib/shared/newactiondialog.cpp2
-rw-r--r--src/designer/src/lib/shared/newactiondialog_p.h2
-rw-r--r--src/designer/src/lib/shared/newformwidget.cpp6
-rw-r--r--src/designer/src/lib/shared/newformwidget_p.h2
-rw-r--r--src/designer/src/lib/shared/orderdialog.cpp2
-rw-r--r--src/designer/src/lib/shared/orderdialog_p.h2
-rw-r--r--src/designer/src/lib/shared/plaintexteditor.cpp8
-rw-r--r--src/designer/src/lib/shared/plaintexteditor_p.h2
-rw-r--r--src/designer/src/lib/shared/plugindialog.cpp6
-rw-r--r--src/designer/src/lib/shared/previewconfigurationwidget.cpp8
-rw-r--r--src/designer/src/lib/shared/previewconfigurationwidget_p.h2
-rw-r--r--src/designer/src/lib/shared/previewmanager.cpp20
-rw-r--r--src/designer/src/lib/shared/promotionmodel.cpp2
-rw-r--r--src/designer/src/lib/shared/promotionmodel_p.h2
-rw-r--r--src/designer/src/lib/shared/promotiontaskmenu.cpp6
-rw-r--r--src/designer/src/lib/shared/propertylineedit.cpp2
-rw-r--r--src/designer/src/lib/shared/propertylineedit_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_command.cpp32
-rw-r--r--src/designer/src/lib/shared/qdesigner_command2.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_command2_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_command_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_dnditem.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_dockwidget.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_dockwidget_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_formbuilder.cpp20
-rw-r--r--src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_membersheet.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_menu.cpp13
-rw-r--r--src/designer/src/lib/shared/qdesigner_menu_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_menubar.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_menubar_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_promotiondialog.cpp32
-rw-r--r--src/designer/src/lib/shared/qdesigner_promotiondialog_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertycommand.cpp12
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertyeditor.cpp6
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertysheet.cpp20
-rw-r--r--src/designer/src/lib/shared/qdesigner_stackedbox.cpp8
-rw-r--r--src/designer/src/lib/shared/qdesigner_tabwidget.cpp13
-rw-r--r--src/designer/src/lib/shared/qdesigner_tabwidget_p.h2
-rw-r--r--src/designer/src/lib/shared/qdesigner_taskmenu.cpp20
-rw-r--r--src/designer/src/lib/shared/qdesigner_toolbar.cpp13
-rw-r--r--src/designer/src/lib/shared/qdesigner_toolbar_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_toolbox.cpp10
-rw-r--r--src/designer/src/lib/shared/qdesigner_utils.cpp12
-rw-r--r--src/designer/src/lib/shared/qdesigner_utils_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_widget.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_widget_p.h4
-rw-r--r--src/designer/src/lib/shared/qdesigner_widgetitem.cpp10
-rw-r--r--src/designer/src/lib/shared/qdesigner_widgetitem_p.h2
-rw-r--r--src/designer/src/lib/shared/qlayout_widget.cpp8
-rw-r--r--src/designer/src/lib/shared/qlayout_widget_p.h4
-rw-r--r--src/designer/src/lib/shared/qsimpleresource.cpp6
-rw-r--r--src/designer/src/lib/shared/qtresourceeditordialog.cpp12
-rw-r--r--src/designer/src/lib/shared/qtresourceeditordialog_p.h2
-rw-r--r--src/designer/src/lib/shared/qtresourceview.cpp24
-rw-r--r--src/designer/src/lib/shared/qtresourceview_p.h4
-rw-r--r--src/designer/src/lib/shared/richtexteditor.cpp24
-rw-r--r--src/designer/src/lib/shared/richtexteditor_p.h4
-rw-r--r--src/designer/src/lib/shared/scriptdialog.cpp10
-rw-r--r--src/designer/src/lib/shared/scriptdialog_p.h2
-rw-r--r--src/designer/src/lib/shared/scripterrordialog.cpp8
-rw-r--r--src/designer/src/lib/shared/scripterrordialog_p.h2
-rw-r--r--src/designer/src/lib/shared/shared.pri2
-rw-r--r--src/designer/src/lib/shared/sheet_delegate.cpp4
-rw-r--r--src/designer/src/lib/shared/sheet_delegate_p.h4
-rw-r--r--src/designer/src/lib/shared/signalslotdialog.cpp10
-rw-r--r--src/designer/src/lib/shared/signalslotdialog_p.h4
-rw-r--r--src/designer/src/lib/shared/spacer_widget.cpp2
-rw-r--r--src/designer/src/lib/shared/spacer_widget_p.h4
-rw-r--r--src/designer/src/lib/shared/stylesheeteditor.cpp18
-rw-r--r--src/designer/src/lib/shared/stylesheeteditor_p.h6
-rw-r--r--src/designer/src/lib/shared/textpropertyeditor.cpp6
-rw-r--r--src/designer/src/lib/shared/textpropertyeditor_p.h2
-rw-r--r--src/designer/src/lib/shared/widgetdatabase_p.h2
-rw-r--r--src/designer/src/lib/shared/widgetfactory.cpp18
-rw-r--r--src/designer/src/lib/shared/zoomwidget.cpp12
-rw-r--r--src/designer/src/lib/shared/zoomwidget_p.h4
-rw-r--r--src/designer/src/lib/uilib/abstractformbuilder.cpp3154
-rw-r--r--src/designer/src/lib/uilib/abstractformbuilder.h283
-rw-r--r--src/designer/src/lib/uilib/container.h82
-rw-r--r--src/designer/src/lib/uilib/container.qdoc199
-rw-r--r--src/designer/src/lib/uilib/customwidget.h101
-rw-r--r--src/designer/src/lib/uilib/customwidget.qdoc295
-rw-r--r--src/designer/src/lib/uilib/extension.h109
-rw-r--r--src/designer/src/lib/uilib/formbuilder.cpp550
-rw-r--r--src/designer/src/lib/uilib/formbuilder.h110
-rw-r--r--src/designer/src/lib/uilib/formbuilderextra.cpp533
-rw-r--r--src/designer/src/lib/uilib/formbuilderextra_p.h276
-rw-r--r--src/designer/src/lib/uilib/formscriptrunner.cpp208
-rw-r--r--src/designer/src/lib/uilib/formscriptrunner_p.h120
-rw-r--r--src/designer/src/lib/uilib/properties.cpp681
-rw-r--r--src/designer/src/lib/uilib/properties_p.h176
-rw-r--r--src/designer/src/lib/uilib/qdesignerexportwidget.h66
-rw-r--r--src/designer/src/lib/uilib/resourcebuilder.cpp180
-rw-r--r--src/designer/src/lib/uilib/resourcebuilder_p.h104
-rw-r--r--src/designer/src/lib/uilib/textbuilder.cpp84
-rw-r--r--src/designer/src/lib/uilib/textbuilder_p.h93
-rw-r--r--src/designer/src/lib/uilib/ui4.cpp8907
-rw-r--r--src/designer/src/lib/uilib/ui4_p.h3603
-rw-r--r--src/designer/src/lib/uilib/uilib.pri34
-rw-r--r--src/designer/src/lib/uilib/uilib_global.h64
-rw-r--r--src/designer/src/lib/uilib/widgets.table148
-rw-r--r--src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp2
-rw-r--r--src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp6
-rw-r--r--src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp4
-rw-r--r--src/designer/src/plugins/activeqt/qdesigneraxwidget.h2
-rw-r--r--src/designer/src/plugins/phononwidgets/phononwidgets.pro2
-rw-r--r--src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp12
-rw-r--r--src/designer/src/plugins/qwebview/qwebview.pro2
-rw-r--r--src/designer/src/plugins/tools/view3d/view3d.h2
-rw-r--r--src/designer/src/plugins/tools/view3d/view3d_plugin.cpp2
-rw-r--r--src/designer/src/plugins/tools/view3d/view3d_tool.cpp2
-rw-r--r--src/designer/src/src.pro1
-rw-r--r--src/designer/src/uitools/quiloader.cpp954
-rw-r--r--src/designer/src/uitools/quiloader.h105
-rw-r--r--src/designer/src/uitools/quiloader_p.h109
-rw-r--r--src/designer/src/uitools/uitools.pro50
293 files changed, 22260 insertions, 936 deletions
diff --git a/src/designer/data/generate_impl.xsl b/src/designer/data/generate_impl.xsl
index 327faab50..746b9e806 100644
--- a/src/designer/data/generate_impl.xsl
+++ b/src/designer/data/generate_impl.xsl
@@ -942,7 +942,7 @@
**
****************************************************************************/
</xsl:text>
- <xsl:text>#include "ui4_p.h"&endl;</xsl:text>
+ <xsl:text>#include "private/ui4_p.h"&endl;</xsl:text>
<xsl:text>&endl;</xsl:text>
<xsl:text>&endl;</xsl:text>
<xsl:text>QT_BEGIN_NAMESPACE&endl;</xsl:text>
diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp
index d64d66574..ed6cc3e42 100644
--- a/src/designer/src/components/buddyeditor/buddyeditor.cpp
+++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp
@@ -54,10 +54,10 @@
#include <metadatabase_p.h>
#include <QtCore/qdebug.h>
-#include <QtGui/QLabel>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp
index e4e7803e5..64e2a7241 100644
--- a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp
+++ b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include "buddyeditor_plugin.h"
#include "buddyeditor_tool.h"
diff --git a/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp b/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp
index ceb422d12..d7fb60f03 100644
--- a/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp
+++ b/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp
@@ -44,7 +44,7 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/default_actionprovider.cpp b/src/designer/src/components/formeditor/default_actionprovider.cpp
index ce66548be..c31a8dfba 100644
--- a/src/designer/src/components/formeditor/default_actionprovider.cpp
+++ b/src/designer/src/components/formeditor/default_actionprovider.cpp
@@ -43,8 +43,8 @@
#include "invisible_widget_p.h"
#include "qdesigner_toolbar_p.h"
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
#include <QtCore/QRect>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/formeditor/default_actionprovider.h b/src/designer/src/components/formeditor/default_actionprovider.h
index 7b9ff3e26..2f136d83f 100644
--- a/src/designer/src/components/formeditor/default_actionprovider.h
+++ b/src/designer/src/components/formeditor/default_actionprovider.h
@@ -46,9 +46,9 @@
#include "actionprovider_p.h"
#include <extensionfactory_p.h>
-#include <QtGui/QMenu>
-#include <QtGui/QMenuBar>
-#include <QtGui/QToolBar>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QToolBar>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/default_container.h b/src/designer/src/components/formeditor/default_container.h
index 2771e0035..2b9774efb 100644
--- a/src/designer/src/components/formeditor/default_container.h
+++ b/src/designer/src/components/formeditor/default_container.h
@@ -46,11 +46,11 @@
#include <QtDesigner/extension.h>
#include <extensionfactory_p.h>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QTabWidget>
-#include <QtGui/QToolBox>
-#include <QtGui/QScrollArea>
-#include <QtGui/QDockWidget>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QDockWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.cpp b/src/designer/src/components/formeditor/deviceprofiledialog.cpp
index 7d170b1c1..ecd81b6bd 100644
--- a/src/designer/src/components/formeditor/deviceprofiledialog.cpp
+++ b/src/designer/src/components/formeditor/deviceprofiledialog.cpp
@@ -45,10 +45,10 @@
#include <abstractdialoggui_p.h>
#include <deviceprofile_p.h>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QStyleFactory>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QStyleFactory>
#include <QtGui/QFontDatabase>
#include <QtCore/QFileInfo>
diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.h b/src/designer/src/components/formeditor/deviceprofiledialog.h
index f547d2421..bdd22cf4c 100644
--- a/src/designer/src/components/formeditor/deviceprofiledialog.h
+++ b/src/designer/src/components/formeditor/deviceprofiledialog.h
@@ -53,7 +53,7 @@
#ifndef SYSTEMSETTINGSDIALOG_H
#define SYSTEMSETTINGSDIALOG_H
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/dpi_chooser.cpp b/src/designer/src/components/formeditor/dpi_chooser.cpp
index 8a039d0a2..74d397d5c 100644
--- a/src/designer/src/components/formeditor/dpi_chooser.cpp
+++ b/src/designer/src/components/formeditor/dpi_chooser.cpp
@@ -43,13 +43,13 @@
#include <deviceprofile_p.h>
-#include <QtGui/QComboBox>
-#include <QtGui/QSpinBox>
-#include <QtGui/QLabel>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QCheckBox>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QSpinBox>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QCheckBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/dpi_chooser.h b/src/designer/src/components/formeditor/dpi_chooser.h
index 306638c19..2ba7e556d 100644
--- a/src/designer/src/components/formeditor/dpi_chooser.h
+++ b/src/designer/src/components/formeditor/dpi_chooser.h
@@ -53,7 +53,7 @@
#ifndef DPICHOOSER_H
#define DPICHOOSER_H
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
index d85747c04..b13bfc9c6 100644
--- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp
+++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
@@ -55,15 +55,15 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerFormWindowManagerInterface>
-#include <QtGui/QLabel>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QApplication>
-#include <QtGui/QComboBox>
-#include <QtGui/QToolButton>
-#include <QtGui/QMessageBox>
-#include <QtGui/QLabel>
-#include <QtGui/QGroupBox>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QGroupBox>
#include <QtCore/QSet>
diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.h b/src/designer/src/components/formeditor/embeddedoptionspage.h
index 966a474d4..3fc7a4d85 100644
--- a/src/designer/src/components/formeditor/embeddedoptionspage.h
+++ b/src/designer/src/components/formeditor/embeddedoptionspage.h
@@ -44,7 +44,7 @@
#include <QtDesigner/QDesignerOptionsPageInterface>
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/formeditor_optionspage.cpp b/src/designer/src/components/formeditor/formeditor_optionspage.cpp
index f3b8da4b0..b4b5d8999 100644
--- a/src/designer/src/components/formeditor/formeditor_optionspage.cpp
+++ b/src/designer/src/components/formeditor/formeditor_optionspage.cpp
@@ -55,10 +55,10 @@
#include <QtCore/QString>
#include <QtCore/QCoreApplication>
-#include <QtGui/QGroupBox>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QComboBox>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QComboBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index 1d9c01cf6..a651e7880 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -69,7 +69,7 @@
#include <qdesigner_objectinspector_p.h>
#include <connectionedit_p.h>
#include <actionprovider_p.h>
-
+#include <private/ui4_p.h>
#include <deviceprofile_p.h>
#include <shared_settings_p.h>
#include <grid_p.h>
@@ -89,22 +89,22 @@
#include <QtCore/QBuffer>
#include <QtCore/QTimer>
#include <QtCore/QXmlStreamReader>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
#include <QtGui/QClipboard>
-#include <QtGui/QUndoGroup>
-#include <QtGui/QScrollArea>
-#include <QtGui/QRubberBand>
-#include <QtGui/QApplication>
-#include <QtGui/QSplitter>
+#include <QtWidgets/QUndoGroup>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QRubberBand>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QSplitter>
#include <QtGui/QPainter>
-#include <QtGui/QGroupBox>
-#include <QtGui/QDockWidget>
-#include <QtGui/QToolBox>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QTabWidget>
-#include <QtGui/QButtonGroup>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QButtonGroup>
Q_DECLARE_METATYPE(QWidget*)
diff --git a/src/designer/src/components/formeditor/formwindow_dnditem.cpp b/src/designer/src/components/formeditor/formwindow_dnditem.cpp
index 96ce11463..ec508a5ba 100644
--- a/src/designer/src/components/formeditor/formwindow_dnditem.cpp
+++ b/src/designer/src/components/formeditor/formwindow_dnditem.cpp
@@ -42,13 +42,14 @@
#include "formwindow_dnditem.h"
#include "formwindow.h"
+#include <private/ui4_p.h>
#include <qdesigner_resource.h>
#include <qtresourcemodel_p.h>
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/private/ui4_p.h>
-#include <QtGui/QLabel>
+#include <QtWidgets/QLabel>
#include <QtGui/QPixmap>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
index 83ee77559..40f9aae33 100644
--- a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
+++ b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
@@ -42,11 +42,11 @@
#include "formwindow_widgetstack.h"
#include <QtDesigner/QDesignerFormWindowToolInterface>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/qevent.h>
-#include <QtGui/QAction>
-#include <QtGui/QStackedLayout>
-#include <QtGui/QVBoxLayout>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStackedLayout>
+#include <QtWidgets/QVBoxLayout>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.h b/src/designer/src/components/formeditor/formwindow_widgetstack.h
index 389d88fa6..78eb3d21a 100644
--- a/src/designer/src/components/formeditor/formwindow_widgetstack.h
+++ b/src/designer/src/components/formeditor/formwindow_widgetstack.h
@@ -44,7 +44,7 @@
#include "formeditor_global.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp
index c82bbf4e5..3aef59ace 100644
--- a/src/designer/src/components/formeditor/formwindowmanager.cpp
+++ b/src/designer/src/components/formeditor/formwindowmanager.cpp
@@ -73,17 +73,17 @@
#include <QtDesigner/QDesignerWidgetBoxInterface>
#include <QtDesigner/QDesignerIntegrationInterface>
-#include <QtGui/QUndoGroup>
-#include <QtGui/QAction>
-#include <QtGui/QSplitter>
+#include <QtWidgets/QUndoGroup>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QSplitter>
#include <QtGui/QMouseEvent>
-#include <QtGui/QApplication>
-#include <QtGui/QSizeGrip>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QSizeGrip>
#include <QtGui/QClipboard>
-#include <QtGui/QMdiArea>
-#include <QtGui/QMdiSubWindow>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QMdiSubWindow>
+#include <QtWidgets/QDesktopWidget>
+#include <QtWidgets/QMessageBox>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp
index 5b3071f2e..a357c797e 100644
--- a/src/designer/src/components/formeditor/formwindowsettings.cpp
+++ b/src/designer/src/components/formeditor/formwindowsettings.cpp
@@ -45,7 +45,7 @@
#include <formwindowbase_p.h>
#include <grid_p.h>
-#include <QtGui/QStyle>
+#include <QtWidgets/QStyle>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/formeditor/formwindowsettings.h b/src/designer/src/components/formeditor/formwindowsettings.h
index 075aed66e..893479ebe 100644
--- a/src/designer/src/components/formeditor/formwindowsettings.h
+++ b/src/designer/src/components/formeditor/formwindowsettings.h
@@ -42,7 +42,7 @@
#ifndef FORMWINDOWSETTINGS_H
#define FORMWINDOWSETTINGS_H
-#include <QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/itemview_propertysheet.cpp b/src/designer/src/components/formeditor/itemview_propertysheet.cpp
index 28d1e30da..31838f39f 100644
--- a/src/designer/src/components/formeditor/itemview_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/itemview_propertysheet.cpp
@@ -43,8 +43,8 @@
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QAbstractItemView>
-#include <QtGui/QHeaderView>
+#include <QtWidgets/QAbstractItemView>
+#include <QtWidgets/QHeaderView>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/itemview_propertysheet.h b/src/designer/src/components/formeditor/itemview_propertysheet.h
index 000a78ee8..8f8eee174 100644
--- a/src/designer/src/components/formeditor/itemview_propertysheet.h
+++ b/src/designer/src/components/formeditor/itemview_propertysheet.h
@@ -45,8 +45,8 @@
#include <qdesigner_propertysheet_p.h>
#include <extensionfactory_p.h>
-#include <QtGui/QTreeView>
-#include <QtGui/QTableView>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QTableView>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/layout_propertysheet.cpp b/src/designer/src/components/formeditor/layout_propertysheet.cpp
index f8803422a..44e2e122c 100644
--- a/src/designer/src/components/formeditor/layout_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/layout_propertysheet.cpp
@@ -51,7 +51,7 @@
#include <QtDesigner/private/ui4_p.h>
#include <QtDesigner/private/formbuilderextra_p.h>
-#include <QtGui/QFormLayout>
+#include <QtWidgets/QFormLayout>
#include <QtCore/QHash>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/formeditor/layout_propertysheet.h b/src/designer/src/components/formeditor/layout_propertysheet.h
index e49db1ec2..b13a76489 100644
--- a/src/designer/src/components/formeditor/layout_propertysheet.h
+++ b/src/designer/src/components/formeditor/layout_propertysheet.h
@@ -45,7 +45,7 @@
#include <qdesigner_propertysheet_p.h>
#include <extensionfactory_p.h>
-#include <QtGui/QLayout>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/line_propertysheet.cpp b/src/designer/src/components/formeditor/line_propertysheet.cpp
index bf9751313..0ba000683 100644
--- a/src/designer/src/components/formeditor/line_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/line_propertysheet.cpp
@@ -45,7 +45,7 @@
// sdk
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QLayout>
+#include <QtWidgets/QLayout>
#include <QtCore/QMetaObject>
#include <QtCore/QMetaProperty>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp
index 5c7a2fb74..85030b863 100644
--- a/src/designer/src/components/formeditor/previewactiongroup.cpp
+++ b/src/designer/src/components/formeditor/previewactiongroup.cpp
@@ -44,7 +44,7 @@
#include <deviceprofile_p.h>
#include <shared_settings_p.h>
-#include <QtGui/QStyleFactory>
+#include <QtWidgets/QStyleFactory>
#include <QtCore/QVariant>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/previewactiongroup.h b/src/designer/src/components/formeditor/previewactiongroup.h
index f3fa3398d..b8c7f9b50 100644
--- a/src/designer/src/components/formeditor/previewactiongroup.h
+++ b/src/designer/src/components/formeditor/previewactiongroup.h
@@ -53,7 +53,7 @@
#ifndef PREVIEWACTIONGROUP_H
#define PREVIEWACTIONGROUP_H
-#include <QtGui/QActionGroup>
+#include <QtWidgets/QActionGroup>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp
index 2b6b13abf..c52cdfd4d 100644
--- a/src/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -74,7 +74,6 @@
#include <qlayout_widget_p.h>
#include <qdesigner_utils_p.h>
-
#include <QtDesigner/private/ui4_p.h>
// sdk
@@ -86,27 +85,27 @@
#include <QtDesigner/QDesignerContainerExtension>
#include <abstractdialoggui_p.h>
-#include <QtGui/QMenu>
-#include <QtGui/QMessageBox>
-#include <QtGui/QLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QTabWidget>
-#include <QtGui/QToolBox>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QToolBar>
-#include <QtGui/QTabBar>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QApplication>
-#include <QtGui/QMainWindow>
-#include <QtGui/QSplitter>
-#include <QtGui/QMdiArea>
-#include <QtGui/QWorkspace>
-#include <QtGui/QMenuBar>
-#include <QtGui/QFileDialog>
-#include <QtGui/QHeaderView>
-#include <QtGui/QWizardPage>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QTabBar>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QSplitter>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QWorkspace>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QWizardPage>
#include <private/qlayoutengine_p.h>
#include <QtCore/QBuffer>
diff --git a/src/designer/src/components/formeditor/qdesignerundostack.cpp b/src/designer/src/components/formeditor/qdesignerundostack.cpp
index c0adb492d..823a66a3b 100644
--- a/src/designer/src/components/formeditor/qdesignerundostack.cpp
+++ b/src/designer/src/components/formeditor/qdesignerundostack.cpp
@@ -41,8 +41,8 @@
#include "qdesignerundostack.h"
-#include <QtGui/QUndoStack>
-#include <QtGui/QUndoCommand>
+#include <QtWidgets/QUndoStack>
+#include <QtWidgets/QUndoCommand>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp
index 6234dd0be..0de0b2715 100644
--- a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp
@@ -46,7 +46,7 @@
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QLayout>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qmainwindow_container.cpp b/src/designer/src/components/formeditor/qmainwindow_container.cpp
index 64475dd97..5ea74348f 100644
--- a/src/designer/src/components/formeditor/qmainwindow_container.cpp
+++ b/src/designer/src/components/formeditor/qmainwindow_container.cpp
@@ -45,11 +45,11 @@
#include <QtCore/qdebug.h>
-#include <QtGui/QLayout>
-#include <QtGui/QMenuBar>
-#include <QtGui/QToolBar>
-#include <QtGui/QStatusBar>
-#include <QtGui/QDockWidget>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QDockWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qmainwindow_container.h b/src/designer/src/components/formeditor/qmainwindow_container.h
index 2b1d18923..44f0413bd 100644
--- a/src/designer/src/components/formeditor/qmainwindow_container.h
+++ b/src/designer/src/components/formeditor/qmainwindow_container.h
@@ -47,7 +47,7 @@
#include <extensionfactory_p.h>
-#include <QtGui/QMainWindow>
+#include <QtWidgets/QMainWindow>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp
index 96875446a..bb83f9ce9 100644
--- a/src/designer/src/components/formeditor/qmdiarea_container.cpp
+++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp
@@ -44,9 +44,9 @@
#include <QtDesigner/QExtensionManager>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QMdiArea>
-#include <QtGui/QMdiSubWindow>
-#include <QtGui/QApplication>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QMdiSubWindow>
+#include <QtWidgets/QApplication>
#include <QtCore/QDebug>
#include <QtCore/QHash>
diff --git a/src/designer/src/components/formeditor/qmdiarea_container.h b/src/designer/src/components/formeditor/qmdiarea_container.h
index f9ace3c62..d7bd49589 100644
--- a/src/designer/src/components/formeditor/qmdiarea_container.h
+++ b/src/designer/src/components/formeditor/qmdiarea_container.h
@@ -48,8 +48,8 @@
#include <qdesigner_propertysheet_p.h>
#include <extensionfactory_p.h>
-#include <QtGui/QMdiArea>
-#include <QtGui/QWorkspace>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QWorkspace>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp
index bdd40426c..facec786e 100644
--- a/src/designer/src/components/formeditor/qwizard_container.cpp
+++ b/src/designer/src/components/formeditor/qwizard_container.cpp
@@ -44,8 +44,8 @@
#include <QtDesigner/QExtensionManager>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QWizard>
-#include <QtGui/QWizardPage>
+#include <QtWidgets/QWizard>
+#include <QtWidgets/QWizardPage>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qwizard_container.h b/src/designer/src/components/formeditor/qwizard_container.h
index 837d45b15..d8c3fb4cc 100644
--- a/src/designer/src/components/formeditor/qwizard_container.h
+++ b/src/designer/src/components/formeditor/qwizard_container.h
@@ -47,8 +47,8 @@
#include <qdesigner_propertysheet_p.h>
#include <extensionfactory_p.h>
-#include <QtGui/QWizard>
-#include <QtGui/QWizardPage>
+#include <QtWidgets/QWizard>
+#include <QtWidgets/QWizardPage>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qworkspace_container.cpp b/src/designer/src/components/formeditor/qworkspace_container.cpp
index 1971cf80a..d3fde23f1 100644
--- a/src/designer/src/components/formeditor/qworkspace_container.cpp
+++ b/src/designer/src/components/formeditor/qworkspace_container.cpp
@@ -42,7 +42,7 @@
#include "qworkspace_container.h"
#include "qmdiarea_container.h"
-#include <QtGui/QWorkspace>
+#include <QtWidgets/QWorkspace>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/qworkspace_container.h b/src/designer/src/components/formeditor/qworkspace_container.h
index 25973a1de..ce5151574 100644
--- a/src/designer/src/components/formeditor/qworkspace_container.h
+++ b/src/designer/src/components/formeditor/qworkspace_container.h
@@ -46,7 +46,7 @@
#include <QtDesigner/QExtensionFactory>
#include <extensionfactory_p.h>
-#include <QtGui/QWorkspace>
+#include <QtWidgets/QWorkspace>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/spacer_propertysheet.cpp b/src/designer/src/components/formeditor/spacer_propertysheet.cpp
index b224501af..d46a5aaa9 100644
--- a/src/designer/src/components/formeditor/spacer_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/spacer_propertysheet.cpp
@@ -46,7 +46,7 @@
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QLayout>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/templateoptionspage.h b/src/designer/src/components/formeditor/templateoptionspage.h
index e834316af..f6270b643 100644
--- a/src/designer/src/components/formeditor/templateoptionspage.h
+++ b/src/designer/src/components/formeditor/templateoptionspage.h
@@ -47,7 +47,7 @@
#include <QtCore/QPointer>
#include <QtCore/QStringList>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/formeditor/tool_widgeteditor.cpp b/src/designer/src/components/formeditor/tool_widgeteditor.cpp
index 1b1389a9a..7dfd6fbee 100644
--- a/src/designer/src/components/formeditor/tool_widgeteditor.cpp
+++ b/src/designer/src/components/formeditor/tool_widgeteditor.cpp
@@ -52,8 +52,8 @@
#include <qdesigner_resource.h>
#include <QtGui/qevent.h>
-#include <QtGui/QAction>
-#include <QtGui/QMainWindow>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMainWindow>
#include <QtGui/QCursor>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/formeditor/widgetselection.cpp b/src/designer/src/components/formeditor/widgetselection.cpp
index 441dcb4c4..045fb414d 100644
--- a/src/designer/src/components/formeditor/widgetselection.cpp
+++ b/src/designer/src/components/formeditor/widgetselection.cpp
@@ -55,14 +55,14 @@
#include <formwindowbase_p.h>
#include <grid_p.h>
-#include <QtGui/QMenu>
-#include <QtGui/QWidget>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QWidget>
#include <QtGui/QMouseEvent>
-#include <QtGui/QStylePainter>
-#include <QtGui/QGridLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QStyleOptionToolButton>
-#include <QtGui/QApplication>
+#include <QtWidgets/QStylePainter>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QStyleOptionToolButton>
+#include <QtWidgets/QApplication>
#include <QtCore/QVariant>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/lib/lib.pro b/src/designer/src/components/lib/lib.pro
index abfcf24ad..4c255119f 100644
--- a/src/designer/src/components/lib/lib.pro
+++ b/src/designer/src/components/lib/lib.pro
@@ -1,24 +1,19 @@
+MODULE = designercomponents
load(qt_module)
TEMPLATE = lib
TARGET = QtDesignerComponents
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-CONFIG += qt depend_prl no_objective_c designer
-QT *= gui-private
-QT *= uilib-private
-win32|mac: CONFIG += debug_and_release
-DESTDIR = $$QT.designer.libs
-!wince*:DLLDESTDIR = $$QT.designer.bins
-QT += designer-private uilib-private
+
+QT += gui-private widgets widgets-private designer designer-private
+
+CONFIG += module
+MODULE_PRI = ../../../../modules/qt_designercomponents.pri
+
+load(qt_module_config)
# QtDesignerComponents uses
DEFINES += QT_STATICPLUGIN
-
-isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.3.0
-} else {
- VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
-}
+DEFINES += QDESIGNER_COMPONENTS_LIBRARY
load(qt_targets)
QMAKE_TARGET_PRODUCT = Designer
@@ -38,14 +33,6 @@ mac:!static:contains(QT_CONFIG, qt_framework) {
SOURCES += qdesigner_components.cpp
-!contains(CONFIG, static) {
- DEFINES += QDESIGNER_COMPONENTS_LIBRARY
- CONFIG += dll
- LIBS += -lQtDesigner
-} else {
- DEFINES += QT_DESIGNER_STATIC
-}
-
INCLUDEPATH += . .. \
$$PWD/../../lib/components \
$$PWD/../../lib/sdk \
@@ -70,10 +57,3 @@ unix|win32-g++* {
QMAKE_PKGCONFIG_REQUIRES = QtCore QtDesigner QtGui QtXml
contains(QT_CONFIG, script): QMAKE_PKGCONFIG_REQUIRES += QtScript
}
-
-target.path=$$[QT_INSTALL_LIBS]
-INSTALLS += target
-win32 {
- dlltarget.path=$$[QT_INSTALL_BINS]
- INSTALLS += dlltarget
-}
diff --git a/src/designer/src/components/objectinspector/objectinspector.cpp b/src/designer/src/components/objectinspector/objectinspector.cpp
index ff6772ba3..91fe6946d 100644
--- a/src/designer/src/components/objectinspector/objectinspector.cpp
+++ b/src/designer/src/components/objectinspector/objectinspector.cpp
@@ -63,15 +63,15 @@
#include <grid_p.h>
// Qt
-#include <QtGui/QApplication>
-#include <QtGui/QHeaderView>
-#include <QtGui/QScrollBar>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QScrollBar>
#include <QtGui/QPainter>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QItemSelectionModel>
-#include <QtGui/QMenu>
-#include <QtGui/QTreeView>
-#include <QtGui/QItemDelegate>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QItemSelectionModel>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QItemDelegate>
#include <QtGui/qevent.h>
#include <QtCore/QVector>
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
index a1cbc1ac9..773160841 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp
+++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
@@ -53,11 +53,11 @@
#include <QtDesigner/QDesignerContainerExtension>
#include <QtDesigner/QDesignerMetaDataBaseInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QLayout>
-#include <QtGui/QAction>
-#include <QtGui/QLayoutItem>
-#include <QtGui/QMenu>
-#include <QtGui/QButtonGroup>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QLayoutItem>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QButtonGroup>
#include <QtCore/QSet>
#include <QtCore/QDebug>
#include <QtCore/QCoreApplication>
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
index 6e1121d73..474e942f3 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h
+++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
@@ -55,8 +55,8 @@
#include <layoutinfo_p.h>
-#include <QtGui/QStandardItemModel>
-#include <QtGui/QIcon>
+#include <QtWidgets/QStandardItemModel>
+#include <QtWidgets/QIcon>
#include <QtCore/QModelIndex>
#include <QtCore/QString>
#include <QtCore/QList>
diff --git a/src/designer/src/components/propertyeditor/brushpropertymanager.h b/src/designer/src/components/propertyeditor/brushpropertymanager.h
index aa50a1166..221e752b5 100644
--- a/src/designer/src/components/propertyeditor/brushpropertymanager.h
+++ b/src/designer/src/components/propertyeditor/brushpropertymanager.h
@@ -44,7 +44,7 @@
#include <QtCore/QMap>
#include <QtGui/QBrush>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
index dfba2feae..8007eac8e 100644
--- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
@@ -56,19 +56,19 @@
#include <iconselector_p.h>
#include <abstractdialoggui_p.h>
-#include <QtGui/QLabel>
-#include <QtGui/QToolButton>
-#include <QtGui/QHBoxLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QHBoxLayout>
#include <QtCore/QFileInfo>
#include <QtGui/QClipboard>
-#include <QtGui/QLineEdit>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QFileDialog>
-#include <QtGui/QAction>
-#include <QtGui/QMenu>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMenu>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
#include <QtCore/QUrl>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.h b/src/designer/src/components/propertyeditor/designerpropertymanager.h
index 58085f9f5..0f33820bd 100644
--- a/src/designer/src/components/propertyeditor/designerpropertymanager.h
+++ b/src/designer/src/components/propertyeditor/designerpropertymanager.h
@@ -52,7 +52,7 @@
#include <QtCore/QUrl>
#include <QtCore/QMap>
#include <QtGui/QFont>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp
index ee369c2c5..5426b8514 100644
--- a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp
+++ b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp
@@ -44,7 +44,7 @@
#include <abstractdialoggui_p.h>
#include <qdesigner_propertysheet_p.h>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h
index e6cd63bf9..9e18551d9 100644
--- a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h
+++ b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h
@@ -54,7 +54,7 @@
//
#include "propertyeditor_global.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
#include <QtCore/QVariant>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/paletteeditor.cpp b/src/designer/src/components/propertyeditor/paletteeditor.cpp
index 15cd798d6..bd82c851b 100644
--- a/src/designer/src/components/propertyeditor/paletteeditor.cpp
+++ b/src/designer/src/components/propertyeditor/paletteeditor.cpp
@@ -49,9 +49,9 @@
#include <QtCore/QMetaProperty>
#include <QtGui/QPainter>
-#include <QtGui/QToolButton>
-#include <QtGui/QLabel>
-#include <QtGui/QHeaderView>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QHeaderView>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/paletteeditor.h b/src/designer/src/components/propertyeditor/paletteeditor.h
index 3474b37b6..bb69fc7be 100644
--- a/src/designer/src/components/propertyeditor/paletteeditor.h
+++ b/src/designer/src/components/propertyeditor/paletteeditor.h
@@ -43,7 +43,7 @@
#define PALETTEEDITOR_H
#include "ui_paletteeditor.h"
-#include <QtGui/QItemDelegate>
+#include <QtWidgets/QItemDelegate>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/paletteeditorbutton.h b/src/designer/src/components/propertyeditor/paletteeditorbutton.h
index 16d9365a9..88fefd634 100644
--- a/src/designer/src/components/propertyeditor/paletteeditorbutton.h
+++ b/src/designer/src/components/propertyeditor/paletteeditorbutton.h
@@ -45,7 +45,7 @@
#include "propertyeditor_global.h"
#include <QtGui/QPalette>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QToolButton>
#include "abstractformeditor.h"
diff --git a/src/designer/src/components/propertyeditor/previewframe.cpp b/src/designer/src/components/propertyeditor/previewframe.cpp
index 6629fc956..6d1fac178 100644
--- a/src/designer/src/components/propertyeditor/previewframe.cpp
+++ b/src/designer/src/components/propertyeditor/previewframe.cpp
@@ -45,8 +45,8 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtGui/QPainter>
-#include <QtGui/QMdiArea>
-#include <QtGui/QMdiSubWindow>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QMdiSubWindow>
#include <QtGui/QPaintEvent>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/previewframe.h b/src/designer/src/components/propertyeditor/previewframe.h
index 1e26da51c..2642c75fe 100644
--- a/src/designer/src/components/propertyeditor/previewframe.h
+++ b/src/designer/src/components/propertyeditor/previewframe.h
@@ -42,7 +42,7 @@
#ifndef PREVIEWFRAME_H
#define PREVIEWFRAME_H
-#include <QtGui/QFrame>
+#include <QtWidgets/QFrame>
#include <QtCore/QPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp
index fd5a9474b..0d9b9176f 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -68,17 +68,17 @@
#ifdef Q_OS_WIN
# include <widgetfactory_p.h>
#endif
-#include <QtGui/QAction>
-#include <QtGui/QLineEdit>
-#include <QtGui/QMenu>
-#include <QtGui/QApplication>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QScrollArea>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QToolBar>
-#include <QtGui/QToolButton>
-#include <QtGui/QActionGroup>
-#include <QtGui/QLabel>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QLabel>
#include <QtGui/QPainter>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/propertyeditor/stringlisteditor.cpp b/src/designer/src/components/propertyeditor/stringlisteditor.cpp
index 7a0e3e0e1..c90815b0e 100644
--- a/src/designer/src/components/propertyeditor/stringlisteditor.cpp
+++ b/src/designer/src/components/propertyeditor/stringlisteditor.cpp
@@ -41,7 +41,7 @@
#include "stringlisteditor.h"
#include <iconloader_p.h>
-#include <QtGui/QStringListModel>
+#include <QtWidgets/QStringListModel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/propertyeditor/stringlisteditorbutton.h b/src/designer/src/components/propertyeditor/stringlisteditorbutton.h
index 0a57e3834..de2d9f3f5 100644
--- a/src/designer/src/components/propertyeditor/stringlisteditorbutton.h
+++ b/src/designer/src/components/propertyeditor/stringlisteditorbutton.h
@@ -45,7 +45,7 @@
#include "propertyeditor_global.h"
#include <QtCore/QStringList>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QToolButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp
index 2d55abdcf..4f4f76c6f 100644
--- a/src/designer/src/components/signalsloteditor/connectdialog.cpp
+++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp
@@ -51,7 +51,7 @@
#include <QtDesigner/QExtensionManager>
#include <QtDesigner/QDesignerLanguageExtension>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/signalsloteditor/connectdialog_p.h b/src/designer/src/components/signalsloteditor/connectdialog_p.h
index fc07827d6..820ba05da 100644
--- a/src/designer/src/components/signalsloteditor/connectdialog_p.h
+++ b/src/designer/src/components/signalsloteditor/connectdialog_p.h
@@ -54,7 +54,7 @@
//
#include "ui_connectdialog.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp
index 639c5259e..364619199 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp
@@ -52,9 +52,9 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerMetaDataBaseInterface>
-#include <QtGui/QApplication>
-#include <QtGui/QUndoCommand>
-#include <QtGui/QMenu>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QUndoCommand>
+#include <QtWidgets/QMenu>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp
index d183a98db..7e82cb6f6 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp
@@ -45,7 +45,7 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerFormWindowManagerInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp
index 26055a40b..6df375219 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp
@@ -45,7 +45,7 @@
#include <QtDesigner/private/ui4_p.h>
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index 63ace1766..0b4056d2f 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -60,21 +60,21 @@
#include <QtCore/QAbstractItemModel>
#include <QtCore/QDebug>
-#include <QtGui/QAction>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QMenu>
-#include <QtGui/QSortFilterProxyModel>
-#include <QtGui/QStandardItemModel>
-#include <QtGui/QComboBox>
-#include <QtGui/QApplication>
-#include <QtGui/QItemDelegate>
-#include <QtGui/QItemEditorFactory>
-#include <QtGui/QTreeView>
-#include <QtGui/QHeaderView>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QToolButton>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QToolBar>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QSortFilterProxyModel>
+#include <QtWidgets/QStandardItemModel>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QItemDelegate>
+#include <QtWidgets/QItemEditorFactory>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QToolBar>
QT_BEGIN_NAMESPACE
@@ -445,7 +445,7 @@ void InlineEditorModel::addTitle(const QString &title)
const int cnt = rowCount();
insertRows(cnt, 1);
QModelIndex cat_idx = index(cnt, 0);
- setData(cat_idx, title + QLatin1Char(':'), Qt::DisplayRole);
+ setData(cat_idx, QString(title + QLatin1Char(':')), Qt::DisplayRole);
setData(cat_idx, TitleItem, Qt::UserRole);
QFont font = QApplication::font();
font.setBold(true);
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h
index 6cfc6734b..c1e805be1 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h
+++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h
@@ -43,7 +43,7 @@
#define SIGNALSLOTEDITORWINDOW_H
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/tabordereditor/tabordereditor.cpp b/src/designer/src/components/tabordereditor/tabordereditor.cpp
index a32ffe4a0..875953ae1 100644
--- a/src/designer/src/components/tabordereditor/tabordereditor.cpp
+++ b/src/designer/src/components/tabordereditor/tabordereditor.cpp
@@ -57,8 +57,8 @@
#include <QtGui/QPainter>
#include <QtGui/QMouseEvent>
#include <QtGui/QResizeEvent>
-#include <QtGui/QMenu>
-#include <QtGui/QApplication>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QApplication>
Q_DECLARE_METATYPE(QWidgetList)
diff --git a/src/designer/src/components/tabordereditor/tabordereditor.h b/src/designer/src/components/tabordereditor/tabordereditor.h
index cc0b669a7..82025fe33 100644
--- a/src/designer/src/components/tabordereditor/tabordereditor.h
+++ b/src/designer/src/components/tabordereditor/tabordereditor.h
@@ -45,7 +45,7 @@
#include "tabordereditor_global.h"
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/QRegion>
#include <QtGui/QFont>
#include <QtGui/QFontMetrics>
diff --git a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp
index e6309cff9..72ffb83dc 100644
--- a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp
+++ b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include "tabordereditor_plugin.h"
#include "tabordereditor_tool.h"
diff --git a/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp b/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp
index ee617b5a4..1c3fb7aca 100644
--- a/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp
+++ b/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp
@@ -45,7 +45,7 @@
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtCore/QEvent>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp
index 282abe6ba..8cfbdec39 100644
--- a/src/designer/src/components/taskmenu/button_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp
@@ -51,14 +51,14 @@
#include <QtDesigner/QDesignerObjectInspectorInterface>
#include <QtDesigner/QDesignerPropertyEditorInterface>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
-#include <QtGui/QMenu>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
-#include <QtGui/QAbstractButton>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
+#include <QtWidgets/QAbstractButton>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QApplication>
#include <QtCore/QDebug>
Q_DECLARE_METATYPE(QButtonGroup*)
diff --git a/src/designer/src/components/taskmenu/button_taskmenu.h b/src/designer/src/components/taskmenu/button_taskmenu.h
index 0473143a6..d1b94eb73 100644
--- a/src/designer/src/components/taskmenu/button_taskmenu.h
+++ b/src/designer/src/components/taskmenu/button_taskmenu.h
@@ -42,9 +42,9 @@
#ifndef BUTTON_TASKMENU_H
#define BUTTON_TASKMENU_H
-#include <QtGui/QAbstractButton>
-#include <QtGui/QCommandLinkButton>
-#include <QtGui/QButtonGroup>
+#include <QtWidgets/QAbstractButton>
+#include <QtWidgets/QCommandLinkButton>
+#include <QtWidgets/QButtonGroup>
#include <qdesigner_taskmenu_p.h>
#include <extensionfactory_p.h>
diff --git a/src/designer/src/components/taskmenu/combobox_taskmenu.cpp b/src/designer/src/components/taskmenu/combobox_taskmenu.cpp
index 95842df59..87f05cd5d 100644
--- a/src/designer/src/components/taskmenu/combobox_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/combobox_taskmenu.cpp
@@ -46,11 +46,11 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QLineEdit>
-#include <QtGui/QFontComboBox>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QFontComboBox>
+#include <QtWidgets/QStyleOption>
#include <QtCore/QEvent>
#include <QtCore/QVariant>
diff --git a/src/designer/src/components/taskmenu/combobox_taskmenu.h b/src/designer/src/components/taskmenu/combobox_taskmenu.h
index a1aa9c843..3ab7bd52e 100644
--- a/src/designer/src/components/taskmenu/combobox_taskmenu.h
+++ b/src/designer/src/components/taskmenu/combobox_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef COMBOBOX_TASKMENU_H
#define COMBOBOX_TASKMENU_H
-#include <QtGui/QComboBox>
+#include <QtWidgets/QComboBox>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
index 9568ca146..4165e2d69 100644
--- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
@@ -51,16 +51,16 @@
#include <promotiontaskmenu_p.h>
#include <widgetdatabase_p.h>
-#include <QtGui/QAction>
-#include <QtGui/QMainWindow>
-#include <QtGui/QToolBox>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QTabWidget>
-#include <QtGui/QScrollArea>
-#include <QtGui/QMdiArea>
-#include <QtGui/QWorkspace>
-#include <QtGui/QWizard>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QWorkspace>
+#include <QtWidgets/QWizard>
+#include <QtWidgets/QMenu>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp
index e402e8ba2..4c9d31911 100644
--- a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp
@@ -44,9 +44,9 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/groupbox_taskmenu.h b/src/designer/src/components/taskmenu/groupbox_taskmenu.h
index bdc720a90..9a5c675f9 100644
--- a/src/designer/src/components/taskmenu/groupbox_taskmenu.h
+++ b/src/designer/src/components/taskmenu/groupbox_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef GROUPBOX_TASKMENU_H
#define GROUPBOX_TASKMENU_H
-#include <QtGui/QGroupBox>
+#include <QtWidgets/QGroupBox>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp
index 6b4343705..2c5abc446 100644
--- a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp
+++ b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp
@@ -43,9 +43,9 @@
#include "inplace_widget_helper.h"
#include <QtGui/QResizeEvent>
-#include <QtGui/QPushButton>
-#include <QtGui/QToolButton>
-#include <QtGui/QShortcut>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QShortcut>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/itemlisteditor.cpp b/src/designer/src/components/taskmenu/itemlisteditor.cpp
index d682aff20..f01f1154b 100644
--- a/src/designer/src/components/taskmenu/itemlisteditor.cpp
+++ b/src/designer/src/components/taskmenu/itemlisteditor.cpp
@@ -49,7 +49,7 @@
#include <qttreepropertybrowser.h>
-#include <QtGui/QSplitter>
+#include <QtWidgets/QSplitter>
#include <QtCore/QCoreApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/itemlisteditor.h b/src/designer/src/components/taskmenu/itemlisteditor.h
index 57bbeef73..9defb6ad7 100644
--- a/src/designer/src/components/taskmenu/itemlisteditor.h
+++ b/src/designer/src/components/taskmenu/itemlisteditor.h
@@ -44,7 +44,7 @@
#include "ui_itemlisteditor.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/label_taskmenu.cpp b/src/designer/src/components/taskmenu/label_taskmenu.cpp
index e3958232b..bfc6bfb64 100644
--- a/src/designer/src/components/taskmenu/label_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/label_taskmenu.cpp
@@ -44,9 +44,9 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
#include <QtGui/QTextDocument>
static const char *textPropertyC = "text";
diff --git a/src/designer/src/components/taskmenu/label_taskmenu.h b/src/designer/src/components/taskmenu/label_taskmenu.h
index 760aafa02..04af4e533 100644
--- a/src/designer/src/components/taskmenu/label_taskmenu.h
+++ b/src/designer/src/components/taskmenu/label_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef LABEL_TASKMENU_H
#define LABEL_TASKMENU_H
-#include <QtGui/QLabel>
+#include <QtWidgets/QLabel>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/layouttaskmenu.cpp b/src/designer/src/components/taskmenu/layouttaskmenu.cpp
index 005bb30ad..ae79a0dd9 100644
--- a/src/designer/src/components/taskmenu/layouttaskmenu.cpp
+++ b/src/designer/src/components/taskmenu/layouttaskmenu.cpp
@@ -45,7 +45,7 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp
index b60513423..efbadc38d 100644
--- a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp
@@ -44,9 +44,9 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.h b/src/designer/src/components/taskmenu/lineedit_taskmenu.h
index 6a4bbc2b4..9d40e8d60 100644
--- a/src/designer/src/components/taskmenu/lineedit_taskmenu.h
+++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef LINEEDIT_TASKMENU_H
#define LINEEDIT_TASKMENU_H
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QLineEdit>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp
index 8ecc8408a..bb6162b34 100644
--- a/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp
@@ -46,10 +46,10 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QLineEdit>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QStyleOption>
#include <QtCore/QEvent>
#include <QtCore/QVariant>
diff --git a/src/designer/src/components/taskmenu/listwidget_taskmenu.h b/src/designer/src/components/taskmenu/listwidget_taskmenu.h
index caaac4d7c..9c1309ecb 100644
--- a/src/designer/src/components/taskmenu/listwidget_taskmenu.h
+++ b/src/designer/src/components/taskmenu/listwidget_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef LISTWIDGET_TASKMENU_H
#define LISTWIDGET_TASKMENU_H
-#include <QtGui/QListWidget>
+#include <QtWidgets/QListWidget>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/listwidgeteditor.cpp b/src/designer/src/components/taskmenu/listwidgeteditor.cpp
index 656bcc163..1eeec4cce 100644
--- a/src/designer/src/components/taskmenu/listwidgeteditor.cpp
+++ b/src/designer/src/components/taskmenu/listwidgeteditor.cpp
@@ -46,9 +46,9 @@
#include <QtDesigner/QDesignerSettingsInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QComboBox>
-#include <QtGui/QGroupBox>
-#include <QtGui/QDialogButtonBox>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QDialogButtonBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/listwidgeteditor.h b/src/designer/src/components/taskmenu/listwidgeteditor.h
index 30b851b8e..4709ccc54 100644
--- a/src/designer/src/components/taskmenu/listwidgeteditor.h
+++ b/src/designer/src/components/taskmenu/listwidgeteditor.h
@@ -45,7 +45,7 @@
#include "itemlisteditor.h"
#include <qdesigner_command_p.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/menutaskmenu.cpp b/src/designer/src/components/taskmenu/menutaskmenu.cpp
index 13b340a4d..6fc9a797a 100644
--- a/src/designer/src/components/taskmenu/menutaskmenu.cpp
+++ b/src/designer/src/components/taskmenu/menutaskmenu.cpp
@@ -43,7 +43,7 @@
#include <promotiontaskmenu_p.h>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp b/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp
index b77a090ec..33f1e91fd 100644
--- a/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp
@@ -44,11 +44,11 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QTableWidget>
-#include <QtGui/QAction>
-#include <QtGui/QLineEdit>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
#include <QtCore/QEvent>
#include <QtCore/QVariant>
diff --git a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h
index ad8b9243b..abc770a70 100644
--- a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h
+++ b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h
@@ -45,7 +45,7 @@
#include <qdesigner_taskmenu_p.h>
#include <extensionfactory_p.h>
-#include <QtGui/QTableWidget>
+#include <QtWidgets/QTableWidget>
#include <QtCore/QPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/tablewidgeteditor.h b/src/designer/src/components/taskmenu/tablewidgeteditor.h
index f99bdc5b9..ed28ad78a 100644
--- a/src/designer/src/components/taskmenu/tablewidgeteditor.h
+++ b/src/designer/src/components/taskmenu/tablewidgeteditor.h
@@ -46,7 +46,7 @@
#include "listwidgeteditor.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp
index a26656d30..ea4ab0cbb 100644
--- a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp
@@ -43,7 +43,7 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtCore/QEvent>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.h b/src/designer/src/components/taskmenu/textedit_taskmenu.h
index 7d1ce1927..6d3df266f 100644
--- a/src/designer/src/components/taskmenu/textedit_taskmenu.h
+++ b/src/designer/src/components/taskmenu/textedit_taskmenu.h
@@ -42,8 +42,8 @@
#ifndef TEXTEDIT_TASKMENU_H
#define TEXTEDIT_TASKMENU_H
-#include <QtGui/QTextEdit>
-#include <QtGui/QPlainTextEdit>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QPlainTextEdit>
#include <qdesigner_taskmenu_p.h>
#include <extensionfactory_p.h>
diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
index 4a8dc877f..56da353ef 100644
--- a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
@@ -47,8 +47,8 @@
#include <promotiontaskmenu_p.h>
#include <qdesigner_command_p.h>
-#include <QtGui/QAction>
-#include <QtGui/QUndoStack>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QUndoStack>
#include <QtCore/QDebug>
diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.h b/src/designer/src/components/taskmenu/toolbar_taskmenu.h
index f8abda29c..7da25e3ec 100644
--- a/src/designer/src/components/taskmenu/toolbar_taskmenu.h
+++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.h
@@ -46,8 +46,8 @@
#include <extensionfactory_p.h>
-#include <QtGui/QToolBar>
-#include <QtGui/QStatusBar>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QStatusBar>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp b/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp
index 1395e31b4..d79b61d7c 100644
--- a/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp
@@ -44,10 +44,10 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
-#include <QtGui/QStyle>
-#include <QtGui/QLineEdit>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QStyleOption>
#include <QtCore/QEvent>
#include <QtCore/QVariant>
diff --git a/src/designer/src/components/taskmenu/treewidget_taskmenu.h b/src/designer/src/components/taskmenu/treewidget_taskmenu.h
index ef7a63208..4c53abbf6 100644
--- a/src/designer/src/components/taskmenu/treewidget_taskmenu.h
+++ b/src/designer/src/components/taskmenu/treewidget_taskmenu.h
@@ -42,7 +42,7 @@
#ifndef TREEWIDGET_TASKMENU_H
#define TREEWIDGET_TASKMENU_H
-#include <QtGui/QTreeWidget>
+#include <QtWidgets/QTreeWidget>
#include <QtCore/QPointer>
#include <qdesigner_taskmenu_p.h>
diff --git a/src/designer/src/components/taskmenu/treewidgeteditor.cpp b/src/designer/src/components/taskmenu/treewidgeteditor.cpp
index 50bbc0378..9c400519d 100644
--- a/src/designer/src/components/taskmenu/treewidgeteditor.cpp
+++ b/src/designer/src/components/taskmenu/treewidgeteditor.cpp
@@ -53,8 +53,8 @@
#include <QtCore/QDir>
#include <QtCore/QQueue>
-#include <QtGui/QHeaderView>
-#include <QtGui/QTreeWidgetItemIterator>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QTreeWidgetItemIterator>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/treewidgeteditor.h b/src/designer/src/components/taskmenu/treewidgeteditor.h
index 63a9da92b..ed9e65430 100644
--- a/src/designer/src/components/taskmenu/treewidgeteditor.h
+++ b/src/designer/src/components/taskmenu/treewidgeteditor.h
@@ -46,7 +46,7 @@
#include "listwidgeteditor.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/widgetbox/widgetbox.cpp b/src/designer/src/components/widgetbox/widgetbox.cpp
index 799e57e52..b0beed0d8 100644
--- a/src/designer/src/components/widgetbox/widgetbox.cpp
+++ b/src/designer/src/components/widgetbox/widgetbox.cpp
@@ -51,10 +51,10 @@
#include <filterwidget_p.h>
#include <QtGui/QDropEvent>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QApplication>
-#include <QtGui/QToolBar>
-#include <QtGui/QIcon>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QIcon>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
index 82b3f3369..a6f43ebd8 100644
--- a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
+++ b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
@@ -56,8 +56,8 @@
#include <QtDesigner/private/ui4_p.h>
#include <QtDesigner/private/formscriptrunner_p.h>
-#include <QtGui/QStyle>
-#include <QtGui/QApplication>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp
index fd5d301ef..ab9968a6d 100644
--- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp
+++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp
@@ -46,11 +46,11 @@
#include <QtXml/QDomDocument>
-#include <QtGui/QIcon>
-#include <QtGui/QListView>
-#include <QtGui/QLineEdit>
-#include <QtGui/QItemDelegate>
-#include <QtGui/QSortFilterProxyModel>
+#include <QtWidgets/QIcon>
+#include <QtWidgets/QListView>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QItemDelegate>
+#include <QtWidgets/QSortFilterProxyModel>
#include <QtCore/QAbstractListModel>
#include <QtCore/QList>
diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.h b/src/designer/src/components/widgetbox/widgetboxcategorylistview.h
index 9dc628a20..8d70d2055 100644
--- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.h
+++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.h
@@ -44,7 +44,7 @@
#include <QtDesigner/QDesignerWidgetBoxInterface>
-#include <QtGui/QListView>
+#include <QtWidgets/QListView>
#include <QtCore/QList>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
index 85724d171..57f0d48c7 100644
--- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
+++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
@@ -55,13 +55,13 @@
#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QHeaderView>
-#include <QtGui/QApplication>
-#include <QtGui/QTreeWidgetItem>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QTreeWidgetItem>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QMenu>
#include <QtCore/QFile>
#include <QtCore/QTimer>
diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.h b/src/designer/src/components/widgetbox/widgetboxtreewidget.h
index 934e52dfe..40e6b3c5c 100644
--- a/src/designer/src/components/widgetbox/widgetboxtreewidget.h
+++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.h
@@ -44,8 +44,8 @@
#include <qdesigner_widgetbox_p.h>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QIcon>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QIcon>
#include <QtCore/QList>
#include <QtCore/QHash>
#include <QtCore/QXmlStreamReader> // Cannot forward declare them on Mac
diff --git a/src/designer/src/designer/appfontdialog.cpp b/src/designer/src/designer/appfontdialog.cpp
index 01efcb50d..3f5a3fae9 100644
--- a/src/designer/src/designer/appfontdialog.cpp
+++ b/src/designer/src/designer/appfontdialog.cpp
@@ -45,16 +45,16 @@
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QTreeView>
-#include <QtGui/QToolButton>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QSpacerItem>
-#include <QtGui/QFileDialog>
-#include <QtGui/QStandardItemModel>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QSpacerItem>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QStandardItemModel>
+#include <QtWidgets/QMessageBox>
#include <QtGui/QFontDatabase>
-#include <QtGui/QDialogButtonBox>
+#include <QtWidgets/QDialogButtonBox>
#include <QtCore/QSettings>
#include <QtCore/QCoreApplication>
diff --git a/src/designer/src/designer/appfontdialog.h b/src/designer/src/designer/appfontdialog.h
index 15566ed6a..188176dbe 100644
--- a/src/designer/src/designer/appfontdialog.h
+++ b/src/designer/src/designer/appfontdialog.h
@@ -42,8 +42,8 @@
#ifndef QDESIGNER_APPFONTWIDGET_H
#define QDESIGNER_APPFONTWIDGET_H
-#include <QtGui/QGroupBox>
-#include <QtGui/QDialog>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/designer.pro b/src/designer/src/designer/designer.pro
index 6f961c097..1f450d679 100644
--- a/src/designer/src/designer/designer.pro
+++ b/src/designer/src/designer/designer.pro
@@ -1,7 +1,7 @@
load(qt_module)
DESTDIR = $$QT.designer.bins
-QT += core-private xml network designer-private uilib-private
+QT += core-private widgets xml network designer-private uilib-private printsupport
CONFIG += module
MODULE_PRI = ../../../../modules/qt_designer.pri
diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp
index 97ced718a..771e633eb 100644
--- a/src/designer/src/designer/mainwindow.cpp
+++ b/src/designer/src/designer/mainwindow.cpp
@@ -50,14 +50,14 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtGui/QCloseEvent>
-#include <QtGui/QToolBar>
-#include <QtGui/QMdiSubWindow>
-#include <QtGui/QStatusBar>
-#include <QtGui/QMenu>
-#include <QtGui/QLayout>
-#include <QtGui/QDockWidget>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMdiSubWindow>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QDockWidget>
#include <QtCore/QUrl>
#include <QtCore/QDebug>
diff --git a/src/designer/src/designer/mainwindow.h b/src/designer/src/designer/mainwindow.h
index a6fa573e9..8b1111a1e 100644
--- a/src/designer/src/designer/mainwindow.h
+++ b/src/designer/src/designer/mainwindow.h
@@ -42,9 +42,9 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include <QtGui/QMainWindow>
+#include <QtWidgets/QMainWindow>
#include <QtCore/QList>
-#include <QtGui/QMdiArea>
+#include <QtWidgets/QMdiArea>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/newform.cpp b/src/designer/src/designer/newform.cpp
index 49d31ad27..1b04f6aa8 100644
--- a/src/designer/src/designer/newform.cpp
+++ b/src/designer/src/designer/newform.cpp
@@ -55,14 +55,14 @@
#include <QtCore/QDir>
#include <QtCore/QTemporaryFile>
-#include <QtGui/QApplication>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QMenu>
-#include <QtGui/QCheckBox>
-#include <QtGui/QFrame>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QCheckBox>
+#include <QtWidgets/QFrame>
+#include <QtWidgets/QMessageBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/newform.h b/src/designer/src/designer/newform.h
index d34e0c8ab..bf83d07d8 100644
--- a/src/designer/src/designer/newform.h
+++ b/src/designer/src/designer/newform.h
@@ -42,7 +42,7 @@
#ifndef NEWFORM_H
#define NEWFORM_H
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/preferencesdialog.cpp b/src/designer/src/designer/preferencesdialog.cpp
index 42a20d6d8..d1ca5f49c 100644
--- a/src/designer/src/designer/preferencesdialog.cpp
+++ b/src/designer/src/designer/preferencesdialog.cpp
@@ -46,8 +46,8 @@
#include <QtDesigner/QDesignerOptionsPageInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QFileDialog>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/preferencesdialog.h b/src/designer/src/designer/preferencesdialog.h
index 182641353..44a05143f 100644
--- a/src/designer/src/designer/preferencesdialog.h
+++ b/src/designer/src/designer/preferencesdialog.h
@@ -42,7 +42,7 @@
#ifndef PREFERENCESDIALOG_H
#define PREFERENCESDIALOG_H
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp
index 91a70e705..66af42b12 100644
--- a/src/designer/src/designer/qdesigner.cpp
+++ b/src/designer/src/designer/qdesigner.cpp
@@ -51,9 +51,9 @@
#include <QtGui/QFileOpenEvent>
#include <QtGui/QCloseEvent>
-#include <QtGui/QMessageBox>
-#include <QtGui/QIcon>
-#include <QtGui/QErrorMessage>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QIcon>
+#include <QtWidgets/QErrorMessage>
#include <QtCore/QMetaObject>
#include <QtCore/QFile>
#include <QtCore/QLibraryInfo>
diff --git a/src/designer/src/designer/qdesigner.h b/src/designer/src/designer/qdesigner.h
index 04a2e0df3..91a445545 100644
--- a/src/designer/src/designer/qdesigner.h
+++ b/src/designer/src/designer/qdesigner.h
@@ -43,7 +43,7 @@
#define QDESIGNER_H
#include <QtCore/QPointer>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp
index 09fd3ad5b..464569682 100644
--- a/src/designer/src/designer/qdesigner_actions.cpp
+++ b/src/designer/src/designer/qdesigner_actions.cpp
@@ -73,19 +73,19 @@
#include <QtDesigner/private/shared_settings_p.h>
#include <QtDesigner/private/formwindowbase_p.h>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
-#include <QtGui/QStyleFactory>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QStyleFactory>
#include <QtGui/QCloseEvent>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMenu>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QIcon>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QIcon>
#include <QtGui/QImage>
#include <QtGui/QPixmap>
-#include <QtGui/QMdiSubWindow>
-#include <QtGui/QPrintDialog>
+#include <QtWidgets/QMdiSubWindow>
+#include <QtPrintSupport/QPrintDialog>
#include <QtGui/QPainter>
#include <QtGui/QTransform>
#include <QtGui/QCursor>
@@ -98,8 +98,8 @@
#include <QtCore/QTimer>
#include <QtCore/QMetaObject>
#include <QtCore/QFileInfo>
-#include <QtGui/QStatusBar>
-#include <QtGui/QDesktopWidget>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QDesktopWidget>
#include <QtXml/QDomDocument>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_actions.h b/src/designer/src/designer/qdesigner_actions.h
index 2ea8990a2..1bd8bb999 100644
--- a/src/designer/src/designer/qdesigner_actions.h
+++ b/src/designer/src/designer/qdesigner_actions.h
@@ -47,7 +47,7 @@
#include <QtCore/QObject>
#include <QtCore/QPointer>
-#include <QtGui/QPrinter>
+#include <QtPrintSupport/QPrinter>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_appearanceoptions.h b/src/designer/src/designer/qdesigner_appearanceoptions.h
index 62c185f23..d79a18da9 100644
--- a/src/designer/src/designer/qdesigner_appearanceoptions.h
+++ b/src/designer/src/designer/qdesigner_appearanceoptions.h
@@ -49,7 +49,7 @@
#include <QtCore/QObject>
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_formwindow.cpp b/src/designer/src/designer/qdesigner_formwindow.cpp
index d7ac09b6a..5434afd6e 100644
--- a/src/designer/src/designer/qdesigner_formwindow.cpp
+++ b/src/designer/src/designer/qdesigner_formwindow.cpp
@@ -55,13 +55,13 @@
#include <QtCore/QEvent>
#include <QtCore/QFile>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtGui/QCloseEvent>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QUndoCommand>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QUndoCommand>
#include <QtGui/QWindowStateChangeEvent>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_formwindow.h b/src/designer/src/designer/qdesigner_formwindow.h
index 7c8f46d89..61420e637 100644
--- a/src/designer/src/designer/qdesigner_formwindow.h
+++ b/src/designer/src/designer/qdesigner_formwindow.h
@@ -43,7 +43,7 @@
#define QDESIGNER_FORMWINDOW_H
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_pch.h b/src/designer/src/designer/qdesigner_pch.h
index 466251977..59e0631d6 100644
--- a/src/designer/src/designer/qdesigner_pch.h
+++ b/src/designer/src/designer/qdesigner_pch.h
@@ -45,9 +45,9 @@
#include <QtCore/QSettings>
#include <QtCore/qdebug.h>
#include <QtGui/QCloseEvent>
-#include <QtGui/QHeaderView>
-#include <QtGui/QMessageBox>
-#include <QtGui/QVBoxLayout>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QVBoxLayout>
#include <QtDesigner/abstractformeditor.h>
#include <QtDesigner/abstractformwindow.h>
diff --git a/src/designer/src/designer/qdesigner_settings.cpp b/src/designer/src/designer/qdesigner_settings.cpp
index 298b7d8bd..2a688488c 100644
--- a/src/designer/src/designer/qdesigner_settings.cpp
+++ b/src/designer/src/designer/qdesigner_settings.cpp
@@ -53,9 +53,9 @@
#include <QtCore/QVariant>
#include <QtCore/QDir>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QStyle>
-#include <QtGui/QListView>
+#include <QtWidgets/QDesktopWidget>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QListView>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/designer/qdesigner_toolwindow.cpp b/src/designer/src/designer/qdesigner_toolwindow.cpp
index cc738366a..723411463 100644
--- a/src/designer/src/designer/qdesigner_toolwindow.cpp
+++ b/src/designer/src/designer/qdesigner_toolwindow.cpp
@@ -53,7 +53,7 @@
#include <QtCore/QEvent>
#include <QtCore/QDebug>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include <QtGui/QCloseEvent>
enum { debugToolWindow = 0 };
diff --git a/src/designer/src/designer/qdesigner_toolwindow.h b/src/designer/src/designer/qdesigner_toolwindow.h
index 7065cf2ca..362b8c932 100644
--- a/src/designer/src/designer/qdesigner_toolwindow.h
+++ b/src/designer/src/designer/qdesigner_toolwindow.h
@@ -46,7 +46,7 @@
#include <QtCore/QPointer>
#include <QtGui/QFontDatabase>
-#include <QtGui/QMainWindow>
+#include <QtWidgets/QMainWindow>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp
index 627148b0b..08ad0ee6d 100644
--- a/src/designer/src/designer/qdesigner_workbench.cpp
+++ b/src/designer/src/designer/qdesigner_workbench.cpp
@@ -68,18 +68,18 @@
#include <QtCore/QPluginLoader>
#include <QtCore/qdebug.h>
-#include <QtGui/QActionGroup>
+#include <QtWidgets/QActionGroup>
#include <QtGui/QCloseEvent>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QDockWidget>
-#include <QtGui/QMenu>
-#include <QtGui/QMenuBar>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QToolBar>
-#include <QtGui/QMdiArea>
-#include <QtGui/QMdiSubWindow>
-#include <QtGui/QLayout>
+#include <QtWidgets/QDesktopWidget>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMdiArea>
+#include <QtWidgets/QMdiSubWindow>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/saveformastemplate.cpp b/src/designer/src/designer/saveformastemplate.cpp
index fd4428f9c..500a956a1 100644
--- a/src/designer/src/designer/saveformastemplate.cpp
+++ b/src/designer/src/designer/saveformastemplate.cpp
@@ -43,9 +43,9 @@
#include "qdesigner_settings.h"
#include <QtCore/QFile>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
#include <QtDesigner/abstractformeditor.h>
#include <QtDesigner/abstractformwindow.h>
diff --git a/src/designer/src/designer/versiondialog.cpp b/src/designer/src/designer/versiondialog.cpp
index 5070cb547..efa603078 100644
--- a/src/designer/src/designer/versiondialog.cpp
+++ b/src/designer/src/designer/versiondialog.cpp
@@ -41,13 +41,13 @@
#include <QtCore/QVector>
#include <QtGui/QMouseEvent>
-#include <QtGui/QGridLayout>
-#include <QtGui/QLabel>
-#include <QtGui/QPushButton>
-#include <QtGui/QDialogButtonBox>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QDialogButtonBox>
#include <QtGui/QPainter>
#include <QtGui/QPainterPath>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QStyleOption>
#include "versiondialog.h"
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/designer/versiondialog.h b/src/designer/src/designer/versiondialog.h
index cf80af702..4919e9e26 100644
--- a/src/designer/src/designer/versiondialog.h
+++ b/src/designer/src/designer/versiondialog.h
@@ -42,7 +42,7 @@
#ifndef VERSIONDIALOG_H
#define VERSIONDIALOG_H
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/extension/default_extensionfactory.cpp b/src/designer/src/lib/extension/default_extensionfactory.cpp
index 29d34a1fa..305b7f965 100644
--- a/src/designer/src/lib/extension/default_extensionfactory.cpp
+++ b/src/designer/src/lib/extension/default_extensionfactory.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtDesigner/default_extensionfactory.h>
+#include "default_extensionfactory.h"
#include "qextensionmanager.h"
#include <qpointer.h>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/extension/default_extensionfactory.h b/src/designer/src/lib/extension/default_extensionfactory.h
index 7b2c789f9..1da20bc8c 100644
--- a/src/designer/src/lib/extension/default_extensionfactory.h
+++ b/src/designer/src/lib/extension/default_extensionfactory.h
@@ -42,7 +42,7 @@
#ifndef DEFAULT_EXTENSIONFACTORY_H
#define DEFAULT_EXTENSIONFACTORY_H
-#include <QtDesigner/extension_global.h>
+#include "extension_global.h"
#include <QtDesigner/extension.h>
#include <QtCore/QMap>
diff --git a/src/designer/src/lib/extension/qextensionmanager.h b/src/designer/src/lib/extension/qextensionmanager.h
index f6c1dd1c0..161de5555 100644
--- a/src/designer/src/lib/extension/qextensionmanager.h
+++ b/src/designer/src/lib/extension/qextensionmanager.h
@@ -42,7 +42,7 @@
#ifndef QEXTENSIONMANAGER_H
#define QEXTENSIONMANAGER_H
-#include <QtDesigner/extension_global.h>
+#include "extension_global.h"
#include <QtDesigner/extension.h>
#include <QtCore/QHash>
diff --git a/src/designer/src/lib/lib.pro b/src/designer/src/lib/lib.pro
index 731c7acf5..ffb9eb2f4 100644
--- a/src/designer/src/lib/lib.pro
+++ b/src/designer/src/lib/lib.pro
@@ -3,49 +3,24 @@ MODULE = designer
load(qt_module)
load(qt_module_config)
-TEMPLATE=lib
-TARGET=QtDesigner
-QT += core-private gui-private xml uilib-private
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-CONFIG += qt
-win32|mac: CONFIG += debug_and_release
-DESTDIR = $$QT.designer.libs
-!wince*:DLLDESTDIR = $$QT.designer.bins
+TARGET = QtDesigner
+QPRO_PWD = $$PWD
+QT += core-private gui-private widgets widgets-private xml
-INCLUDEPATH += $$QT.designer.includes \
- $$QT.designer.private_includes \
- $$QT.designer.private_includes/QtDesigner
+CONFIG += module
+MODULE_PRI = ../../../../modules/qt_designer.pri
-VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
+unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml QtCore QtGui QtWidgets
-unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml
-
-load(qt_targets)
+load(qt_module_config)
HEADERS += qtdesignerversion.h
-QMAKE_TARGET_PRODUCT = Designer
-QMAKE_TARGET_DESCRIPTION = Graphical user interface designer.
-
-!contains(CONFIG, static) {
- CONFIG += dll
-
- DEFINES += \
- QDESIGNER_SDK_LIBRARY \
- QDESIGNER_EXTENSION_LIBRARY \
- QDESIGNER_UILIB_LIBRARY \
- QDESIGNER_SHARED_LIBRARY
-} else {
- DEFINES += QT_DESIGNER_STATIC
-}
-
-#load up the headers info
-CONFIG += qt_install_headers
-#headers.pri is loaded from the last include path
-LAST_MODULE_INCLUDE=$$INCLUDEPATH
-for(include_path, INCLUDEPATH):LAST_MODULE_INCLUDE=$${include_path}
-HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri
-include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
+DEFINES += \
+ QDESIGNER_SDK_LIBRARY \
+ QDESIGNER_EXTENSION_LIBRARY \
+ QDESIGNER_UILIB_LIBRARY \
+ QDESIGNER_SHARED_LIBRARY
#mac frameworks
mac:CONFIG += explicitlib
@@ -67,23 +42,9 @@ mac:!static:contains(QT_CONFIG, qt_framework) {
include(extension/extension.pri)
include(sdk/sdk.pri)
-include($$QT.uilib.sources/uilib.pri)
include(shared/shared.pri)
+include(uilib/uilib.pri)
PRECOMPILED_HEADER=lib_pch.h
include(../sharedcomponents.pri)
include(../components/component.pri)
-
-target.path=$$[QT_INSTALL_LIBS]
-INSTALLS += target
-win32 {
- dlltarget.path=$$[QT_INSTALL_BINS]
- INSTALLS += dlltarget
-}
-
-
-qt_install_headers {
- designer_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
- designer_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner
- INSTALLS += designer_headers
-}
diff --git a/src/designer/src/lib/lib_pch.h b/src/designer/src/lib/lib_pch.h
index 4f2d4e3da..364358c36 100644
--- a/src/designer/src/lib/lib_pch.h
+++ b/src/designer/src/lib/lib_pch.h
@@ -48,17 +48,17 @@
#include <QtDesigner/qextensionmanager.h>
#include <QtDesigner/abstractformwindow.h>
#include <QtCore/QMap>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtDesigner/propertysheet.h>
#include <QtDesigner/extension.h>
#include <QtDesigner/abstractmetadatabase.h>
#include <QtCore/QList>
#include <QtDesigner/abstractwidgetfactory.h>
#include <QtDesigner/abstractwidgetdatabase.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include "qdesigner_widget_p.h"
#include <QtGui/QPainter>
-#include <QtGui/QMainWindow>
+#include <QtWidgets/QMainWindow>
#include <QtCore/qglobal.h>
#include <QtCore/QPointer>
#include "layout_p.h"
diff --git a/src/designer/src/lib/sdk/abstractactioneditor.h b/src/designer/src/lib/sdk/abstractactioneditor.h
index f19b5064c..0b0675fc5 100644
--- a/src/designer/src/lib/sdk/abstractactioneditor.h
+++ b/src/designer/src/lib/sdk/abstractactioneditor.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractdialoggui_p.h b/src/designer/src/lib/sdk/abstractdialoggui_p.h
index 863b5f99e..995c042d1 100644
--- a/src/designer/src/lib/sdk/abstractdialoggui_p.h
+++ b/src/designer/src/lib/sdk/abstractdialoggui_p.h
@@ -54,8 +54,8 @@
#define ABSTRACTDIALOGGUI_H
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QMessageBox>
-#include <QtGui/QFileDialog>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QFileDialog>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractformeditor.cpp b/src/designer/src/lib/sdk/abstractformeditor.cpp
index 5331a6cef..5df5be40a 100644
--- a/src/designer/src/lib/sdk/abstractformeditor.cpp
+++ b/src/designer/src/lib/sdk/abstractformeditor.cpp
@@ -66,7 +66,7 @@
#include <iconloader_p.h>
#include <QtDesigner/QDesignerPromotionInterface>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
// Must be done outside of the Qt namespace
static void initResources()
diff --git a/src/designer/src/lib/sdk/abstractformwindow.cpp b/src/designer/src/lib/sdk/abstractformwindow.cpp
index fdd6ec0b2..38d19c529 100644
--- a/src/designer/src/lib/sdk/abstractformwindow.cpp
+++ b/src/designer/src/lib/sdk/abstractformwindow.cpp
@@ -44,14 +44,14 @@
#include <widgetfactory_p.h>
-#include <QtGui/QTabBar>
-#include <QtGui/QSizeGrip>
-#include <QtGui/QAbstractButton>
-#include <QtGui/QToolBox>
-#include <QtGui/QMenuBar>
-#include <QtGui/QMainWindow>
-#include <QtGui/QDockWidget>
-#include <QtGui/QToolBar>
+#include <QtWidgets/QTabBar>
+#include <QtWidgets/QSizeGrip>
+#include <QtWidgets/QAbstractButton>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QToolBar>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/sdk/abstractformwindow.h b/src/designer/src/lib/sdk/abstractformwindow.h
index f92b778a4..72ef12da2 100644
--- a/src/designer/src/lib/sdk/abstractformwindow.h
+++ b/src/designer/src/lib/sdk/abstractformwindow.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractnewformwidget.h b/src/designer/src/lib/sdk/abstractnewformwidget.h
index a24a8e371..bfc8215f9 100644
--- a/src/designer/src/lib/sdk/abstractnewformwidget.h
+++ b/src/designer/src/lib/sdk/abstractnewformwidget.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractobjectinspector.h b/src/designer/src/lib/sdk/abstractobjectinspector.h
index db1da57eb..d72b6bc53 100644
--- a/src/designer/src/lib/sdk/abstractobjectinspector.h
+++ b/src/designer/src/lib/sdk/abstractobjectinspector.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractpropertyeditor.h b/src/designer/src/lib/sdk/abstractpropertyeditor.h
index 9158a89db..2b4ba3474 100644
--- a/src/designer/src/lib/sdk/abstractpropertyeditor.h
+++ b/src/designer/src/lib/sdk/abstractpropertyeditor.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractresourcebrowser.h b/src/designer/src/lib/sdk/abstractresourcebrowser.h
index a3daa4b38..78debd9c1 100644
--- a/src/designer/src/lib/sdk/abstractresourcebrowser.h
+++ b/src/designer/src/lib/sdk/abstractresourcebrowser.h
@@ -44,7 +44,7 @@
#include <QtDesigner/sdk_global.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/sdk/abstractwidgetbox.h b/src/designer/src/lib/sdk/abstractwidgetbox.h
index 445b2cdea..8303a4d39 100644
--- a/src/designer/src/lib/sdk/abstractwidgetbox.h
+++ b/src/designer/src/lib/sdk/abstractwidgetbox.h
@@ -46,8 +46,8 @@
#include <QtCore/QSharedDataPointer>
#include <QtCore/QMetaType>
-#include <QtGui/QWidget>
-#include <QtGui/QIcon>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QIcon>
QT_BEGIN_HEADER
diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp
index 83e260eb3..2707631d9 100644
--- a/src/designer/src/lib/shared/actioneditor.cpp
+++ b/src/designer/src/lib/shared/actioneditor.cpp
@@ -60,21 +60,21 @@
#include <QtDesigner/QDesignerMetaDataBaseInterface>
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QMenu>
-#include <QtGui/QToolBar>
-#include <QtGui/QSplitter>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QSplitter>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
#include <QtGui/QClipboard>
-#include <QtGui/QItemDelegate>
+#include <QtWidgets/QItemDelegate>
#include <QtGui/QPainter>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QLineEdit>
-#include <QtGui/QLabel>
-#include <QtGui/QPushButton>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QToolButton>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QItemSelection>
+#include <QtWidgets/QItemSelection>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/actionprovider_p.h b/src/designer/src/lib/shared/actionprovider_p.h
index fe8f48110..a6e6935c2 100644
--- a/src/designer/src/lib/shared/actionprovider_p.h
+++ b/src/designer/src/lib/shared/actionprovider_p.h
@@ -56,7 +56,7 @@
#include <QtDesigner/extension.h>
#include <QtCore/QPoint>
#include <QtCore/QRect>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp
index 0f62a43fb..46c1d7d50 100644
--- a/src/designer/src/lib/shared/actionrepository.cpp
+++ b/src/designer/src/lib/shared/actionrepository.cpp
@@ -50,13 +50,13 @@
#include <QtGui/QDrag>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QStandardItemModel>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QStandardItemModel>
+#include <QtWidgets/QToolButton>
#include <QtGui/QPixmap>
-#include <QtGui/QAction>
-#include <QtGui/QHeaderView>
-#include <QtGui/QToolBar>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMenu>
#include <QtGui/qevent.h>
#include <QtCore/QSet>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/actionrepository_p.h b/src/designer/src/lib/shared/actionrepository_p.h
index aca8e7a25..8ea74fad5 100644
--- a/src/designer/src/lib/shared/actionrepository_p.h
+++ b/src/designer/src/lib/shared/actionrepository_p.h
@@ -55,11 +55,11 @@
#include "shared_global_p.h"
#include <QtCore/QMimeData>
-#include <QtGui/QStandardItemModel>
-#include <QtGui/QTreeView>
-#include <QtGui/QListView>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QIcon>
+#include <QtWidgets/QStandardItemModel>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QListView>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QIcon>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/codedialog.cpp b/src/designer/src/lib/shared/codedialog.cpp
index 2de5b327a..fe1cfda5f 100644
--- a/src/designer/src/lib/shared/codedialog.cpp
+++ b/src/designer/src/lib/shared/codedialog.cpp
@@ -45,18 +45,18 @@
#include <texteditfindwidget.h>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
#include <QtGui/QClipboard>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QFileDialog>
-#include <QtGui/QIcon>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QIcon>
#include <QtGui/QKeyEvent>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QTextEdit>
-#include <QtGui/QToolBar>
-#include <QtGui/QVBoxLayout>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QVBoxLayout>
#include <QtCore/QDebug>
#include <QtCore/QDir>
diff --git a/src/designer/src/lib/shared/codedialog_p.h b/src/designer/src/lib/shared/codedialog_p.h
index 80a90aed7..3b9190ab4 100644
--- a/src/designer/src/lib/shared/codedialog_p.h
+++ b/src/designer/src/lib/shared/codedialog_p.h
@@ -54,7 +54,7 @@
#define CODEPREVIEWDIALOG_H
#include "shared_global_p.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/connectionedit.cpp b/src/designer/src/lib/shared/connectionedit.cpp
index f4065dc65..815940cd7 100644
--- a/src/designer/src/lib/shared/connectionedit.cpp
+++ b/src/designer/src/lib/shared/connectionedit.cpp
@@ -49,10 +49,10 @@
#include <QtGui/QFontMetrics>
#include <QtGui/QPixmap>
#include <QtGui/QMatrix>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
#include <QtCore/QMultiMap>
diff --git a/src/designer/src/lib/shared/connectionedit_p.h b/src/designer/src/lib/shared/connectionedit_p.h
index f18d24bc8..c5b0bed78 100644
--- a/src/designer/src/lib/shared/connectionedit_p.h
+++ b/src/designer/src/lib/shared/connectionedit_p.h
@@ -60,11 +60,11 @@
#include <QtCore/QList>
#include <QtCore/QPointer>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/QPixmap>
#include <QtGui/QPolygonF>
-#include <QtGui/QUndoCommand>
+#include <QtWidgets/QUndoCommand>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/deviceprofile.cpp b/src/designer/src/lib/shared/deviceprofile.cpp
index b3b6cef61..49fe0653f 100644
--- a/src/designer/src/lib/shared/deviceprofile.cpp
+++ b/src/designer/src/lib/shared/deviceprofile.cpp
@@ -45,12 +45,12 @@
#include <widgetfactory_p.h>
#include <qdesigner_utils_p.h>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
#include <QtGui/QFont>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleFactory>
-#include <QtGui/QApplication>
+#include <QtWidgets/QDesktopWidget>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QApplication>
#include <QtCore/QSharedData>
#include <QtCore/QTextStream>
diff --git a/src/designer/src/lib/shared/dialoggui.cpp b/src/designer/src/lib/shared/dialoggui.cpp
index 303f99b50..5cb9502e5 100644
--- a/src/designer/src/lib/shared/dialoggui.cpp
+++ b/src/designer/src/lib/shared/dialoggui.cpp
@@ -41,8 +41,8 @@
#include "dialoggui_p.h"
-#include <QtGui/QFileIconProvider>
-#include <QtGui/QIcon>
+#include <QtWidgets/QFileIconProvider>
+#include <QtWidgets/QIcon>
#include <QtGui/QImage>
#include <QtGui/QImageReader>
#include <QtGui/QPixmap>
diff --git a/src/designer/src/lib/shared/filterwidget.cpp b/src/designer/src/lib/shared/filterwidget.cpp
index 8d8aa9c0d..ac168b726 100644
--- a/src/designer/src/lib/shared/filterwidget.cpp
+++ b/src/designer/src/lib/shared/filterwidget.cpp
@@ -42,16 +42,16 @@
#include "filterwidget_p.h"
#include "iconloader_p.h"
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QLineEdit>
#include <QtGui/QFocusEvent>
#include <QtGui/QPalette>
#include <QtGui/QCursor>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QToolButton>
#include <QtGui/QPainter>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
#include <QtCore/QDebug>
#include <QtCore/QPropertyAnimation>
diff --git a/src/designer/src/lib/shared/filterwidget_p.h b/src/designer/src/lib/shared/filterwidget_p.h
index 2d32c2fb2..1ab7bcb72 100644
--- a/src/designer/src/lib/shared/filterwidget_p.h
+++ b/src/designer/src/lib/shared/filterwidget_p.h
@@ -55,10 +55,10 @@
#include "shared_global_p.h"
-#include <QtGui/QWidget>
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QLineEdit>
#include <QtGui/QColor>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QToolButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/formlayoutmenu.cpp b/src/designer/src/lib/shared/formlayoutmenu.cpp
index ce1db8fa8..3cc63161f 100644
--- a/src/designer/src/lib/shared/formlayoutmenu.cpp
+++ b/src/designer/src/lib/shared/formlayoutmenu.cpp
@@ -54,12 +54,12 @@
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
#include <QtDesigner/QDesignerLanguageExtension>
-#include <QtGui/QAction>
-#include <QtGui/QWidget>
-#include <QtGui/QFormLayout>
-#include <QtGui/QUndoStack>
-#include <QtGui/QDialog>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QUndoStack>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QPushButton>
#include <QtGui/QRegExpValidator>
#include <QtCore/QPair>
diff --git a/src/designer/src/lib/shared/formwindowbase.cpp b/src/designer/src/lib/shared/formwindowbase.cpp
index 865d06415..1a78f799f 100644
--- a/src/designer/src/lib/shared/formwindowbase.cpp
+++ b/src/designer/src/lib/shared/formwindowbase.cpp
@@ -61,18 +61,18 @@
#include <QtCore/qdebug.h>
#include <QtCore/QList>
#include <QtCore/QTimer>
-#include <QtGui/QMenu>
-#include <QtGui/QListWidget>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QTableWidget>
-#include <QtGui/QComboBox>
-#include <QtGui/QTabWidget>
-#include <QtGui/QToolBox>
-#include <QtGui/QToolBar>
-#include <QtGui/QStatusBar>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QLabel>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QListWidget>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QLabel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/grid.cpp b/src/designer/src/lib/shared/grid.cpp
index 1813acf2f..7954a68cd 100644
--- a/src/designer/src/lib/shared/grid.cpp
+++ b/src/designer/src/lib/shared/grid.cpp
@@ -44,7 +44,7 @@
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtGui/QPainter>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/gridpanel_p.h b/src/designer/src/lib/shared/gridpanel_p.h
index 7faf74f96..b67e7f9dc 100644
--- a/src/designer/src/lib/shared/gridpanel_p.h
+++ b/src/designer/src/lib/shared/gridpanel_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/htmlhighlighter.cpp b/src/designer/src/lib/shared/htmlhighlighter.cpp
index d4ad15006..bb8bf3816 100644
--- a/src/designer/src/lib/shared/htmlhighlighter.cpp
+++ b/src/designer/src/lib/shared/htmlhighlighter.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include <QtCore/QTextStream>
+#include <QtWidgets/QTextEdit>
#include "htmlhighlighter_p.h"
@@ -48,7 +49,7 @@ QT_BEGIN_NAMESPACE
namespace qdesigner_internal {
HtmlHighlighter::HtmlHighlighter(QTextEdit *textEdit)
- : QSyntaxHighlighter(textEdit)
+ : QSyntaxHighlighter(textEdit->document())
{
QTextCharFormat entityFormat;
entityFormat.setForeground(Qt::red);
diff --git a/src/designer/src/lib/shared/htmlhighlighter_p.h b/src/designer/src/lib/shared/htmlhighlighter_p.h
index d80e53ae5..e5f189714 100644
--- a/src/designer/src/lib/shared/htmlhighlighter_p.h
+++ b/src/designer/src/lib/shared/htmlhighlighter_p.h
@@ -57,6 +57,8 @@
QT_BEGIN_NAMESPACE
+class QTextEdit;
+
namespace qdesigner_internal {
/* HTML syntax highlighter based on Qt Quarterly example */
diff --git a/src/designer/src/lib/shared/iconloader.cpp b/src/designer/src/lib/shared/iconloader.cpp
index aba333a97..c8f5881f6 100644
--- a/src/designer/src/lib/shared/iconloader.cpp
+++ b/src/designer/src/lib/shared/iconloader.cpp
@@ -42,7 +42,7 @@
#include "iconloader_p.h"
#include <QtCore/QFile>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
#include <QtGui/QPixmap>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp
index 77948977d..a5d15874e 100644
--- a/src/designer/src/lib/shared/iconselector.cpp
+++ b/src/designer/src/lib/shared/iconselector.cpp
@@ -53,21 +53,21 @@
#include <QtDesigner/QDesignerIntegrationInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QToolButton>
#include <QtCore/QSignalMapper>
-#include <QtGui/QComboBox>
-#include <QtGui/QAction>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QDialog>
-#include <QtGui/QMenu>
-#include <QtGui/QApplication>
-#include <QtGui/QVBoxLayout>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QVBoxLayout>
#include <QtGui/QImageReader>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QLineEdit>
-#include <QtGui/QLabel>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QLabel>
#include <QtGui/QValidator>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/iconselector_p.h b/src/designer/src/lib/shared/iconselector_p.h
index b62cf0507..4cccf4e33 100644
--- a/src/designer/src/lib/shared/iconselector_p.h
+++ b/src/designer/src/lib/shared/iconselector_p.h
@@ -56,8 +56,8 @@
#include "shared_global_p.h"
-#include <QtGui/QWidget>
-#include <QtGui/QDialog>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QDialog>
#include <QtCore/QScopedPointer>
diff --git a/src/designer/src/lib/shared/invisible_widget_p.h b/src/designer/src/lib/shared/invisible_widget_p.h
index ba7a4738b..d13d42fcb 100644
--- a/src/designer/src/lib/shared/invisible_widget_p.h
+++ b/src/designer/src/lib/shared/invisible_widget_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp
index 02cf5f37d..5b2218de0 100644
--- a/src/designer/src/lib/shared/layout.cpp
+++ b/src/designer/src/lib/shared/layout.cpp
@@ -58,18 +58,18 @@
#include <QtCore/qdebug.h>
#include <QtCore/QVector>
-#include <QtGui/qevent.h>
-#include <QtGui/QGridLayout>
+#include <QtGui/QKeyEvent>
+#include <QtWidgets/QGridLayout>
#include <QtGui/QPainter>
#include <QtGui/QBitmap>
-#include <QtGui/QSplitter>
-#include <QtGui/QMainWindow>
-#include <QtGui/QApplication>
-#include <QtGui/QScrollArea>
-#include <QtGui/QFormLayout>
-#include <QtGui/QLabel>
-#include <QtGui/QWizardPage>
-#include <QtGui/QWizard>
+#include <QtWidgets/QSplitter>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QScrollArea>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QWizardPage>
+#include <QtWidgets/QWizard>
#include <QtCore/QDebug>
#include <QtCore/QSet>
diff --git a/src/designer/src/lib/shared/layout_p.h b/src/designer/src/lib/shared/layout_p.h
index f3bf968f0..a60950f52 100644
--- a/src/designer/src/lib/shared/layout_p.h
+++ b/src/designer/src/lib/shared/layout_p.h
@@ -61,9 +61,9 @@
#include <QtCore/QMap>
#include <QtCore/QHash>
-#include <QtGui/QLayout>
-#include <QtGui/QGridLayout>
-#include <QtGui/QWidget>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/layoutinfo.cpp b/src/designer/src/lib/shared/layoutinfo.cpp
index c68dc338a..d97c17abc 100644
--- a/src/designer/src/lib/shared/layoutinfo.cpp
+++ b/src/designer/src/lib/shared/layoutinfo.cpp
@@ -46,9 +46,9 @@
#include <QtDesigner/QDesignerMetaDataBaseInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QSplitter>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QSplitter>
#include <QtCore/QDebug>
#include <QtCore/QHash>
#include <QtCore/QRect>
diff --git a/src/designer/src/lib/shared/metadatabase.cpp b/src/designer/src/lib/shared/metadatabase.cpp
index cd6c7b4d9..0ac2eeb06 100644
--- a/src/designer/src/lib/shared/metadatabase.cpp
+++ b/src/designer/src/lib/shared/metadatabase.cpp
@@ -46,7 +46,7 @@
#include <QtDesigner/QDesignerFormEditorInterface>
// Qt
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtCore/qalgorithms.h>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp
index 667cae4c8..ef52939c9 100644
--- a/src/designer/src/lib/shared/morphmenu.cpp
+++ b/src/designer/src/lib/shared/morphmenu.cpp
@@ -56,24 +56,24 @@
#include <QtDesigner/QDesignerMetaDataBaseInterface>
#include <QtDesigner/QDesignerPropertySheetExtension>
-#include <QtGui/QWidget>
-#include <QtGui/QAction>
-#include <QtGui/QMenu>
-#include <QtGui/QApplication>
-#include <QtGui/QLayout>
-#include <QtGui/QUndoStack>
-
-#include <QtGui/QFrame>
-#include <QtGui/QGroupBox>
-#include <QtGui/QTabWidget>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QToolBox>
-#include <QtGui/QAbstractItemView>
-#include <QtGui/QAbstractButton>
-#include <QtGui/QAbstractSpinBox>
-#include <QtGui/QTextEdit>
-#include <QtGui/QPlainTextEdit>
-#include <QtGui/QLabel>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QUndoStack>
+
+#include <QtWidgets/QFrame>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QAbstractItemView>
+#include <QtWidgets/QAbstractButton>
+#include <QtWidgets/QAbstractSpinBox>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QPlainTextEdit>
+#include <QtWidgets/QLabel>
#include <QtCore/QStringList>
#include <QtCore/QMap>
diff --git a/src/designer/src/lib/shared/newactiondialog.cpp b/src/designer/src/lib/shared/newactiondialog.cpp
index 4effaed4f..ddd314864 100644
--- a/src/designer/src/lib/shared/newactiondialog.cpp
+++ b/src/designer/src/lib/shared/newactiondialog.cpp
@@ -50,7 +50,7 @@
#include <QtDesigner/abstractformwindow.h>
#include <QtDesigner/abstractformeditor.h>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPushButton>
#include <QtCore/QRegExp>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/newactiondialog_p.h b/src/designer/src/lib/shared/newactiondialog_p.h
index a5a8f6423..8c1cf3220 100644
--- a/src/designer/src/lib/shared/newactiondialog_p.h
+++ b/src/designer/src/lib/shared/newactiondialog_p.h
@@ -55,7 +55,7 @@
#include "qdesigner_utils_p.h" // PropertySheetIconValue
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
#include <QtGui/QKeySequence>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp
index a46da3432..2ae9db6e5 100644
--- a/src/designer/src/lib/shared/newformwidget.cpp
+++ b/src/designer/src/lib/shared/newformwidget.cpp
@@ -61,10 +61,10 @@
#include <QtCore/QDir>
#include <QtCore/QTextStream>
-#include <QtGui/QHeaderView>
-#include <QtGui/QTreeWidgetItem>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QTreeWidgetItem>
#include <QtGui/QPainter>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/newformwidget_p.h b/src/designer/src/lib/shared/newformwidget_p.h
index 48fc01906..2e4bfbd83 100644
--- a/src/designer/src/lib/shared/newformwidget_p.h
+++ b/src/designer/src/lib/shared/newformwidget_p.h
@@ -58,7 +58,7 @@
#include <QtDesigner/QDesignerNewFormWidgetInterface>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/QPixmap>
#include <QtCore/QStringList>
diff --git a/src/designer/src/lib/shared/orderdialog.cpp b/src/designer/src/lib/shared/orderdialog.cpp
index 36a46f81c..a8a7accfc 100644
--- a/src/designer/src/lib/shared/orderdialog.cpp
+++ b/src/designer/src/lib/shared/orderdialog.cpp
@@ -48,7 +48,7 @@
#include <QtDesigner/QDesignerContainerExtension>
#include <QtCore/QAbstractItemModel>
#include <QtCore/QModelIndex>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/orderdialog_p.h b/src/designer/src/lib/shared/orderdialog_p.h
index e2a1252bc..7998b7738 100644
--- a/src/designer/src/lib/shared/orderdialog_p.h
+++ b/src/designer/src/lib/shared/orderdialog_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
#include <QtCore/QMap>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/plaintexteditor.cpp b/src/designer/src/lib/shared/plaintexteditor.cpp
index 44fb0f603..c50c2de58 100644
--- a/src/designer/src/lib/shared/plaintexteditor.cpp
+++ b/src/designer/src/lib/shared/plaintexteditor.cpp
@@ -44,10 +44,10 @@
#include <QtDesigner/QDesignerSettingsInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QPlainTextEdit>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QPlainTextEdit>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QPushButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/plaintexteditor_p.h b/src/designer/src/lib/shared/plaintexteditor_p.h
index 747358242..7d9fc6e2f 100644
--- a/src/designer/src/lib/shared/plaintexteditor_p.h
+++ b/src/designer/src/lib/shared/plaintexteditor_p.h
@@ -53,7 +53,7 @@
#ifndef PLAINTEXTEDITOR_H
#define PLAINTEXTEDITOR_H
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
#include "shared_global_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/plugindialog.cpp b/src/designer/src/lib/shared/plugindialog.cpp
index d4df56ea3..cb5c7efab 100644
--- a/src/designer/src/lib/shared/plugindialog.cpp
+++ b/src/designer/src/lib/shared/plugindialog.cpp
@@ -48,9 +48,9 @@
#include <QtDesigner/QDesignerCustomWidgetCollectionInterface>
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
-#include <QtGui/QStyle>
-#include <QtGui/QHeaderView>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QPushButton>
#include <QtCore/QFileInfo>
#include <QtCore/QPluginLoader>
diff --git a/src/designer/src/lib/shared/previewconfigurationwidget.cpp b/src/designer/src/lib/shared/previewconfigurationwidget.cpp
index 4441ed9eb..58ee6473e 100644
--- a/src/designer/src/lib/shared/previewconfigurationwidget.cpp
+++ b/src/designer/src/lib/shared/previewconfigurationwidget.cpp
@@ -51,10 +51,10 @@
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QFileDialog>
-#include <QtGui/QStyleFactory>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMessageBox>
#include <QtCore/QPair>
#include <QtCore/QList>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/previewconfigurationwidget_p.h b/src/designer/src/lib/shared/previewconfigurationwidget_p.h
index 4968eeb66..b8d46737c 100644
--- a/src/designer/src/lib/shared/previewconfigurationwidget_p.h
+++ b/src/designer/src/lib/shared/previewconfigurationwidget_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QGroupBox>
+#include <QtWidgets/QGroupBox>
#include <QtCore/QSharedDataPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp
index e5fee9dfc..d9c85d363 100644
--- a/src/designer/src/lib/shared/previewmanager.cpp
+++ b/src/designer/src/lib/shared/previewmanager.cpp
@@ -54,18 +54,18 @@
#include <QtDesigner/QDesignerFormWindowManagerInterface>
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/qevent.h>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QMainWindow>
-#include <QtGui/QDockWidget>
-#include <QtGui/QApplication>
+#include <QtWidgets/QDesktopWidget>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QApplication>
#include <QtGui/QPixmap>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QDialog>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
#include <QtGui/QCursor>
#include <QtGui/QMatrix>
diff --git a/src/designer/src/lib/shared/promotionmodel.cpp b/src/designer/src/lib/shared/promotionmodel.cpp
index cf85e1cc9..301571bb6 100644
--- a/src/designer/src/lib/shared/promotionmodel.cpp
+++ b/src/designer/src/lib/shared/promotionmodel.cpp
@@ -46,7 +46,7 @@
#include <QtDesigner/QDesignerPromotionInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
-#include <QtGui/QStandardItem>
+#include <QtWidgets/QStandardItem>
#include <QtCore/QCoreApplication>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/promotionmodel_p.h b/src/designer/src/lib/shared/promotionmodel_p.h
index 214b39cd5..12738d7a1 100644
--- a/src/designer/src/lib/shared/promotionmodel_p.h
+++ b/src/designer/src/lib/shared/promotionmodel_p.h
@@ -53,7 +53,7 @@
#ifndef PROMOTIONMODEL_H
#define PROMOTIONMODEL_H
-#include <QtGui/QStandardItemModel>
+#include <QtWidgets/QStandardItemModel>
#include <QtCore/QSet>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/promotiontaskmenu.cpp b/src/designer/src/lib/shared/promotiontaskmenu.cpp
index 7d86d60a7..d13dbdda0 100644
--- a/src/designer/src/lib/shared/promotiontaskmenu.cpp
+++ b/src/designer/src/lib/shared/promotiontaskmenu.cpp
@@ -55,9 +55,9 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QAction>
-#include <QtGui/QWidget>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QMenu>
#include <QtCore/QSignalMapper>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/shared/propertylineedit.cpp b/src/designer/src/lib/shared/propertylineedit.cpp
index dec62247f..cd332b7f8 100644
--- a/src/designer/src/lib/shared/propertylineedit.cpp
+++ b/src/designer/src/lib/shared/propertylineedit.cpp
@@ -43,7 +43,7 @@
#include <QtGui/QContextMenuEvent>
#include <QtGui/QKeyEvent>
-#include <QtGui/QMenu>
+#include <QtWidgets/QMenu>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/propertylineedit_p.h b/src/designer/src/lib/shared/propertylineedit_p.h
index 33a68d592..dced2d08e 100644
--- a/src/designer/src/lib/shared/propertylineedit_p.h
+++ b/src/designer/src/lib/shared/propertylineedit_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QLineEdit>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp
index 637bb1d98..a4a2d093e 100644
--- a/src/designer/src/lib/shared/qdesigner_command.cpp
+++ b/src/designer/src/lib/shared/qdesigner_command.cpp
@@ -67,22 +67,22 @@
#include <QtCore/QTextStream>
#include <QtCore/QQueue>
-#include <QtGui/QMenuBar>
-#include <QtGui/QStatusBar>
-#include <QtGui/QToolBar>
-#include <QtGui/QToolBox>
-#include <QtGui/QStackedWidget>
-#include <QtGui/QTabWidget>
-#include <QtGui/QTableWidget>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QListWidget>
-#include <QtGui/QComboBox>
-#include <QtGui/QSplitter>
-#include <QtGui/QDockWidget>
-#include <QtGui/QMainWindow>
-#include <QtGui/QWizardPage>
-#include <QtGui/QApplication>
-#include <QtGui/QFormLayout>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QStackedWidget>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QListWidget>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QSplitter>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QWizardPage>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QFormLayout>
Q_DECLARE_METATYPE(QWidgetList)
diff --git a/src/designer/src/lib/shared/qdesigner_command2.cpp b/src/designer/src/lib/shared/qdesigner_command2.cpp
index 6253049f2..71be639c2 100644
--- a/src/designer/src/lib/shared/qdesigner_command2.cpp
+++ b/src/designer/src/lib/shared/qdesigner_command2.cpp
@@ -49,8 +49,8 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerMetaDataBaseInterface>
-#include <QtGui/QApplication>
-#include <QtGui/QLayout>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_command2_p.h b/src/designer/src/lib/shared/qdesigner_command2_p.h
index 5c53290b9..c19a16950 100644
--- a/src/designer/src/lib/shared/qdesigner_command2_p.h
+++ b/src/designer/src/lib/shared/qdesigner_command2_p.h
@@ -56,7 +56,7 @@
#include "shared_global_p.h"
#include "qdesigner_formwindowcommand_p.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_command_p.h b/src/designer/src/lib/shared/qdesigner_command_p.h
index f5265075c..f0c07d4bc 100644
--- a/src/designer/src/lib/shared/qdesigner_command_p.h
+++ b/src/designer/src/lib/shared/qdesigner_command_p.h
@@ -62,7 +62,7 @@
#include <QtDesigner/layoutdecoration.h>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
#include <QtCore/QObject>
#include <QtCore/QPair>
#include <QtCore/QMap>
diff --git a/src/designer/src/lib/shared/qdesigner_dnditem.cpp b/src/designer/src/lib/shared/qdesigner_dnditem.cpp
index 0d0c86c25..ade95695e 100644
--- a/src/designer/src/lib/shared/qdesigner_dnditem.cpp
+++ b/src/designer/src/lib/shared/qdesigner_dnditem.cpp
@@ -47,7 +47,7 @@
#include <QtGui/QBitmap>
#include <QtGui/QPixmap>
#include <QtGui/QImage>
-#include <QtGui/QLabel>
+#include <QtWidgets/QLabel>
#include <QtGui/QDrag>
#include <QtGui/QCursor>
#include <QtGui/QDropEvent>
diff --git a/src/designer/src/lib/shared/qdesigner_dockwidget.cpp b/src/designer/src/lib/shared/qdesigner_dockwidget.cpp
index 55a3bc22c..4d8658925 100644
--- a/src/designer/src/lib/shared/qdesigner_dockwidget.cpp
+++ b/src/designer/src/lib/shared/qdesigner_dockwidget.cpp
@@ -48,8 +48,8 @@
#include <QtDesigner/QExtensionManager>
#include <QtDesigner/QDesignerFormWindowCursorInterface>
-#include <QtGui/QMainWindow>
-#include <QtGui/QLayout>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_dockwidget_p.h b/src/designer/src/lib/shared/qdesigner_dockwidget_p.h
index 332f50941..39d57f745 100644
--- a/src/designer/src/lib/shared/qdesigner_dockwidget_p.h
+++ b/src/designer/src/lib/shared/qdesigner_dockwidget_p.h
@@ -54,7 +54,7 @@
#define QDESIGNER_DOCKWIDGET_H
#include "shared_global_p.h"
-#include <QtGui/QDockWidget>
+#include <QtWidgets/QDockWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
index b357de876..3ad5a0558 100644
--- a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
+++ b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
@@ -65,16 +65,16 @@
#include <qtresourcemodel_p.h>
#include <scripterrordialog_p.h>
-#include <QtGui/QWidget>
-#include <QtGui/QMenu>
-#include <QtGui/QToolBar>
-#include <QtGui/QMenuBar>
-#include <QtGui/QMainWindow>
-#include <QtGui/QStyleFactory>
-#include <QtGui/QStyle>
-#include <QtGui/QApplication>
-#include <QtGui/QAbstractScrollArea>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QAbstractScrollArea>
+#include <QtWidgets/QMessageBox>
#include <QtGui/QPixmap>
#include <QtCore/QBuffer>
diff --git a/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h b/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h
index a5a07e962..9a7bd5555 100644
--- a/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h
+++ b/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
#include <QtCore/QPointer>
-#include <QtGui/QUndoCommand>
+#include <QtWidgets/QUndoCommand>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
index 50baa5519..75dbeb755 100644
--- a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
+++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
@@ -54,8 +54,8 @@
#include <QtDesigner/QExtensionManager>
#include <QtCore/QVariant>
-#include <QtGui/QWidget>
-#include <QtGui/QLabel>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QLabel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h b/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
index c2533554a..82db56864 100644
--- a/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
+++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
@@ -56,7 +56,7 @@
#include "shared_global_p.h"
#include <QtCore/QPointer>
-#include <QtGui/QUndoCommand>
+#include <QtWidgets/QUndoCommand>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_membersheet.cpp b/src/designer/src/lib/shared/qdesigner_membersheet.cpp
index 834420fd4..afe054c88 100644
--- a/src/designer/src/lib/shared/qdesigner_membersheet.cpp
+++ b/src/designer/src/lib/shared/qdesigner_membersheet.cpp
@@ -44,7 +44,7 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <abstractintrospection_p.h>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
namespace {
diff --git a/src/designer/src/lib/shared/qdesigner_menu.cpp b/src/designer/src/lib/shared/qdesigner_menu.cpp
index 61a3fd621..f5f2ae09f 100644
--- a/src/designer/src/lib/shared/qdesigner_menu.cpp
+++ b/src/designer/src/lib/shared/qdesigner_menu.cpp
@@ -58,13 +58,14 @@
#include <QtDesigner/QDesignerMetaDataBaseInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QLineEdit>
#include <QtGui/QPainter>
-#include <QtGui/QRubberBand>
-#include <QtGui/QToolTip>
-#include <QtGui/QToolBar>
+#include <QtGui/QDrag>
+#include <QtWidgets/QRubberBand>
+#include <QtWidgets/QToolTip>
+#include <QtWidgets/QToolBar>
#include <QtGui/qevent.h>
Q_DECLARE_METATYPE(QAction*)
diff --git a/src/designer/src/lib/shared/qdesigner_menu_p.h b/src/designer/src/lib/shared/qdesigner_menu_p.h
index ac11f2f52..8a93f6aa1 100644
--- a/src/designer/src/lib/shared/qdesigner_menu_p.h
+++ b/src/designer/src/lib/shared/qdesigner_menu_p.h
@@ -55,8 +55,8 @@
#include "shared_global_p.h"
-#include <QtGui/QAction>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMenu>
#include <QtGui/QPixmap>
#include <QtCore/QHash>
diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp
index ea17dcc85..f26138214 100644
--- a/src/designer/src/lib/shared/qdesigner_menubar.cpp
+++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp
@@ -59,9 +59,9 @@
#include <QtCore/qdebug.h>
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
#include <QtGui/QDrag>
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QLineEdit>
#include <QtGui/QPainter>
#include <QtGui/qevent.h>
diff --git a/src/designer/src/lib/shared/qdesigner_menubar_p.h b/src/designer/src/lib/shared/qdesigner_menubar_p.h
index d92a20464..6150b4a09 100644
--- a/src/designer/src/lib/shared/qdesigner_menubar_p.h
+++ b/src/designer/src/lib/shared/qdesigner_menubar_p.h
@@ -55,8 +55,8 @@
#include "shared_global_p.h"
-#include <QtGui/QAction>
-#include <QtGui/QMenuBar>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QMenuBar>
#include <QtCore/QPointer>
#include <QtCore/QMimeData>
diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
index 716f6491b..a79022a14 100644
--- a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
+++ b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
@@ -53,23 +53,23 @@
#include <abstractdialoggui_p.h>
#include <QtCore/QTimer>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QTreeView>
-#include <QtGui/QHeaderView>
-#include <QtGui/QPushButton>
-#include <QtGui/QItemSelectionModel>
-#include <QtGui/QItemSelection>
-#include <QtGui/QComboBox>
-#include <QtGui/QLineEdit>
-#include <QtGui/QCheckBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QItemSelectionModel>
+#include <QtWidgets/QItemSelection>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QCheckBox>
#include <QtGui/QRegExpValidator>
-#include <QtGui/QLabel>
-#include <QtGui/QSpacerItem>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QSpacerItem>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h b/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h
index 530494dc2..fe80f73cf 100644
--- a/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h
+++ b/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h
@@ -53,8 +53,8 @@
#ifndef PROMOTIONEDITORDIALOG_H
#define PROMOTIONEDITORDIALOG_H
-#include <QtGui/QDialog>
-#include <QtGui/QGroupBox>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QGroupBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
index 72e0b6175..723e01f43 100644
--- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
@@ -60,12 +60,12 @@
#include <QtCore/QSize>
#include <QtCore/QTextStream>
-#include <QtGui/QWidget>
-#include <QtGui/QApplication>
-#include <QtGui/QAction>
-#include <QtGui/QDialog>
-#include <QtGui/QPushButton>
-#include <QtGui/QLayout>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QLayout>
#include <qdebug.h>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
index e7575081f..7c864deed 100644
--- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
@@ -44,9 +44,9 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <widgetfactory_p.h>
-#include <QtGui/QAction>
-#include <QtGui/QLineEdit>
-#include <QtGui/QAbstractButton>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QAbstractButton>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
index 82099644b..0623b41e6 100644
--- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
@@ -54,16 +54,16 @@
#include <QtCore/QDebug>
-#include <QtGui/QLayout>
-#include <QtGui/QDockWidget>
-#include <QtGui/QDialog>
-#include <QtGui/QLabel>
-#include <QtGui/QGroupBox>
-#include <QtGui/QStyle>
-#include <QtGui/QApplication>
-#include <QtGui/QToolBar>
-#include <QtGui/QMainWindow>
-#include <QtGui/QMenuBar>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QDockWidget>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QMenuBar>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp
index f69135db5..547024ada 100644
--- a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp
+++ b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp
@@ -48,11 +48,11 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QToolButton>
-#include <QtGui/QAction>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QAction>
#include <QtGui/qevent.h>
-#include <QtGui/QMenu>
-#include <QtGui/QStackedWidget>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QStackedWidget>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
index d1625a291..33091625e 100644
--- a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
+++ b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
@@ -47,13 +47,14 @@
#include <QtDesigner/QDesignerFormWindowInterface>
-#include <QtGui/QApplication>
-#include <QtGui/QTabBar>
-#include <QtGui/QAction>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QTabBar>
+#include <QtWidgets/QAction>
#include <QtGui/QMouseEvent>
-#include <QtGui/QMenu>
-#include <QtGui/QLabel>
-#include <QtGui/QTabWidget>
+#include <QtGui/QDrag>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QTabWidget>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h
index 3e276e4ac..a5d548d3e 100644
--- a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h
+++ b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h
@@ -58,7 +58,7 @@
#include "qdesigner_utils_p.h"
#include <QtCore/QPointer>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
index 6b38fbd08..0dc2f4d6c 100644
--- a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
+++ b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp
@@ -75,16 +75,16 @@
#include <QtDesigner/QDesignerIntegrationInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
-#include <QtGui/QWidget>
-#include <QtGui/QMenuBar>
-#include <QtGui/QMainWindow>
-#include <QtGui/QStatusBar>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QUndoStack>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QStatusBar>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QUndoStack>
#include <QtCore/QDebug>
#include <QtCore/QSignalMapper>
#include <QtCore/QCoreApplication>
diff --git a/src/designer/src/lib/shared/qdesigner_toolbar.cpp b/src/designer/src/lib/shared/qdesigner_toolbar.cpp
index 49ebdd97a..ad17d1dd0 100644
--- a/src/designer/src/lib/shared/qdesigner_toolbar.cpp
+++ b/src/designer/src/lib/shared/qdesigner_toolbar.cpp
@@ -54,13 +54,14 @@
#include <QtDesigner/QExtensionManager>
#include <QtDesigner/QDesignerWidgetFactoryInterface>
-#include <QtGui/QAction>
-#include <QtGui/QApplication>
-#include <QtGui/QToolButton>
-#include <QtGui/QToolBar>
-#include <QtGui/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QMenu>
#include <QtGui/qevent.h>
-#include <QtGui/QApplication>
+#include <QtGui/QDrag>
+#include <QtWidgets/QApplication>
#include <QtCore/QDebug>
Q_DECLARE_METATYPE(QAction*)
diff --git a/src/designer/src/lib/shared/qdesigner_toolbar_p.h b/src/designer/src/lib/shared/qdesigner_toolbar_p.h
index 6651db534..8ce2d8c06 100644
--- a/src/designer/src/lib/shared/qdesigner_toolbar_p.h
+++ b/src/designer/src/lib/shared/qdesigner_toolbar_p.h
@@ -55,8 +55,8 @@
#include "shared_global_p.h"
-#include <QtGui/QAction>
-#include <QtGui/QToolButton>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QToolButton>
#include <QtCore/QList>
#include <QtCore/QPoint>
diff --git a/src/designer/src/lib/shared/qdesigner_toolbox.cpp b/src/designer/src/lib/shared/qdesigner_toolbox.cpp
index 59168b15c..b47ca31e4 100644
--- a/src/designer/src/lib/shared/qdesigner_toolbox.cpp
+++ b/src/designer/src/lib/shared/qdesigner_toolbox.cpp
@@ -48,11 +48,11 @@
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtCore/QEvent>
-#include <QtGui/QAction>
-#include <QtGui/QToolBox>
-#include <QtGui/QMenu>
-#include <QtGui/QLayout>
-#include <QtGui/QApplication>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QApplication>
#include <QtGui/QContextMenuEvent>
#include <QtCore/QHash>
diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp
index f40959c68..063e0873f 100644
--- a/src/designer/src/lib/shared/qdesigner_utils.cpp
+++ b/src/designer/src/lib/shared/qdesigner_utils.cpp
@@ -58,13 +58,13 @@
#include <QtCore/QQueue>
#include <QtCore/QSharedData>
-#include <QtGui/QApplication>
-#include <QtGui/QIcon>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QIcon>
#include <QtGui/QPixmap>
-#include <QtGui/QListWidget>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QTableWidget>
-#include <QtGui/QComboBox>
+#include <QtWidgets/QListWidget>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QComboBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_utils_p.h b/src/designer/src/lib/shared/qdesigner_utils_p.h
index 1899976a2..fdd244247 100644
--- a/src/designer/src/lib/shared/qdesigner_utils_p.h
+++ b/src/designer/src/lib/shared/qdesigner_utils_p.h
@@ -60,8 +60,8 @@
#include <QtCore/QVariant>
#include <QtCore/QSharedDataPointer>
#include <QtCore/QMap>
-#include <QtGui/QMainWindow>
-#include <QtGui/QIcon>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/QIcon>
#include <QtGui/QPixmap>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_widget.cpp b/src/designer/src/lib/shared/qdesigner_widget.cpp
index d7c9d50ce..5dbbf4ed8 100644
--- a/src/designer/src/lib/shared/qdesigner_widget.cpp
+++ b/src/designer/src/lib/shared/qdesigner_widget.cpp
@@ -45,8 +45,8 @@
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtGui/QPainter>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleOption>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleOption>
#include <QtGui/qevent.h>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_widget_p.h b/src/designer/src/lib/shared/qdesigner_widget_p.h
index 05d00131d..184900be9 100644
--- a/src/designer/src/lib/shared/qdesigner_widget_p.h
+++ b/src/designer/src/lib/shared/qdesigner_widget_p.h
@@ -54,8 +54,8 @@
#define QDESIGNER_WIDGET_H
#include "shared_global_p.h"
-#include <QtGui/QDialog>
-#include <QtGui/QLabel>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QLabel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qdesigner_widgetitem.cpp b/src/designer/src/lib/shared/qdesigner_widgetitem.cpp
index b5b7c3083..92e3eb930 100644
--- a/src/designer/src/lib/shared/qdesigner_widgetitem.cpp
+++ b/src/designer/src/lib/shared/qdesigner_widgetitem.cpp
@@ -49,11 +49,11 @@
#include <QtDesigner/QDesignerContainerExtension>
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QGridLayout>
-#include <QtGui/QFormLayout>
-#include <QtGui/QApplication>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QFormLayout>
+#include <QtWidgets/QApplication>
#include <QtCore/QTextStream>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/qdesigner_widgetitem_p.h b/src/designer/src/lib/shared/qdesigner_widgetitem_p.h
index f8e809ed2..288091211 100644
--- a/src/designer/src/lib/shared/qdesigner_widgetitem_p.h
+++ b/src/designer/src/lib/shared/qdesigner_widgetitem_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QLayoutItem>
+#include <QtWidgets/QLayoutItem>
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp
index f9f521356..13e9b7db2 100644
--- a/src/designer/src/lib/shared/qlayout_widget.cpp
+++ b/src/designer/src/lib/shared/qlayout_widget.cpp
@@ -53,10 +53,10 @@
#include <QtDesigner/QDesignerWidgetFactoryInterface>
#include <QtGui/QPainter>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QGridLayout>
-#include <QtGui/QFormLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QFormLayout>
#include <QtGui/qevent.h>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/shared/qlayout_widget_p.h b/src/designer/src/lib/shared/qlayout_widget_p.h
index ad4c02a02..5f046e001 100644
--- a/src/designer/src/lib/shared/qlayout_widget_p.h
+++ b/src/designer/src/lib/shared/qlayout_widget_p.h
@@ -59,8 +59,8 @@
#include <QtCore/QPointer>
#include <QtCore/QVariant>
-#include <QtGui/QWidget>
-#include <QtGui/QLayout>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QLayout>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qsimpleresource.cpp b/src/designer/src/lib/shared/qsimpleresource.cpp
index 18c14d44f..0994acfef 100644
--- a/src/designer/src/lib/shared/qsimpleresource.cpp
+++ b/src/designer/src/lib/shared/qsimpleresource.cpp
@@ -54,9 +54,9 @@
#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <QtDesigner/extrainfo.h>
-#include <QtGui/QIcon>
-#include <QtGui/QWidget>
-#include <QtGui/QAction>
+#include <QtWidgets/QIcon>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QAction>
#include <QtCore/QDebug>
#include <QtCore/QCoreApplication>
diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp
index 1ae77900e..a922da604 100644
--- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp
+++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp
@@ -53,12 +53,12 @@
#include <QtCore/QDir>
#include <QtCore/QCoreApplication>
#include <QtXml/QDomDocument>
-#include <QtGui/QMenu>
-#include <QtGui/QHeaderView>
-#include <QtGui/QInputDialog>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QStandardItemModel>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QInputDialog>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QStandardItemModel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qtresourceeditordialog_p.h b/src/designer/src/lib/shared/qtresourceeditordialog_p.h
index 52366c7f1..8562d2f63 100644
--- a/src/designer/src/lib/shared/qtresourceeditordialog_p.h
+++ b/src/designer/src/lib/shared/qtresourceeditordialog_p.h
@@ -54,7 +54,7 @@
#define QTRESOURCEEDITOR_H
#include <QtCore/QScopedPointer>
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp
index cbb05391d..765e848ec 100644
--- a/src/designer/src/lib/shared/qtresourceview.cpp
+++ b/src/designer/src/lib/shared/qtresourceview.cpp
@@ -48,24 +48,24 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerSettingsInterface>
-#include <QtGui/QToolBar>
-#include <QtGui/QAction>
-#include <QtGui/QSplitter>
-#include <QtGui/QTreeWidget>
-#include <QtGui/QListWidget>
-#include <QtGui/QHeaderView>
-#include <QtGui/QVBoxLayout>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QSplitter>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QListWidget>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QVBoxLayout>
#include <QtGui/QPainter>
#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QQueue>
#include <QtGui/QPainter>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QPushButton>
-#include <QtGui/QMessageBox>
-#include <QtGui/QApplication>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QApplication>
#include <QtGui/QClipboard>
-#include <QtGui/QMenu>
+#include <QtWidgets/QMenu>
#include <QtGui/QDrag>
#include <QtCore/QMimeData>
#include <QtXml/QDomDocument>
diff --git a/src/designer/src/lib/shared/qtresourceview_p.h b/src/designer/src/lib/shared/qtresourceview_p.h
index 312ef5728..19e69942e 100644
--- a/src/designer/src/lib/shared/qtresourceview_p.h
+++ b/src/designer/src/lib/shared/qtresourceview_p.h
@@ -54,8 +54,8 @@
#define QTRESOURCEVIEW_H
#include "shared_global_p.h"
-#include <QtGui/QWidget>
-#include <QtGui/QDialog>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/richtexteditor.cpp b/src/designer/src/lib/shared/richtexteditor.cpp
index 54b22e487..c53cc3a1f 100644
--- a/src/designer/src/lib/shared/richtexteditor.cpp
+++ b/src/designer/src/lib/shared/richtexteditor.cpp
@@ -56,24 +56,24 @@
#include <QtCore/QXmlStreamWriter>
#include <QtCore/QXmlStreamAttributes>
-#include <QtGui/QAction>
-#include <QtGui/QColorDialog>
-#include <QtGui/QComboBox>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QColorDialog>
+#include <QtWidgets/QComboBox>
#include <QtGui/QFontDatabase>
#include <QtGui/QTextCursor>
#include <QtGui/QPainter>
-#include <QtGui/QIcon>
-#include <QtGui/QMenu>
+#include <QtWidgets/QIcon>
+#include <QtWidgets/QMenu>
#include <QtGui/QMoveEvent>
-#include <QtGui/QTabWidget>
+#include <QtWidgets/QTabWidget>
#include <QtGui/QTextDocument>
#include <QtGui/QTextBlock>
-#include <QtGui/QToolBar>
-#include <QtGui/QToolButton>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QPushButton>
-#include <QtGui/QDialogButtonBox>
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QToolButton>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QDialogButtonBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/richtexteditor_p.h b/src/designer/src/lib/shared/richtexteditor_p.h
index b6343eb53..df7af4958 100644
--- a/src/designer/src/lib/shared/richtexteditor_p.h
+++ b/src/designer/src/lib/shared/richtexteditor_p.h
@@ -53,8 +53,8 @@
#ifndef RICHTEXTEDITOR_H
#define RICHTEXTEDITOR_H
-#include <QtGui/QTextEdit>
-#include <QtGui/QDialog>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QDialog>
#include "shared_global_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/scriptdialog.cpp b/src/designer/src/lib/shared/scriptdialog.cpp
index 38967217f..a8a811d14 100644
--- a/src/designer/src/lib/shared/scriptdialog.cpp
+++ b/src/designer/src/lib/shared/scriptdialog.cpp
@@ -44,11 +44,11 @@
#include <abstractdialoggui_p.h>
-#include <QtGui/QTextEdit>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QMessageBox>
#ifdef QT_SCRIPT_LIB
#include <QtScript/QScriptEngine>
#endif
diff --git a/src/designer/src/lib/shared/scriptdialog_p.h b/src/designer/src/lib/shared/scriptdialog_p.h
index 639fb5fce..4aea34865 100644
--- a/src/designer/src/lib/shared/scriptdialog_p.h
+++ b/src/designer/src/lib/shared/scriptdialog_p.h
@@ -55,7 +55,7 @@
#include "shared_global_p.h"
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/scripterrordialog.cpp b/src/designer/src/lib/shared/scripterrordialog.cpp
index 04e012406..aa71b0192 100644
--- a/src/designer/src/lib/shared/scripterrordialog.cpp
+++ b/src/designer/src/lib/shared/scripterrordialog.cpp
@@ -41,11 +41,11 @@
#include "scripterrordialog_p.h"
-#include <QtGui/QTextEdit>
+#include <QtWidgets/QTextEdit>
#include <QtGui/QTextCursor>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QHBoxLayout>
-#include <QtGui/QDialogButtonBox>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QDialogButtonBox>
#include <QtGui/QPen>
#include <QtCore/QCoreApplication>
diff --git a/src/designer/src/lib/shared/scripterrordialog_p.h b/src/designer/src/lib/shared/scripterrordialog_p.h
index 393579ac3..938220a14 100644
--- a/src/designer/src/lib/shared/scripterrordialog_p.h
+++ b/src/designer/src/lib/shared/scripterrordialog_p.h
@@ -56,7 +56,7 @@
#include "shared_global_p.h"
#include <QtDesigner/private/formscriptrunner_p.h>
-#include <QtGui/QDialog>
+#include <QtWidgets/QDialog>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/shared.pri b/src/designer/src/lib/shared/shared.pri
index 63ba68794..fd7d9ec7e 100644
--- a/src/designer/src/lib/shared/shared.pri
+++ b/src/designer/src/lib/shared/shared.pri
@@ -1,7 +1,5 @@
INCLUDEPATH += $$PWD
-# -- widgets.table from uilib.
-INCLUDEPATH *= $$QT.uilib.sources
contains(QT_CONFIG, script): QT += script
include(../../../../shared/qtpropertybrowser/qtpropertybrowserutils.pri)
diff --git a/src/designer/src/lib/shared/sheet_delegate.cpp b/src/designer/src/lib/shared/sheet_delegate.cpp
index f4aadea9f..94fbdf4cd 100644
--- a/src/designer/src/lib/shared/sheet_delegate.cpp
+++ b/src/designer/src/lib/shared/sheet_delegate.cpp
@@ -42,8 +42,8 @@
#include "sheet_delegate_p.h"
#include <QtCore/QAbstractItemModel>
-#include <QtGui/QTreeView>
-#include <QtGui/QStyle>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QStyle>
#include <QtGui/QPainter>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/sheet_delegate_p.h b/src/designer/src/lib/shared/sheet_delegate_p.h
index 0e7424412..1634e6542 100644
--- a/src/designer/src/lib/shared/sheet_delegate_p.h
+++ b/src/designer/src/lib/shared/sheet_delegate_p.h
@@ -56,8 +56,8 @@
#include "shared_global_p.h"
-#include <QtGui/QItemDelegate>
-#include <QtGui/QTreeView>
+#include <QtWidgets/QItemDelegate>
+#include <QtWidgets/QTreeView>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/signalslotdialog.cpp b/src/designer/src/lib/shared/signalslotdialog.cpp
index 4c3c7dbf4..59f263fba 100644
--- a/src/designer/src/lib/shared/signalslotdialog.cpp
+++ b/src/designer/src/lib/shared/signalslotdialog.cpp
@@ -54,12 +54,12 @@
#include <QtDesigner/QDesignerWidgetFactoryInterface>
#include <abstractdialoggui_p.h>
-#include <QtGui/QStandardItemModel>
+#include <QtWidgets/QStandardItemModel>
#include <QtGui/QRegExpValidator>
-#include <QtGui/QItemDelegate>
-#include <QtGui/QLineEdit>
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QItemDelegate>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMessageBox>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
diff --git a/src/designer/src/lib/shared/signalslotdialog_p.h b/src/designer/src/lib/shared/signalslotdialog_p.h
index 412666da7..f96c1b33b 100644
--- a/src/designer/src/lib/shared/signalslotdialog_p.h
+++ b/src/designer/src/lib/shared/signalslotdialog_p.h
@@ -55,8 +55,8 @@
#include "shared_global_p.h"
#include <QtCore/QStringList>
-#include <QtGui/QDialog>
-#include <QtGui/QStandardItemModel>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QStandardItemModel>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/spacer_widget.cpp b/src/designer/src/lib/shared/spacer_widget.cpp
index bd9064039..4203ab068 100644
--- a/src/designer/src/lib/shared/spacer_widget.cpp
+++ b/src/designer/src/lib/shared/spacer_widget.cpp
@@ -48,7 +48,7 @@
#include <QtDesigner/QDesignerPropertySheetExtension>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QLayout>
+#include <QtWidgets/QLayout>
#include <QtGui/QPainter>
#include <QtGui/qevent.h>
#include <QtCore/qdebug.h>
diff --git a/src/designer/src/lib/shared/spacer_widget_p.h b/src/designer/src/lib/shared/spacer_widget_p.h
index 0ea84438b..1247a7bc8 100644
--- a/src/designer/src/lib/shared/spacer_widget_p.h
+++ b/src/designer/src/lib/shared/spacer_widget_p.h
@@ -56,8 +56,8 @@
#include "shared_global_p.h"
-#include <QtGui/QWidget>
-#include <QtGui/QSizePolicy>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QSizePolicy>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/stylesheeteditor.cpp b/src/designer/src/lib/shared/stylesheeteditor.cpp
index 670253510..6afdfaeb1 100644
--- a/src/designer/src/lib/shared/stylesheeteditor.cpp
+++ b/src/designer/src/lib/shared/stylesheeteditor.cpp
@@ -56,16 +56,16 @@
#include <QtDesigner/QExtensionManager>
#include <QtCore/QSignalMapper>
-#include <QtGui/QAction>
-#include <QtGui/QColorDialog>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QFontDialog>
-#include <QtGui/QMenu>
-#include <QtGui/QPushButton>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QColorDialog>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QFontDialog>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QPushButton>
#include <QtGui/QTextDocument>
-#include <QtGui/QToolBar>
-#include <QtGui/QVBoxLayout>
-#include "private/qcssparser_p.h"
+#include <QtWidgets/QToolBar>
+#include <QtWidgets/QVBoxLayout>
+#include <private/qcssparser_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/stylesheeteditor_p.h b/src/designer/src/lib/shared/stylesheeteditor_p.h
index e14216a5f..76c1587ec 100644
--- a/src/designer/src/lib/shared/stylesheeteditor_p.h
+++ b/src/designer/src/lib/shared/stylesheeteditor_p.h
@@ -53,9 +53,9 @@
#ifndef STYLESHEETEDITOR_H
#define STYLESHEETEDITOR_H
-#include <QtGui/QTextEdit>
-#include <QtGui/QDialog>
-#include <QtGui/QLabel>
+#include <QtWidgets/QTextEdit>
+#include <QtWidgets/QDialog>
+#include <QtWidgets/QLabel>
#include "shared_global_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/textpropertyeditor.cpp b/src/designer/src/lib/shared/textpropertyeditor.cpp
index 65196cf3f..00bc2cfef 100644
--- a/src/designer/src/lib/shared/textpropertyeditor.cpp
+++ b/src/designer/src/lib/shared/textpropertyeditor.cpp
@@ -43,11 +43,11 @@
#include "propertylineedit_p.h"
#include "stylesheeteditor_p.h"
-#include <QtGui/QLineEdit>
+#include <QtWidgets/QLineEdit>
#include <QtGui/QRegExpValidator>
#include <QtGui/QResizeEvent>
-#include <QtGui/QCompleter>
-#include <QtGui/QAbstractItemView>
+#include <QtWidgets/QCompleter>
+#include <QtWidgets/QAbstractItemView>
#include <QtCore/QRegExp>
#include <QtCore/QUrl>
#include <QtCore/QFile>
diff --git a/src/designer/src/lib/shared/textpropertyeditor_p.h b/src/designer/src/lib/shared/textpropertyeditor_p.h
index e4098284a..4f4cacb6b 100644
--- a/src/designer/src/lib/shared/textpropertyeditor_p.h
+++ b/src/designer/src/lib/shared/textpropertyeditor_p.h
@@ -56,7 +56,7 @@
#include "shared_global_p.h"
#include "shared_enums_p.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/shared/widgetdatabase_p.h b/src/designer/src/lib/shared/widgetdatabase_p.h
index 41bd690f2..7644da6b2 100644
--- a/src/designer/src/lib/shared/widgetdatabase_p.h
+++ b/src/designer/src/lib/shared/widgetdatabase_p.h
@@ -58,7 +58,7 @@
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
#include <QtCore/QString>
#include <QtCore/QVariant>
#include <QtCore/QPair>
diff --git a/src/designer/src/lib/shared/widgetfactory.cpp b/src/designer/src/lib/shared/widgetfactory.cpp
index f9e590f0b..7b61c6976 100644
--- a/src/designer/src/lib/shared/widgetfactory.cpp
+++ b/src/designer/src/lib/shared/widgetfactory.cpp
@@ -70,15 +70,15 @@
#include <QtDesigner/QDesignerFormWindowManagerInterface>
#include <QtDesigner/QDesignerFormWindowCursorInterface>
-#include <QtGui/QtGui>
-#include <QtGui/QScrollBar>
-#include <QtGui/QFontComboBox>
-#include <QtGui/QAbstractSpinBox>
-#include <QtGui/QLineEdit>
-#include <QtGui/QButtonGroup>
-#include <QtGui/QStyle>
-#include <QtGui/QStyleFactory>
-#include <QtGui/QWizard>
+#include <QtWidgets/QtWidgets>
+#include <QtWidgets/QScrollBar>
+#include <QtWidgets/QFontComboBox>
+#include <QtWidgets/QAbstractSpinBox>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QWizard>
#include <QtCore/qdebug.h>
#include <QtCore/QMetaObject>
diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp
index 13e1e688e..7ca6491ff 100644
--- a/src/designer/src/lib/shared/zoomwidget.cpp
+++ b/src/designer/src/lib/shared/zoomwidget.cpp
@@ -41,13 +41,13 @@
#include "zoomwidget_p.h"
-#include <QtGui/QGraphicsScene>
-#include <QtGui/QGraphicsProxyWidget>
-#include <QtGui/QMenu>
-#include <QtGui/QAction>
-#include <QtGui/QActionGroup>
+#include <QtWidgets/QGraphicsScene>
+#include <QtWidgets/QGraphicsProxyWidget>
+#include <QtWidgets/QMenu>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
#include <QtGui/QContextMenuEvent>
-#include <QtGui/QScrollBar>
+#include <QtWidgets/QScrollBar>
#include <QtCore/QTextStream>
#include <QtCore/qmath.h>
diff --git a/src/designer/src/lib/shared/zoomwidget_p.h b/src/designer/src/lib/shared/zoomwidget_p.h
index ad9b12db8..62e37166f 100644
--- a/src/designer/src/lib/shared/zoomwidget_p.h
+++ b/src/designer/src/lib/shared/zoomwidget_p.h
@@ -55,8 +55,8 @@
#include "shared_global_p.h"
-#include <QtGui/QGraphicsView>
-#include <QtGui/QGraphicsProxyWidget>
+#include <QtWidgets/QGraphicsView>
+#include <QtWidgets/QGraphicsProxyWidget>
#include <QtCore/QList>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp
new file mode 100644
index 000000000..da64a5ee2
--- /dev/null
+++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -0,0 +1,3154 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**sw
+****************************************************************************/
+
+#include "abstractformbuilder.h"
+#include "formbuilderextra_p.h"
+#include "resourcebuilder_p.h"
+#include "textbuilder_p.h"
+#include "ui4_p.h"
+#include "properties_p.h"
+
+#include <QtCore/QVariant>
+#include <QtCore/QMetaProperty>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtCore/QQueue>
+#include <QtCore/QHash>
+#include <QtCore/QPair>
+#include <QtCore/qdebug.h>
+#include <QtCore/QCoreApplication>
+
+#include <QtGui/QtGui>
+#include <QtWidgets/QtWidgets>
+#ifndef QFORMINTERNAL_NAMESPACE
+# include <private/qlayout_p.h> // Compiling within Designer
+#endif
+
+#include <QtCore/QXmlStreamReader>
+
+#include <QtCore/qdebug.h>
+
+#include <limits.h>
+
+Q_DECLARE_METATYPE(QWidgetList)
+
+static const char *buttonGroupPropertyC = "buttonGroup";
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+using namespace QFormInternal;
+#endif
+
+class QFriendlyLayout: public QLayout
+{
+public:
+ inline QFriendlyLayout() { Q_ASSERT(0); }
+
+#ifdef QFORMINTERNAL_NAMESPACE
+ friend class QFormInternal::QAbstractFormBuilder;
+#else
+ friend class QAbstractFormBuilder;
+#endif
+};
+
+/*!
+ \class QAbstractFormBuilder
+
+ \brief The QAbstractFormBuilder class provides a default
+ implementation for classes that create user interfaces at
+ run-time.
+
+ \inmodule QtDesigner
+
+ QAbstractFormBuilder provides a standard interface and a default
+ implementation for constructing forms from user interface
+ files. It is not intended to be instantiated directly. Use the
+ QFormBuilder class to create user interfaces from UI files at
+ run-time. For example:
+
+ \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp 0
+
+ To override certain aspects of the form builder's behavior,
+ subclass QAbstractFormBuilder and reimplement the relevant virtual
+ functions:
+
+ \list
+ \o load() handles reading of UI format files from arbitrary
+ QIODevices, and construction of widgets from the XML data
+ that they contain.
+ \o save() handles saving of widget details in UI format to
+ arbitrary QIODevices.
+ \o workingDirectory() and setWorkingDirectory() control the
+ directory in which forms are held. The form builder looks for
+ other resources on paths relative to this directory.
+ \endlist
+
+ The QFormBuilder class is typically used by custom components and
+ applications that embed \QD. Standalone applications that need to
+ dynamically generate user interfaces at run-time use the
+ QUiLoader, found in the QtUiTools module.
+
+ \sa {QtUiTools Module}
+*/
+
+/*!
+ Constructs a new form builder.*/
+QAbstractFormBuilder::QAbstractFormBuilder() : d(new QFormBuilderExtra)
+{
+ setResourceBuilder(new QResourceBuilder());
+ setTextBuilder(new QTextBuilder());
+}
+
+/*!
+ Destroys the form builder.*/
+QAbstractFormBuilder::~QAbstractFormBuilder()
+{
+}
+
+// Return UI file version from attribute 'version="4.0"'
+static QPair<int, int> uiVersion(const QString &attr)
+{
+ const QStringList versions = attr.split(QLatin1Char('.'), QString::SkipEmptyParts);
+ if (versions.size() >= 2) {
+ bool okMajor, okMinor;
+ const int majorVersion = versions.at(0).toInt(&okMajor);
+ const int minorVersion = versions.at(1).toInt(&okMinor);
+ if (okMajor && okMinor)
+ return QPair<int, int>(majorVersion, minorVersion);
+ }
+ return QPair<int, int>(-1, -1);
+}
+
+static inline QString msgXmlError(const QXmlStreamReader &reader)
+{
+ return QCoreApplication::translate("QAbstractFormBuilder", "An error has occurred while reading the UI file at line %1, column %2: %3")
+ .arg(reader.lineNumber()).arg(reader.columnNumber()).arg(reader.errorString());
+}
+
+// Read and check the version and the (optional) language attribute
+// of an <ui> element and leave reader positioned at <ui>.
+static bool inline readUiAttributes(QXmlStreamReader &reader, const QString &language, QString *errorMessage)
+{
+ const QString uiElement = QLatin1String("ui");
+ // Read up to first element
+ while (!reader.atEnd()) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::Invalid:
+ *errorMessage = msgXmlError(reader);
+ return false;
+ case QXmlStreamReader::StartElement:
+ if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0) {
+ const QString versionAttribute = QLatin1String("version");
+ const QString languageAttribute = QLatin1String("language");
+ const QXmlStreamAttributes attributes = reader.attributes();
+ if (attributes.hasAttribute(versionAttribute)) {
+ const QString versionString = attributes.value(versionAttribute).toString();
+ if (uiVersion(versionString).first < 4) {
+ *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "This file was created using Designer from Qt-%1 and cannot be read.")
+ .arg(versionString);
+ return false;
+ } // version error
+ } // has version
+ if (attributes.hasAttribute(languageAttribute)) {
+ // Check on optional language (Jambi)
+ const QString formLanguage = attributes.value(languageAttribute).toString();
+ if (!formLanguage.isEmpty() && formLanguage.compare(language, Qt::CaseInsensitive)) {
+ *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "This file cannot be read because it was created using %1.").arg(formLanguage);
+ return false;
+ } // language error
+ } // has language
+ return true;
+ } // <ui> matched
+ break;
+ default:
+ break;
+ }
+ }
+ // No <ui> found.
+ *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "Invalid UI file: The root element <ui> is missing.");
+ return false;
+}
+
+/*!
+ \fn QWidget *QAbstractFormBuilder::load(QIODevice *device, QWidget *parent)
+
+ Loads an XML representation of a widget from the given \a device,
+ and constructs a new widget with the specified \a parent.
+
+ \sa save(), errorString()
+*/
+QWidget *QAbstractFormBuilder::load(QIODevice *dev, QWidget *parentWidget)
+{
+ QXmlStreamReader reader(dev);
+ d->m_errorString.clear();
+ if (!readUiAttributes(reader, d->m_language, &d->m_errorString)) {
+ uiLibWarning(d->m_errorString);
+ return false;
+ }
+ DomUI ui;
+ ui.read(reader);
+ if (reader.hasError()) {
+ d->m_errorString = msgXmlError(reader);
+ uiLibWarning(d->m_errorString);
+ return 0;
+ }
+
+ QWidget *widget = create(&ui, parentWidget);
+ if (!widget && d->m_errorString.isEmpty())
+ d->m_errorString = QCoreApplication::translate("QAbstractFormBuilder", "Invalid UI file");
+ return widget;
+}
+
+/*!
+ \internal
+*/
+QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget)
+{
+ typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash;
+
+ d->clear();
+ if (const DomLayoutDefault *def = ui->elementLayoutDefault()) {
+ d->m_defaultMargin = def->hasAttributeMargin() ? def->attributeMargin() : INT_MIN;
+ d->m_defaultSpacing = def->hasAttributeSpacing() ? def->attributeSpacing() : INT_MIN;
+ }
+
+ DomWidget *ui_widget = ui->elementWidget();
+ if (!ui_widget)
+ return 0;
+
+ initialize(ui);
+
+ if (const DomButtonGroups *domButtonGroups = ui->elementButtonGroups())
+ d->registerButtonGroups(domButtonGroups);
+
+ if (QWidget *widget = create(ui_widget, parentWidget)) {
+ // Reparent button groups that were actually created to main container for them to be found in the signal/slot part
+ const ButtonGroupHash &buttonGroups = d->buttonGroups();
+ if (!buttonGroups.empty()) {
+ const ButtonGroupHash::const_iterator cend = buttonGroups.constEnd();
+ for (ButtonGroupHash::const_iterator it = buttonGroups.constBegin(); it != cend; ++it)
+ if (it.value().second)
+ it.value().second->setParent(widget);
+ }
+ createConnections(ui->elementConnections(), widget);
+ createResources(ui->elementResources()); // maybe this should go first, before create()...
+ applyTabStops(widget, ui->elementTabStops());
+ d->applyInternalProperties();
+ reset();
+ d->clear();
+ return widget;
+ }
+ d->clear();
+ return 0;
+}
+
+/*!
+ \internal
+ Retrieve relevant information from the custom widgets section.
+ Called by create(DomUI *, QWidget *); call manually if you
+ just use create(DomWidget *, QWidget *) on some child widget of DomUI.
+ */
+
+void QAbstractFormBuilder::initialize(const DomUI *ui)
+{
+ typedef QList<DomCustomWidget*> DomCustomWidgetList;
+
+ DomCustomWidgets *domCustomWidgets = ui->elementCustomWidgets();
+ createCustomWidgets(domCustomWidgets);
+
+ if (domCustomWidgets) {
+ const DomCustomWidgetList customWidgets = domCustomWidgets->elementCustomWidget();
+ if (!customWidgets.empty()) {
+ const DomCustomWidgetList::const_iterator cend = customWidgets.constEnd();
+ for (DomCustomWidgetList::const_iterator it = customWidgets.constBegin(); it != cend; ++it)
+ d->storeCustomWidgetData((*it)->elementClass(), *it);
+ }
+ }
+}
+
+/*!
+ \internal
+*/
+QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget)
+{
+ QWidget *w = createWidget(ui_widget->attributeClass(), parentWidget, ui_widget->attributeName());
+ if (!w)
+ return 0;
+
+ applyProperties(w, ui_widget->elementProperty());
+
+ foreach (DomAction *ui_action, ui_widget->elementAction()) {
+ QAction *child_action = create(ui_action, w);
+ Q_UNUSED( child_action );
+ }
+
+ foreach (DomActionGroup *ui_action_group, ui_widget->elementActionGroup()) {
+ QActionGroup *child_action_group = create(ui_action_group, w);
+ Q_UNUSED( child_action_group );
+ }
+
+ QWidgetList children;
+ foreach (DomWidget *ui_child, ui_widget->elementWidget()) {
+ if (QWidget *child = create(ui_child, w)) {
+ children += child;
+ } else {
+ const QString className = ui_child->elementClass().empty() ? QString() : ui_child->elementClass().front();
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "The creation of a widget of the class '%1' failed.").arg(className));
+ }
+ }
+
+ foreach (DomLayout *ui_lay, ui_widget->elementLayout()) {
+ QLayout *child_lay = create(ui_lay, 0, w);
+ Q_UNUSED( child_lay );
+ }
+
+ const QList<DomActionRef *> addActions = ui_widget->elementAddAction();
+ if (!addActions.empty()) {
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ foreach (DomActionRef *ui_action_ref, addActions) {
+ const QString name = ui_action_ref->attributeName();
+ if (name == strings.separator) {
+ QAction *sep = new QAction(w);
+ sep->setSeparator(true);
+ w->addAction(sep);
+ addMenuAction(sep);
+ } else if (QAction *a = d->m_actions.value(name)) {
+ w->addAction(a);
+ } else if (QActionGroup *g = d->m_actionGroups.value(name)) {
+ w->addActions(g->actions());
+ } else if (QMenu *menu = w->findChild<QMenu*>(name)) {
+ w->addAction(menu->menuAction());
+ addMenuAction(menu->menuAction());
+ }
+ }
+ }
+
+ loadExtraInfo(ui_widget, w, parentWidget);
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ QString scriptErrorMessage;
+ d->formScriptRunner().run(ui_widget,
+ d->customWidgetScript(ui_widget->attributeClass()),
+ w, children, &scriptErrorMessage);
+#endif
+ addItem(ui_widget, w, parentWidget);
+
+ if (qobject_cast<QDialog *>(w) && parentWidget)
+ w->setAttribute(Qt::WA_Moved, false); // So that QDialog::setVisible(true) will center it
+
+ const QStringList zOrderNames = ui_widget->elementZOrder();
+ if (!zOrderNames.isEmpty()) {
+ QList<QWidget *> zOrder = qvariant_cast<QWidgetList>(w->property("_q_zOrder"));
+ foreach (const QString &widgetName, zOrderNames) {
+ if (QWidget *child = w->findChild<QWidget*>(widgetName)) {
+ if (child->parentWidget() == w) {
+ zOrder.removeAll(child);
+ zOrder.append(child);
+ child->raise();
+ }
+ }
+ }
+ w->setProperty("_q_zOrder", QVariant::fromValue(zOrder));
+ }
+
+ return w;
+}
+
+/*!
+ \internal
+*/
+QAction *QAbstractFormBuilder::create(DomAction *ui_action, QObject *parent)
+{
+ QAction *a = createAction(parent, ui_action->attributeName());
+ if (!a)
+ return 0;
+
+ d->m_actions.insert(ui_action->attributeName(), a);
+ applyProperties(a, ui_action->elementProperty());
+ return a;
+}
+
+/*!
+ \internal
+*/
+QActionGroup *QAbstractFormBuilder::create(DomActionGroup *ui_action_group, QObject *parent)
+{
+ QActionGroup *a = createActionGroup(parent, ui_action_group->attributeName());
+ if (!a)
+ return 0;
+ d->m_actionGroups.insert(ui_action_group->attributeName(), a);
+ applyProperties(a, ui_action_group->elementProperty());
+
+ foreach (DomAction *ui_action, ui_action_group->elementAction()) {
+ QAction *child_action = create(ui_action, a);
+ Q_UNUSED( child_action );
+ }
+
+ foreach (DomActionGroup *g, ui_action_group->elementActionGroup()) {
+ QActionGroup *child_action_group = create(g, parent);
+ Q_UNUSED( child_action_group );
+ }
+
+ return a;
+}
+
+// figure out the toolbar area of a DOM attrib list.
+// By legacy, it is stored as an integer. As of 4.3.0, it is the enumeration value.
+Qt::ToolBarArea QAbstractFormBuilder::toolbarAreaFromDOMAttributes(const DomPropertyHash &attributes) {
+ const DomProperty *attr = attributes.value(QFormBuilderStrings::instance().toolBarAreaAttribute);
+ if (!attr)
+ return Qt::TopToolBarArea;
+ switch(attr->kind()) {
+ case DomProperty::Number:
+ return static_cast<Qt::ToolBarArea>(attr->elementNumber());
+ case DomProperty::Enum:
+ return enumKeyOfObjectToValue<QAbstractFormBuilderGadget, Qt::ToolBarArea>("toolBarArea", attr->elementEnum().toLatin1());
+ default:
+ break;
+ }
+ return Qt::TopToolBarArea;
+}
+
+/*!
+ \internal
+*/
+bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
+{
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute());
+
+ if (parentWidget == 0)
+ return true;
+ // Check special cases. First: Custom container
+ const QString className = QLatin1String(parentWidget->metaObject()->className());
+ const QString addPageMethod = d->customWidgetAddPageMethod(className);
+ if (!addPageMethod.isEmpty()) {
+ // If this fails ( non-existent or non-slot), use ContainerExtension in Designer, else it can't be helped
+ return QMetaObject::invokeMethod(parentWidget, addPageMethod.toUtf8().constData(), Qt::DirectConnection, Q_ARG(QWidget*, widget));
+ }
+
+ if (QMainWindow *mw = qobject_cast<QMainWindow*>(parentWidget)) {
+
+#ifndef QT_NO_MENUBAR
+ // the menubar
+ if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(widget)) {
+ mw->setMenuBar(menuBar);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_TOOLBAR
+ // apply the toolbar's attributes
+ else if (QToolBar *toolBar = qobject_cast<QToolBar*>(widget)) {
+ mw->addToolBar(toolbarAreaFromDOMAttributes(attributes), toolBar);
+ // check break
+ if (const DomProperty *attr = attributes.value(strings.toolBarBreakAttribute))
+ if (attr->elementBool() == strings.trueValue)
+ mw->insertToolBarBreak (toolBar);
+
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_STATUSBAR
+ // statusBar
+ else if (QStatusBar *statusBar = qobject_cast<QStatusBar*>(widget)) {
+ mw->setStatusBar(statusBar);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_DOCKWIDGET
+ // apply the dockwidget's attributes
+ else if (QDockWidget *dockWidget = qobject_cast<QDockWidget*>(widget)) {
+ if (const DomProperty *attr = attributes.value(strings.dockWidgetAreaAttribute)) {
+ Qt::DockWidgetArea area = static_cast<Qt::DockWidgetArea>(attr->elementNumber());
+ if (!dockWidget->isAreaAllowed(area)) {
+ if (dockWidget->isAreaAllowed(Qt::LeftDockWidgetArea))
+ area = Qt::LeftDockWidgetArea;
+ else if (dockWidget->isAreaAllowed(Qt::RightDockWidgetArea))
+ area = Qt::RightDockWidgetArea;
+ else if (dockWidget->isAreaAllowed(Qt::TopDockWidgetArea))
+ area = Qt::TopDockWidgetArea;
+ else if (dockWidget->isAreaAllowed(Qt::BottomDockWidgetArea))
+ area = Qt::BottomDockWidgetArea;
+ }
+ mw->addDockWidget(area, dockWidget);
+ } else {
+ mw->addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
+ }
+ return true;
+ }
+#endif
+
+ else if (! mw->centralWidget()) {
+ mw->setCentralWidget(widget);
+ return true;
+ }
+ }
+
+#ifndef QT_NO_TABWIDGET
+ else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(parentWidget)) {
+ widget->setParent(0);
+
+ const int tabIndex = tabWidget->count();
+ if (const DomProperty *titleP = attributes.value(strings.titleAttribute, 0))
+ tabWidget->addTab(widget, toString(titleP->elementString()));
+ else
+ tabWidget->addTab(widget, strings.defaultTitle);
+
+ if (DomProperty *picon = attributes.value(strings.iconAttribute)) {
+ QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon);
+ QVariant nativeValue = resourceBuilder()->toNativeValue(v);
+ tabWidget->setTabIcon(tabIndex, qvariant_cast<QIcon>(nativeValue));
+ }
+
+#ifndef QT_NO_TOOLTIP
+ if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) {
+ tabWidget->setTabToolTip(tabIndex, toString(ptoolTip->elementString()));
+ }
+#endif
+
+#ifndef QT_NO_WHATSTHIS
+ if (const DomProperty *pwhatsThis = attributes.value(strings.whatsThisAttribute)) {
+ tabWidget->setTabWhatsThis(tabIndex, toString(pwhatsThis->elementString()));
+ }
+#endif
+
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_TOOLBOX
+ else if (QToolBox *toolBox = qobject_cast<QToolBox*>(parentWidget)) {
+ const int tabIndex = toolBox->count();
+ if (const DomProperty *labelP = attributes.value(strings.labelAttribute, 0))
+ toolBox->addItem(widget, toString(labelP->elementString()));
+ else
+ toolBox->addItem(widget, strings.defaultTitle);
+
+ if (DomProperty *picon = attributes.value(strings.iconAttribute)) {
+ QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon);
+ QVariant nativeValue = resourceBuilder()->toNativeValue(v);
+ toolBox->setItemIcon(tabIndex, qvariant_cast<QIcon>(nativeValue));
+ }
+
+#ifndef QT_NO_TOOLTIP
+ if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) {
+ toolBox->setItemToolTip(tabIndex, toString(ptoolTip->elementString()));
+ }
+#endif
+
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_STACKEDWIDGET
+ else if (QStackedWidget *stackedWidget = qobject_cast<QStackedWidget*>(parentWidget)) {
+ stackedWidget->addWidget(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_SPLITTER
+ else if (QSplitter *splitter = qobject_cast<QSplitter*>(parentWidget)) {
+ splitter->addWidget(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_MDIAREA
+ else if (QMdiArea *mdiArea = qobject_cast<QMdiArea*>(parentWidget)) {
+ mdiArea->addSubWindow(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_WORKSPACE
+ else if (QWorkspace *ws = qobject_cast<QWorkspace*>(parentWidget)) {
+ ws->addWindow(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_DOCKWIDGET
+ else if (QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget)) {
+ dockWidget->setWidget(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_SCROLLAREA
+ else if (QScrollArea *scrollArea = qobject_cast<QScrollArea*>(parentWidget)) {
+ scrollArea->setWidget(widget);
+ return true;
+ }
+#endif
+
+#ifndef QT_NO_WIZARD
+ else if (QWizard *wizard = qobject_cast<QWizard *>(parentWidget)) {
+ QWizardPage *page = qobject_cast<QWizardPage*>(widget);
+ if (!page) {
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Attempt to add child that is not of class QWizardPage to QWizard."));
+ return false;
+ }
+ wizard->addPage(page);
+ return true;
+ }
+#endif
+ return false;
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::layoutInfo(DomLayout *ui_layout, QObject *parent, int *margin, int *spacing)
+{
+ Q_UNUSED(parent)
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ const DomPropertyHash properties = propertyMap(ui_layout->elementProperty());
+
+ int mar = INT_MIN;
+ int spac = INT_MIN;
+ if (const DomProperty *p = properties.value(strings.marginProperty, 0))
+ mar = p->elementNumber();
+
+ if (const DomProperty *p = properties.value(strings.spacingProperty, 0))
+ spac = p->elementNumber();
+
+#ifdef Q_OS_MAC
+ // here we recognize UI file < 4.3 (no we don't store margin property)
+ if (mar != INT_MIN) {
+ const int defaultMargin = parent->inherits("QLayoutWidget") ? 0 : 9;
+ if (mar == defaultMargin)
+ mar = INT_MIN;
+ if (spac == 6)
+ spac = INT_MIN;
+
+ if (mar == INT_MIN || spac == INT_MIN) {
+ QList<DomProperty *> properties = ui_layout->elementProperty();
+ QMutableListIterator<DomProperty *> it(properties);
+ while (it.hasNext()) {
+ DomProperty *prop = it.next();
+ if ((mar == INT_MIN && prop->attributeName() == strings.marginProperty) ||
+ (spac == INT_MIN && prop->attributeName() == strings.spacingProperty)) {
+ it.remove();
+ delete prop;
+ }
+ }
+ ui_layout->setElementProperty(properties);
+ }
+ }
+#endif
+ if (margin)
+ *margin = mar;
+ if (spacing)
+ *spacing = spac;
+}
+
+/*!
+ \internal
+*/
+QLayout *QAbstractFormBuilder::create(DomLayout *ui_layout, QLayout *parentLayout, QWidget *parentWidget)
+{
+ QObject *p = parentLayout;
+
+ if (p == 0)
+ p = parentWidget;
+
+ Q_ASSERT(p != 0);
+
+ bool tracking = false;
+
+ if (p == parentWidget && parentWidget->layout()) {
+ tracking = true;
+ p = parentWidget->layout();
+ }
+
+ QLayout *layout = createLayout(ui_layout->attributeClass(), p, ui_layout->hasAttributeName() ? ui_layout->attributeName() : QString());
+
+ if (layout == 0)
+ return 0;
+
+ if (tracking && layout->parent() == 0) {
+ QBoxLayout *box = qobject_cast<QBoxLayout*>(parentWidget->layout());
+ if (!box) { // only QBoxLayout is supported
+ const QString widgetClass = QString::fromUtf8(parentWidget->metaObject()->className());
+ const QString layoutClass = QString::fromUtf8(parentWidget->layout()->metaObject()->className());
+ const QString msg = QCoreApplication::translate("QAbstractFormBuilder", "Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3.\n"
+ "This indicates an inconsistency in the ui-file.").
+ arg(parentWidget->objectName(), widgetClass, layoutClass);
+ uiLibWarning(msg);
+ return 0;
+ }
+ box->addLayout(layout);
+ }
+
+ int margin = INT_MIN, spacing = INT_MIN;
+ layoutInfo(ui_layout, p, &margin, &spacing);
+
+ if (margin != INT_MIN) {
+ layout->setMargin(margin);
+ } else {
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ int left, top, right, bottom;
+ left = top = right = bottom = -1;
+ layout->getContentsMargins(&left, &top, &right, &bottom);
+
+ const DomPropertyHash properties = propertyMap(ui_layout->elementProperty());
+
+ if (const DomProperty *p = properties.value(strings.leftMarginProperty, 0))
+ left = p->elementNumber();
+
+ if (const DomProperty *p = properties.value(strings.topMarginProperty, 0))
+ top = p->elementNumber();
+
+ if (const DomProperty *p = properties.value(strings.rightMarginProperty, 0))
+ right = p->elementNumber();
+
+ if (const DomProperty *p = properties.value(strings.bottomMarginProperty, 0))
+ bottom = p->elementNumber();
+
+ layout->setContentsMargins(left, top, right, bottom);
+ }
+
+ if (spacing != INT_MIN) {
+ layout->setSpacing(spacing);
+ } else {
+ QGridLayout *grid = qobject_cast<QGridLayout *>(layout);
+ if (grid) {
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ const DomPropertyHash properties = propertyMap(ui_layout->elementProperty());
+
+ if (const DomProperty *p = properties.value(strings.horizontalSpacingProperty, 0))
+ grid->setHorizontalSpacing(p->elementNumber());
+ if (const DomProperty *p = properties.value(strings.verticalSpacingProperty, 0))
+ grid->setVerticalSpacing(p->elementNumber());
+ }
+ }
+
+ applyProperties(layout, ui_layout->elementProperty());
+
+ foreach (DomLayoutItem *ui_item, ui_layout->elementItem()) {
+ if (QLayoutItem *item = create(ui_item, layout, parentWidget)) {
+ addItem(ui_item, item, layout);
+ }
+ }
+ // Check the box stretch attributes
+ if (QBoxLayout *box = qobject_cast<QBoxLayout*>(layout)) {
+ const QString boxStretch = ui_layout->attributeStretch();
+ if (!boxStretch.isEmpty())
+ QFormBuilderExtra::setBoxLayoutStretch(boxStretch, box);
+ }
+ // Check the grid stretch/minimum size attributes
+ if (QGridLayout *grid = qobject_cast<QGridLayout*>(layout)) {
+ // Stretch
+ const QString gridRowStretch = ui_layout->attributeRowStretch();
+ if (!gridRowStretch.isEmpty())
+ QFormBuilderExtra::setGridLayoutRowStretch(gridRowStretch, grid);
+ const QString gridColumnStretch = ui_layout->attributeColumnStretch();
+ if (!gridColumnStretch.isEmpty())
+ QFormBuilderExtra::setGridLayoutColumnStretch(gridColumnStretch, grid);
+ // Minimum size
+ const QString gridColumnMinimumWidth = ui_layout->attributeColumnMinimumWidth();
+ if (!gridColumnMinimumWidth.isEmpty())
+ QFormBuilderExtra::setGridLayoutColumnMinimumWidth(gridColumnMinimumWidth, grid);
+ const QString gridRowMinimumHeight = ui_layout->attributeRowMinimumHeight();
+ if (!gridRowMinimumHeight.isEmpty())
+ QFormBuilderExtra::setGridLayoutRowMinimumHeight(gridRowMinimumHeight, grid);
+ }
+ return layout;
+}
+
+#ifndef QT_NO_FORMLAYOUT
+static inline QFormLayout::ItemRole formLayoutRole(int column, int colspan)
+{
+ if (colspan > 1)
+ return QFormLayout::SpanningRole;
+ return column == 0 ? QFormLayout::LabelRole : QFormLayout::FieldRole;
+}
+#endif
+
+static inline QString alignmentValue(Qt::Alignment a)
+{
+ QString h,v;
+ switch (a & Qt::AlignHorizontal_Mask) {
+ case Qt::AlignLeft:
+ h = QLatin1String("Qt::AlignLeft");
+ break;
+ case Qt::AlignRight:
+ h = QLatin1String("Qt::AlignRight");
+ break;
+ case Qt::AlignHCenter:
+ h = QLatin1String("Qt::AlignHCenter");
+ break;
+ case Qt::AlignJustify:
+ h = QLatin1String("Qt::AlignJustify");
+ break;
+ }
+ switch (a & Qt::AlignVertical_Mask) {
+ case Qt::AlignTop:
+ v = QLatin1String("Qt::AlignTop");
+ break;
+ case Qt::AlignBottom:
+ v = QLatin1String("Qt::AlignBottom");
+ break;
+ case Qt::AlignVCenter:
+ v = QLatin1String("Qt::AlignVCenter");
+ break;
+ }
+ if (h.isEmpty() && v.isEmpty())
+ return QString();
+ if (!v.isEmpty()) {
+ if (!h.isEmpty())
+ h += QLatin1Char('|');
+ h += v;
+ }
+ return h;
+}
+
+static inline Qt::Alignment alignmentFromDom(const QString &in)
+{
+ Qt::Alignment rc = 0;
+ if (!in.isEmpty()) {
+ foreach (const QString &f, in.split(QLatin1Char('|'))) {
+ if (f == QLatin1String("Qt::AlignLeft")) {
+ rc |= Qt::AlignLeft;
+ } else if (f == QLatin1String("Qt::AlignRight")) {
+ rc |= Qt::AlignRight;
+ } else if (f == QLatin1String("Qt::AlignHCenter")) {
+ rc |= Qt::AlignHCenter;
+ } else if (f == QLatin1String("Qt::AlignJustify")) {
+ rc |= Qt::AlignJustify;
+ } else if (f == QLatin1String("Qt::AlignTop")) {
+ rc |= Qt::AlignTop;
+ } else if (f == QLatin1String("Qt::AlignBottom")) {
+ rc |= Qt::AlignBottom;
+ } else if (f == QLatin1String("Qt::AlignVCenter")) {
+ rc |= Qt::AlignVCenter;
+ }
+ }
+ }
+ return rc;
+}
+
+/*!
+ \internal
+*/
+bool QAbstractFormBuilder::addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout)
+{
+ // Calling addChildWidget(), etc. is required to maintain consistency of the layouts,
+ // see documentation of addItem(), which should ideally not be used.
+ if (item->widget()) {
+ static_cast<QFriendlyLayout*>(layout)->addChildWidget(item->widget());
+ } else if (item->layout()) {
+ static_cast<QFriendlyLayout*>(layout)->addChildLayout(item->layout());
+ } else if (item->spacerItem()) {
+ // nothing to do
+ } else {
+ return false;
+ }
+
+ if (QGridLayout *grid = qobject_cast<QGridLayout*>(layout)) {
+ const int rowSpan = ui_item->hasAttributeRowSpan() ? ui_item->attributeRowSpan() : 1;
+ const int colSpan = ui_item->hasAttributeColSpan() ? ui_item->attributeColSpan() : 1;
+ grid->addItem(item, ui_item->attributeRow(), ui_item->attributeColumn(),
+ rowSpan, colSpan, item->alignment());
+ return true;
+ }
+#ifndef QT_NO_FORMLAYOUT
+ if (QFormLayout *form = qobject_cast<QFormLayout *>(layout)) {
+ const int row = ui_item->attributeRow();
+ const int colSpan = ui_item->hasAttributeColSpan() ? ui_item->attributeColSpan() : 1;
+ form->setItem(row, formLayoutRole(ui_item->attributeColumn(), colSpan), item);
+ return true;
+ }
+
+#endif
+ layout->addItem(item);
+ return true;
+}
+
+/*!
+ \internal
+*/
+QLayoutItem *QAbstractFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget)
+{
+ switch (ui_layoutItem->kind()) {
+ case DomLayoutItem::Widget: {
+ if (QWidget *w = create(ui_layoutItem->elementWidget(), parentWidget)) {
+#ifdef QFORMINTERNAL_NAMESPACE // uilib
+ QWidgetItem *item = new QWidgetItemV2(w);
+#else // Within Designer: Use factory method that returns special items that refuse to shrink to 0,0
+ QWidgetItem *item = QLayoutPrivate::createWidgetItem(layout, w);
+#endif
+ item->setAlignment(alignmentFromDom(ui_layoutItem->attributeAlignment()));
+ return item;
+ }
+ qWarning() << QCoreApplication::translate("QAbstractFormBuilder", "Empty widget item in %1 '%2'.").arg(QString::fromUtf8(layout->metaObject()->className()), layout->objectName());
+ return 0;
+ }
+ case DomLayoutItem::Spacer: {
+ QSize size(0, 0);
+ QSizePolicy::Policy sizeType = QSizePolicy::Expanding;
+ bool isVspacer = false;
+
+ const DomSpacer *ui_spacer = ui_layoutItem->elementSpacer();
+
+ const QMetaEnum sizePolicy_enum = metaEnum<QAbstractFormBuilderGadget>("sizeType");
+ const QMetaEnum orientation_enum = metaEnum<QAbstractFormBuilderGadget>("orientation");
+
+ const QList<DomProperty *> spacerProperties = ui_spacer->elementProperty();
+ if (!spacerProperties.empty()) {
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ foreach (DomProperty *p, spacerProperties) {
+ const QVariant v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p); // ### remove me
+ if (v.isNull())
+ continue;
+ if (p->attributeName() == strings.sizeHintProperty && p->kind() == DomProperty::Size) {
+ size = v.toSize(); // ### remove me
+ } else if (p->attributeName() == strings.sizeTypeProperty && p->kind() == DomProperty::Enum) {
+ sizeType = static_cast<QSizePolicy::Policy>(v.toInt());
+ } else if (p->attributeName() == strings.orientationProperty && p->kind() == DomProperty::Enum) {
+ const Qt::Orientation o = static_cast<Qt::Orientation>(v.toInt());
+ isVspacer = (o == Qt::Vertical);
+ }
+ }
+ }
+
+ QSpacerItem *spacer = 0;
+ if (isVspacer)
+ spacer = new QSpacerItem(size.width(), size.height(), QSizePolicy::Minimum, sizeType);
+ else
+ spacer = new QSpacerItem(size.width(), size.height(), sizeType, QSizePolicy::Minimum);
+ return spacer; }
+
+ case DomLayoutItem::Layout:
+ return create(ui_layoutItem->elementLayout(), layout, parentWidget);
+
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> &properties)
+{
+ typedef QList<DomProperty*> DomPropertyList;
+
+ if (properties.empty())
+ return;
+
+ const DomPropertyList::const_iterator cend = properties.constEnd();
+ for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) {
+ const QVariant v = toVariant(o->metaObject(), *it);
+ if (!v.isNull()) {
+ const QString attributeName = (*it)->attributeName();
+ if (!d->applyPropertyInternally(o, attributeName, v))
+ o->setProperty(attributeName.toUtf8(), v);
+ }
+ }
+}
+
+
+/*!
+ \internal
+ Check whether a property is applied internally by QAbstractFormBuilder. Call this
+ from overwritten applyProperties().
+*/
+
+bool QAbstractFormBuilder::applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value)
+{
+ return d->applyPropertyInternally(o,propertyName, value);
+}
+
+/*!
+ \internal
+*/
+
+QVariant QAbstractFormBuilder::toVariant(const QMetaObject *meta, DomProperty *p)
+{
+ return domPropertyToVariant(this, meta, p);
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::setupColorGroup(QPalette &palette, QPalette::ColorGroup colorGroup,
+ DomColorGroup *group)
+{
+ // old format
+ const QList<DomColor*> colors = group->elementColor();
+ for (int role = 0; role < colors.size(); ++role) {
+ const DomColor *color = colors.at(role);
+ const QColor c(color->elementRed(), color->elementGreen(), color->elementBlue());
+ palette.setColor(colorGroup, QPalette::ColorRole(role), c);
+ }
+
+ // new format
+ const QMetaEnum colorRole_enum = metaEnum<QAbstractFormBuilderGadget>("colorRole");
+
+ const QList<DomColorRole*> colorRoles = group->elementColorRole();
+ for (int role = 0; role < colorRoles.size(); ++role) {
+ const DomColorRole *colorRole = colorRoles.at(role);
+
+ if (colorRole->hasAttributeRole()) {
+ const int r = colorRole_enum.keyToValue(colorRole->attributeRole().toLatin1());
+ if (r != -1) {
+ const QBrush br = setupBrush(colorRole->elementBrush());
+ palette.setBrush(colorGroup, static_cast<QPalette::ColorRole>(r), br);
+ }
+ }
+ }
+}
+
+/*!
+ \internal
+*/
+DomColorGroup *QAbstractFormBuilder::saveColorGroup(const QPalette &palette)
+{
+
+ const QMetaEnum colorRole_enum = metaEnum<QAbstractFormBuilderGadget>("colorRole");
+
+ DomColorGroup *group = new DomColorGroup();
+ QList<DomColorRole*> colorRoles;
+
+ const uint mask = palette.resolve();
+ for (int role = QPalette::WindowText; role < QPalette::NColorRoles; ++role) {
+ if (mask & (1 << role)) {
+ QBrush br = palette.brush(QPalette::ColorRole(role));
+
+ DomColorRole *colorRole = new DomColorRole();
+ colorRole->setElementBrush(saveBrush(br));
+ colorRole->setAttributeRole(QLatin1String(colorRole_enum.valueToKey(role)));
+ colorRoles.append(colorRole);
+ }
+ }
+
+ group->setElementColorRole(colorRoles);
+ return group;
+}
+
+/*!
+ \internal
+*/
+QBrush QAbstractFormBuilder::setupBrush(DomBrush *brush)
+{
+ QBrush br;
+ if (!brush->hasAttributeBrushStyle())
+ return br;
+
+ const Qt::BrushStyle style = enumKeyOfObjectToValue<QAbstractFormBuilderGadget, Qt::BrushStyle>("brushStyle", brush->attributeBrushStyle().toLatin1());
+
+ if (style == Qt::LinearGradientPattern ||
+ style == Qt::RadialGradientPattern ||
+ style == Qt::ConicalGradientPattern) {
+ const QMetaEnum gradientType_enum = metaEnum<QAbstractFormBuilderGadget>("gradientType");
+ const QMetaEnum gradientSpread_enum = metaEnum<QAbstractFormBuilderGadget>("gradientSpread");
+ const QMetaEnum gradientCoordinate_enum = metaEnum<QAbstractFormBuilderGadget>("gradientCoordinate");
+
+ const DomGradient *gradient = brush->elementGradient();
+ const QGradient::Type type = enumKeyToValue<QGradient::Type>(gradientType_enum, gradient->attributeType().toLatin1());
+
+
+ QGradient *gr = 0;
+
+ if (type == QGradient::LinearGradient) {
+ gr = new QLinearGradient(QPointF(gradient->attributeStartX(), gradient->attributeStartY()),
+ QPointF(gradient->attributeEndX(), gradient->attributeEndY()));
+ } else if (type == QGradient::RadialGradient) {
+ gr = new QRadialGradient(QPointF(gradient->attributeCentralX(), gradient->attributeCentralY()),
+ gradient->attributeRadius(),
+ QPointF(gradient->attributeFocalX(), gradient->attributeFocalY()));
+ } else if (type == QGradient::ConicalGradient) {
+ gr = new QConicalGradient(QPointF(gradient->attributeCentralX(), gradient->attributeCentralY()),
+ gradient->attributeAngle());
+ }
+ if (!gr)
+ return br;
+
+ const QGradient::Spread spread = enumKeyToValue<QGradient::Spread>(gradientSpread_enum, gradient->attributeSpread().toLatin1());
+ gr->setSpread(spread);
+
+ const QGradient::CoordinateMode coord = enumKeyToValue<QGradient::CoordinateMode>(gradientCoordinate_enum, gradient->attributeCoordinateMode().toLatin1());
+ gr->setCoordinateMode(coord);
+
+ const QList<DomGradientStop *> stops = gradient->elementGradientStop();
+ QListIterator<DomGradientStop *> it(stops);
+ while (it.hasNext()) {
+ const DomGradientStop *stop = it.next();
+ const DomColor *color = stop->elementColor();
+ gr->setColorAt(stop->attributePosition(), QColor::fromRgb(color->elementRed(),
+ color->elementGreen(), color->elementBlue(), color->attributeAlpha()));
+ }
+ br = QBrush(*gr);
+ delete gr;
+ } else if (style == Qt::TexturePattern) {
+ const DomProperty *texture = brush->elementTexture();
+ if (texture && texture->kind() == DomProperty::Pixmap) {
+ br.setTexture(domPropertyToPixmap(texture));
+ }
+ } else {
+ const DomColor *color = brush->elementColor();
+ br.setColor(QColor::fromRgb(color->elementRed(),
+ color->elementGreen(), color->elementBlue(), color->attributeAlpha()));
+ br.setStyle((Qt::BrushStyle)style);
+ }
+ return br;
+}
+
+/*!
+ \internal
+*/
+DomBrush *QAbstractFormBuilder::saveBrush(const QBrush &br)
+{
+ const QMetaEnum brushStyle_enum = metaEnum<QAbstractFormBuilderGadget>("brushStyle");
+
+ DomBrush *brush = new DomBrush();
+ const Qt::BrushStyle style = br.style();
+ brush->setAttributeBrushStyle(QLatin1String(brushStyle_enum.valueToKey(style)));
+ if (style == Qt::LinearGradientPattern ||
+ style == Qt::RadialGradientPattern ||
+ style == Qt::ConicalGradientPattern) {
+ const QMetaEnum gradientType_enum = metaEnum<QAbstractFormBuilderGadget>("gradientType");
+ const QMetaEnum gradientSpread_enum = metaEnum<QAbstractFormBuilderGadget>("gradientSpread");
+ const QMetaEnum gradientCoordinate_enum = metaEnum<QAbstractFormBuilderGadget>("gradientCoordinate");
+
+ DomGradient *gradient = new DomGradient();
+ const QGradient *gr = br.gradient();
+ const QGradient::Type type = gr->type();
+ gradient->setAttributeType(QLatin1String(gradientType_enum.valueToKey(type)));
+ gradient->setAttributeSpread(QLatin1String(gradientSpread_enum.valueToKey(gr->spread())));
+ gradient->setAttributeCoordinateMode(QLatin1String(gradientCoordinate_enum.valueToKey(gr->coordinateMode())));
+ QList<DomGradientStop *> stops;
+ QGradientStops st = gr->stops();
+ QVectorIterator<QPair<qreal, QColor> > it(st);
+ while (it.hasNext()) {
+ const QPair<qreal, QColor> pair = it.next();
+ DomGradientStop *stop = new DomGradientStop();
+ stop->setAttributePosition(pair.first);
+ DomColor *color = new DomColor();
+ color->setElementRed(pair.second.red());
+ color->setElementGreen(pair.second.green());
+ color->setElementBlue(pair.second.blue());
+ color->setAttributeAlpha(pair.second.alpha());
+ stop->setElementColor(color);
+ stops.append(stop);
+ }
+ gradient->setElementGradientStop(stops);
+ if (type == QGradient::LinearGradient) {
+ QLinearGradient *lgr = (QLinearGradient *)(gr);
+ gradient->setAttributeStartX(lgr->start().x());
+ gradient->setAttributeStartY(lgr->start().y());
+ gradient->setAttributeEndX(lgr->finalStop().x());
+ gradient->setAttributeEndY(lgr->finalStop().y());
+ } else if (type == QGradient::RadialGradient) {
+ QRadialGradient *rgr = (QRadialGradient *)(gr);
+ gradient->setAttributeCentralX(rgr->center().x());
+ gradient->setAttributeCentralY(rgr->center().y());
+ gradient->setAttributeFocalX(rgr->focalPoint().x());
+ gradient->setAttributeFocalY(rgr->focalPoint().y());
+ gradient->setAttributeRadius(rgr->radius());
+ } else if (type == QGradient::ConicalGradient) {
+ QConicalGradient *cgr = (QConicalGradient *)(gr);
+ gradient->setAttributeCentralX(cgr->center().x());
+ gradient->setAttributeCentralY(cgr->center().y());
+ gradient->setAttributeAngle(cgr->angle());
+ }
+
+ brush->setElementGradient(gradient);
+ } else if (style == Qt::TexturePattern) {
+ const QPixmap pixmap = br.texture();
+ if (!pixmap.isNull()) {
+ DomProperty *p = new DomProperty;
+ setPixmapProperty(*p, pixmapPaths(pixmap));
+ brush->setElementTexture(p);
+ }
+ } else {
+ QColor c = br.color();
+ DomColor *color = new DomColor();
+ color->setElementRed(c.red());
+ color->setElementGreen(c.green());
+ color->setElementBlue(c.blue());
+ color->setAttributeAlpha(c.alpha());
+ brush->setElementColor(color);
+ }
+ return brush;
+}
+
+/*!
+ \internal
+*/
+QWidget *QAbstractFormBuilder::createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name)
+{
+ Q_UNUSED(widgetName);
+ Q_UNUSED(parentWidget);
+ Q_UNUSED(name);
+ return 0;
+}
+
+/*!
+ \internal
+*/
+QLayout *QAbstractFormBuilder::createLayout(const QString &layoutName, QObject *parent, const QString &name)
+{
+ Q_UNUSED(layoutName);
+ Q_UNUSED(parent);
+ Q_UNUSED(name);
+ return 0;
+}
+
+/*!
+ \internal
+*/
+QAction *QAbstractFormBuilder::createAction(QObject *parent, const QString &name)
+{
+ QAction *action = new QAction(parent);
+ action->setObjectName(name);
+ return action;
+}
+
+/*!
+ \internal
+*/
+QActionGroup *QAbstractFormBuilder::createActionGroup(QObject *parent, const QString &name)
+{
+ QActionGroup *g = new QActionGroup(parent);
+ g->setObjectName(name);
+ return g;
+}
+
+/*!
+ \fn void QAbstractFormBuilder::save(QIODevice *device, QWidget *widget)
+
+ Saves an XML representation of the given \a widget to the
+ specified \a device in the standard UI file format.
+
+ \sa load()*/
+void QAbstractFormBuilder::save(QIODevice *dev, QWidget *widget)
+{
+ DomWidget *ui_widget = createDom(widget, 0);
+ Q_ASSERT( ui_widget != 0 );
+
+ DomUI *ui = new DomUI();
+ ui->setAttributeVersion(QLatin1String("4.0"));
+ ui->setElementWidget(ui_widget);
+
+ saveDom(ui, widget);
+
+ QXmlStreamWriter writer(dev);
+ writer.setAutoFormatting(true);
+ writer.setAutoFormattingIndent(1);
+ writer.writeStartDocument();
+ ui->write(writer);
+ writer.writeEndDocument();
+
+ d->m_laidout.clear();
+
+ delete ui;
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveDom(DomUI *ui, QWidget *widget)
+{
+ ui->setElementClass(widget->objectName());
+
+ if (DomConnections *ui_connections = saveConnections()) {
+ ui->setElementConnections(ui_connections);
+ }
+
+ if (DomCustomWidgets *ui_customWidgets = saveCustomWidgets()) {
+ ui->setElementCustomWidgets(ui_customWidgets);
+ }
+
+ if (DomTabStops *ui_tabStops = saveTabStops()) {
+ ui->setElementTabStops(ui_tabStops);
+ }
+
+ if (DomResources *ui_resources = saveResources()) {
+ ui->setElementResources(ui_resources);
+ }
+ if (DomButtonGroups *ui_buttonGroups = saveButtonGroups(widget))
+ ui->setElementButtonGroups(ui_buttonGroups);
+}
+
+/*!
+ \internal
+*/
+DomConnections *QAbstractFormBuilder::saveConnections()
+{
+ return new DomConnections;
+}
+
+/*!
+ \internal
+*/
+
+DomWidget *QAbstractFormBuilder::createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive)
+{
+ DomWidget *ui_widget = new DomWidget();
+ ui_widget->setAttributeClass(QLatin1String(widget->metaObject()->className()));
+ ui_widget->setElementProperty(computeProperties(widget));
+
+ if (recursive) {
+ if (QLayout *layout = widget->layout()) {
+ if (DomLayout *ui_layout = createDom(layout, 0, ui_parentWidget)) {
+ QList<DomLayout*> ui_layouts;
+ ui_layouts.append(ui_layout);
+
+ ui_widget->setElementLayout(ui_layouts);
+ }
+ }
+ }
+
+ // widgets, actions and action groups
+ QList<DomWidget*> ui_widgets;
+ QList<DomAction*> ui_actions;
+ QList<DomActionGroup*> ui_action_groups;
+
+ QList<QObject*> children;
+
+ // splitters need to store their children in the order specified by child indexes,
+ // not the order of the child list.
+#ifndef QT_NO_SPLITTER
+ if (const QSplitter *splitter = qobject_cast<const QSplitter*>(widget)) {
+ const int count = splitter->count();
+ for (int i = 0; i < count; ++i)
+ children.append(splitter->widget(i));
+ } else
+#endif
+ {
+ QList<QObject *> childObjects = widget->children();
+
+ const QList<QWidget *> list = qvariant_cast<QWidgetList>(widget->property("_q_widgetOrder"));
+ foreach (QWidget *w, list) {
+ if (childObjects.contains(w)) {
+ children.append(w);
+ childObjects.removeAll(w);
+ }
+ }
+ children += childObjects;
+
+ const QList<QWidget *> zOrder = qvariant_cast<QWidgetList>(widget->property("_q_zOrder"));
+ if (list != zOrder) {
+ QStringList zOrderList;
+ QListIterator<QWidget* > itZOrder(zOrder);
+ while (itZOrder.hasNext())
+ zOrderList.append(itZOrder.next()->objectName());
+ ui_widget->setElementZOrder(zOrderList);
+ }
+ }
+
+ foreach (QObject *obj, children) {
+ if (QWidget *childWidget = qobject_cast<QWidget*>(obj)) {
+ if (d->m_laidout.contains(childWidget) || recursive == false)
+ continue;
+
+ if (QMenu *menu = qobject_cast<QMenu *>(childWidget)) {
+ QList<QAction *> actions = menu->parentWidget()->actions();
+ QListIterator<QAction *> it(actions);
+ bool found = false;
+ while (it.hasNext()) {
+ if (it.next()->menu() == menu)
+ found = true;
+ }
+ if (!found)
+ continue;
+ }
+
+ if (DomWidget *ui_child = createDom(childWidget, ui_widget)) {
+ ui_widgets.append(ui_child);
+ }
+ } else if (QAction *childAction = qobject_cast<QAction*>(obj)) {
+ if (childAction->actionGroup() != 0) {
+ // it will be added later.
+ continue;
+ }
+
+ if (DomAction *ui_action = createDom(childAction)) {
+ ui_actions.append(ui_action);
+ }
+ } else if (QActionGroup *childActionGroup = qobject_cast<QActionGroup*>(obj)) {
+ if (DomActionGroup *ui_action_group = createDom(childActionGroup)) {
+ ui_action_groups.append(ui_action_group);
+ }
+ }
+ }
+
+ // add-action
+ QList<DomActionRef*> ui_action_refs;
+ foreach (QAction *action, widget->actions()) {
+ if (DomActionRef *ui_action_ref = createActionRefDom(action)) {
+ ui_action_refs.append(ui_action_ref);
+ }
+ }
+
+ if (recursive)
+ ui_widget->setElementWidget(ui_widgets);
+
+ ui_widget->setElementAction(ui_actions);
+ ui_widget->setElementActionGroup(ui_action_groups);
+ ui_widget->setElementAddAction(ui_action_refs);
+
+ saveExtraInfo(widget, ui_widget, ui_parentWidget);
+
+ return ui_widget;
+}
+
+/*!
+ \internal
+*/
+DomActionRef *QAbstractFormBuilder::createActionRefDom(QAction *action)
+{
+ QString name = action->objectName();
+
+ if (action->menu() != 0)
+ name = action->menu()->objectName();
+
+ DomActionRef *ui_action_ref = new DomActionRef();
+ if (action->isSeparator())
+ ui_action_ref->setAttributeName(QFormBuilderStrings::instance().separator);
+ else
+ ui_action_ref->setAttributeName(name);
+
+ return ui_action_ref;
+}
+
+// Struct to store layout item parameters for saving layout items
+struct FormBuilderSaveLayoutEntry {
+ explicit FormBuilderSaveLayoutEntry(QLayoutItem *li = 0) :
+ item(li), row(-1), column(-1), rowSpan(0), columnSpan(0), alignment(0) {}
+
+ QLayoutItem *item;
+ int row;
+ int column;
+ int rowSpan;
+ int columnSpan;
+ Qt::Alignment alignment;
+};
+
+// Create list from standard box layout
+static QList<FormBuilderSaveLayoutEntry> saveLayoutEntries(const QLayout *layout)
+{
+ QList<FormBuilderSaveLayoutEntry> rc;
+ if (const int count = layout->count()) {
+ rc.reserve(count);
+ for (int idx = 0; idx < count; ++idx) {
+ QLayoutItem *item = layout->itemAt(idx);
+ FormBuilderSaveLayoutEntry entry(item);
+ entry.alignment = item->alignment();
+ rc.append(entry);
+ }
+ }
+ return rc;
+}
+
+// Create list from grid layout
+static QList<FormBuilderSaveLayoutEntry> saveGridLayoutEntries(QGridLayout *gridLayout)
+{
+ QList<FormBuilderSaveLayoutEntry> rc;
+ if (const int count = gridLayout->count()) {
+ rc.reserve(count);
+ for (int idx = 0; idx < count; ++idx) {
+ QLayoutItem *item = gridLayout->itemAt(idx);
+ FormBuilderSaveLayoutEntry entry(item);
+ gridLayout->getItemPosition(idx, &entry.row, &entry.column, &entry.rowSpan,&entry.columnSpan);
+ entry.alignment = item->alignment();
+ rc.append(entry);
+ }
+ }
+ return rc;
+}
+
+#ifndef QT_NO_FORMLAYOUT
+// Create list from form layout
+static QList<FormBuilderSaveLayoutEntry> saveFormLayoutEntries(const QFormLayout *formLayout)
+{
+ QList<FormBuilderSaveLayoutEntry> rc;
+ if (const int count = formLayout->count()) {
+ rc.reserve(count);
+ for (int idx = 0; idx < count; ++idx) {
+ QLayoutItem *item = formLayout->itemAt(idx);
+ QFormLayout::ItemRole role = QFormLayout::LabelRole;
+ FormBuilderSaveLayoutEntry entry(item);
+ formLayout->getItemPosition(idx, &entry.row, &role);
+ switch (role ) {
+ case QFormLayout::LabelRole:
+ entry.column = 0;
+ break;
+ case QFormLayout::FieldRole:
+ entry.column = 1;
+ break;
+ case QFormLayout::SpanningRole:
+ entry.column = 0;
+ entry.columnSpan = 2;
+ break;
+ }
+ rc.push_back(entry);
+ }
+ }
+ return rc;
+}
+#endif
+
+/*!
+ \internal
+*/
+
+DomLayout *QAbstractFormBuilder::createDom(QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_layout)
+ DomLayout *lay = new DomLayout();
+ lay->setAttributeClass(QLatin1String(layout->metaObject()->className()));
+ const QString objectName = layout->objectName();
+ if (!objectName.isEmpty())
+ lay->setAttributeName(objectName);
+ lay->setElementProperty(computeProperties(layout));
+
+ QList<FormBuilderSaveLayoutEntry> newList;
+ if (QGridLayout *gridLayout = qobject_cast<QGridLayout *>(layout)) {
+ newList = saveGridLayoutEntries(gridLayout);
+#ifndef QT_NO_FORMLAYOUT
+ } else if (const QFormLayout *formLayout = qobject_cast<const QFormLayout *>(layout)) {
+ newList = saveFormLayoutEntries(formLayout);
+#endif
+ } else {
+ newList = saveLayoutEntries(layout);
+ }
+
+ QList<DomLayoutItem*> ui_items;
+ foreach (const FormBuilderSaveLayoutEntry &item, newList) {
+ if (DomLayoutItem *ui_item = createDom(item.item, lay, ui_parentWidget)) {
+ if (item.row >= 0)
+ ui_item->setAttributeRow(item.row);
+ if (item.column >= 0)
+ ui_item->setAttributeColumn(item.column);
+ if (item.rowSpan > 1)
+ ui_item->setAttributeRowSpan(item.rowSpan);
+ if (item.columnSpan > 1)
+ ui_item->setAttributeColSpan(item.columnSpan);
+ if (item.alignment)
+ ui_item->setAttributeAlignment(alignmentValue(item.alignment));
+ ui_items.append(ui_item);
+ }
+ }
+
+ lay->setElementItem(ui_items);
+
+ return lay;
+}
+
+/*!
+ \internal
+*/
+DomLayoutItem *QAbstractFormBuilder::createDom(QLayoutItem *item, DomLayout *ui_layout, DomWidget *ui_parentWidget)
+{
+ DomLayoutItem *ui_item = new DomLayoutItem();
+
+ if (item->widget()) {
+ ui_item->setElementWidget(createDom(item->widget(), ui_parentWidget));
+ d->m_laidout.insert(item->widget(), true);
+ } else if (item->layout()) {
+ ui_item->setElementLayout(createDom(item->layout(), ui_layout, ui_parentWidget));
+ } else if (item->spacerItem()) {
+ ui_item->setElementSpacer(createDom(item->spacerItem(), ui_layout, ui_parentWidget));
+ }
+
+ return ui_item;
+}
+
+/*!
+ \internal
+*/
+DomSpacer *QAbstractFormBuilder::createDom(QSpacerItem *spacer, DomLayout *ui_layout, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_layout);
+ Q_UNUSED(ui_parentWidget);
+
+ DomSpacer *ui_spacer = new DomSpacer();
+ QList<DomProperty*> properties;
+
+ DomProperty *prop = 0;
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ // sizeHint property
+ prop = new DomProperty();
+ prop->setAttributeName(strings.sizeHintProperty);
+ prop->setElementSize(new DomSize());
+ prop->elementSize()->setElementWidth(spacer->sizeHint().width());
+ prop->elementSize()->setElementHeight(spacer->sizeHint().height());
+ properties.append(prop);
+
+ // orientation property
+ prop = new DomProperty(); // ### we don't implemented the case where expandingDirections() is both Vertical and Horizontal
+ prop->setAttributeName(strings.orientationProperty);
+ prop->setElementEnum((spacer->expandingDirections() & Qt::Horizontal) ? strings.qtHorizontal : strings.qtVertical);
+ properties.append(prop);
+
+ ui_spacer->setElementProperty(properties);
+ return ui_spacer;
+}
+
+/*!
+ \internal
+*/
+DomProperty *QAbstractFormBuilder::createProperty(QObject *obj, const QString &pname, const QVariant &v)
+{
+ if (!checkProperty(obj, pname)) {
+ return 0;
+ }
+ return variantToDomProperty(this, obj->metaObject(), pname, v);
+}
+
+/*!
+ \internal
+*/
+QList<DomProperty*> QAbstractFormBuilder::computeProperties(QObject *obj)
+{
+ QList<DomProperty*> lst;
+
+ const QMetaObject *meta = obj->metaObject();
+
+ QHash<QByteArray, bool> properties;
+ const int propertyCount = meta->propertyCount();
+ for(int i=0; i < propertyCount; ++i)
+ properties.insert(meta->property(i).name(), true);
+
+ const QList<QByteArray> propertyNames = properties.keys();
+
+ const int propertyNamesCount = propertyNames.size();
+ for(int i=0; i<propertyNamesCount ; ++i) {
+ const QString pname = QString::fromUtf8(propertyNames.at(i));
+ const QMetaProperty prop = meta->property(meta->indexOfProperty(pname.toUtf8()));
+
+ if (!prop.isWritable() || !checkProperty(obj, QLatin1String(prop.name())))
+ continue;
+
+ const QVariant v = prop.read(obj);
+
+ DomProperty *dom_prop = 0;
+ if (v.type() == QVariant::Int) {
+ dom_prop = new DomProperty();
+
+ if (prop.isFlagType())
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Flags property are not supported yet."));
+
+ if (prop.isEnumType()) {
+ QString scope = QString::fromUtf8(prop.enumerator().scope());
+ if (scope.size())
+ scope += QString::fromUtf8("::");
+ const QString e = QString::fromUtf8(prop.enumerator().valueToKey(v.toInt()));
+ if (e.size())
+ dom_prop->setElementEnum(scope + e);
+ } else
+ dom_prop->setElementNumber(v.toInt());
+ dom_prop->setAttributeName(pname);
+ } else {
+ dom_prop = createProperty(obj, pname, v);
+ }
+
+ if (!dom_prop || dom_prop->kind() == DomProperty::Unknown)
+ delete dom_prop;
+ else
+ lst.append(dom_prop);
+ }
+
+ return lst;
+}
+
+
+/*!
+ \internal
+ \typedef QAbstractFormBuilder::DomPropertyHash
+ \typedef QAbstractFormBuilder::IconPaths
+*/
+
+
+/*!
+ \internal
+*/
+QAbstractFormBuilder::DomPropertyHash QAbstractFormBuilder::propertyMap(const QList<DomProperty*> &properties)
+{
+ DomPropertyHash map;
+
+ foreach (DomProperty *p, properties)
+ map.insert(p->attributeName(), p);
+
+ return map;
+}
+
+/*!
+ \internal
+*/
+bool QAbstractFormBuilder::checkProperty(QObject *obj, const QString &prop) const
+{
+ Q_UNUSED(obj);
+ Q_UNUSED(prop);
+
+ return true;
+}
+
+/*!
+ \internal
+*/
+QString QAbstractFormBuilder::toString(const DomString *str)
+{
+ return str ? str->text() : QString();
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::applyTabStops(QWidget *widget, DomTabStops *tabStops)
+{
+ if (!tabStops)
+ return;
+
+ QWidget *lastWidget = 0;
+
+ const QStringList l = tabStops->elementTabStop();
+ for (int i=0; i<l.size(); ++i) {
+ const QString name = l.at(i);
+
+ QWidget *child = widget->findChild<QWidget*>(name);
+ if (!child) {
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "While applying tab stops: The widget '%1' could not be found.").arg(name));
+ continue;
+ }
+
+ if (i == 0) {
+ lastWidget = widget->findChild<QWidget*>(name);
+ continue;
+ } else if (!child || !lastWidget) {
+ continue;
+ }
+
+ QWidget::setTabOrder(lastWidget, child);
+
+ lastWidget = widget->findChild<QWidget*>(name);
+ }
+}
+
+/*!
+ \internal
+*/
+DomCustomWidgets *QAbstractFormBuilder::saveCustomWidgets()
+{
+ return 0;
+}
+
+/*!
+ \internal
+*/
+DomTabStops *QAbstractFormBuilder::saveTabStops()
+{
+ return 0;
+}
+
+/*!
+ \internal
+*/
+DomResources *QAbstractFormBuilder::saveResources()
+{
+ return 0;
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+DomButtonGroups *QAbstractFormBuilder::saveButtonGroups(const QWidget *mainContainer)
+{
+ // Save fst order buttongroup children of maincontainer
+ typedef QList<QButtonGroup*> ButtonGroupList;
+ const QObjectList mchildren = mainContainer->children();
+ if (mchildren.empty())
+ return 0;
+ QList<DomButtonGroup*> domGroups;
+ const QObjectList::const_iterator cend = mchildren.constEnd();
+ for (QObjectList::const_iterator it = mchildren.constBegin(); it != cend; ++it)
+ if (QButtonGroup *bg = qobject_cast<QButtonGroup *>(*it))
+ if (DomButtonGroup* dg = createDom(bg))
+ domGroups.push_back(dg);
+
+ if (domGroups.empty())
+ return 0;
+ DomButtonGroups *rc = new DomButtonGroups;
+ rc->setElementButtonGroup(domGroups);
+ return rc;
+}
+
+// VC6 would not find templated members, so we use statics and this utter hack.
+class FriendlyFB : public QAbstractFormBuilder {
+public:
+ using QAbstractFormBuilder::saveResource;
+ using QAbstractFormBuilder::saveText;
+ using QAbstractFormBuilder::resourceBuilder;
+ using QAbstractFormBuilder::textBuilder;
+ using QAbstractFormBuilder::toVariant;
+};
+
+template<class T>
+static void storeItemFlags(const T *item, QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const Qt::ItemFlags defaultFlags = T().flags();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ if (item->flags() != defaultFlags) {
+ DomProperty *p = new DomProperty;
+ p->setAttributeName(strings.flagsAttribute);
+ p->setElementSet(QString::fromAscii(itemFlags_enum.valueToKeys(item->flags())));
+ properties->append(p);
+ }
+}
+
+#ifndef Q_CC_RVCT
+// RVCT does not accept static inline functions if one argument is templated type
+// For this reason all necessary function variants are explicityly written for it.
+template<class T>
+static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const T *item,
+ QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = formBuilder->saveText(it.second, item->data(it.first.second))))
+ properties->append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(it.first)).isValid() &&
+ (p = variantToDomProperty(abstractFormBuilder,
+ static_cast<const QMetaObject *>(&QAbstractFormBuilderGadget::staticMetaObject),
+ it.second, v)))
+ properties->append(p);
+
+ if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole))))
+ properties->append(p);
+}
+
+template<class T>
+static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const T *item,
+ QList<DomProperty*> *properties)
+{
+ storeItemProps<T>(abstractFormBuilder, item, properties);
+ storeItemFlags<T>(item, properties);
+}
+
+template<class T>
+static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, T *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = formBuilder->textBuilder()->loadText(p);
+ QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v);
+ item->setData(it.first.first, qvariant_cast<QString>(nativeValue));
+ item->setData(it.first.second, v);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ item->setData(it.first, v);
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p);
+ QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v);
+ item->setIcon(qvariant_cast<QIcon>(nativeValue));
+ item->setData(Qt::DecorationPropertyRole, v);
+ }
+}
+
+template<class T>
+static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, T *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ loadItemProps<T>(abstractFormBuilder, item, properties);
+
+ DomProperty *p;
+ if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set)
+ item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
+}
+
+#else
+
+static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = formBuilder->saveText(it.second, item->data(it.first.second))))
+ properties->append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(it.first)).isValid() &&
+ (p = variantToDomProperty(abstractFormBuilder,
+ static_cast<const QMetaObject *>(&QAbstractFormBuilderGadget::staticMetaObject),
+ it.second, v)))
+ properties->append(p);
+
+ if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole))))
+ properties->append(p);
+}
+
+static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = formBuilder->saveText(it.second, item->data(it.first.second))))
+ properties->append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(it.first)).isValid() &&
+ (p = variantToDomProperty(abstractFormBuilder,
+ static_cast<const QMetaObject *>(&QAbstractFormBuilderGadget::staticMetaObject),
+ it.second, v)))
+ properties->append(p);
+
+ if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole))))
+ properties->append(p);
+}
+
+static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ storeItemProps(abstractFormBuilder, item, properties);
+ storeItemFlags(item, properties);
+}
+
+static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item,
+ QList<DomProperty*> *properties)
+{
+ storeItemProps(abstractFormBuilder, item, properties);
+ storeItemFlags(item, properties);
+}
+
+static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = formBuilder->textBuilder()->loadText(p);
+ QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v);
+ item->setData(it.first.first, qvariant_cast<QString>(nativeValue));
+ item->setData(it.first.second, v);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ item->setData(it.first, v);
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p);
+ QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v);
+ item->setIcon(qvariant_cast<QIcon>(nativeValue));
+ item->setData(Qt::DecorationPropertyRole, v);
+ }
+}
+
+static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ FriendlyFB * const formBuilder = static_cast<FriendlyFB *>(abstractFormBuilder);
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = formBuilder->textBuilder()->loadText(p);
+ QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v);
+ item->setData(it.first.first, qvariant_cast<QString>(nativeValue));
+ item->setData(it.first.second, v);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ item->setData(it.first, v);
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p);
+ QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v);
+ item->setIcon(qvariant_cast<QIcon>(nativeValue));
+ item->setData(Qt::DecorationPropertyRole, v);
+ }
+}
+
+static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ loadItemProps(abstractFormBuilder, item, properties);
+
+ DomProperty *p;
+ if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set)
+ item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
+}
+
+static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item,
+ const QHash<QString, DomProperty*> &properties)
+{
+ static const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ static const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ loadItemProps(abstractFormBuilder, item, properties);
+
+ DomProperty *p;
+ if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set)
+ item->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, p->elementSet().toAscii()));
+}
+
+#endif
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveTreeWidgetExtraInfo(QTreeWidget *treeWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_parentWidget);
+
+ QList<DomColumn*> columns;
+ DomProperty *p;
+ QVariant v;
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ // save the header
+ for (int c = 0; c<treeWidget->columnCount(); ++c) {
+ DomColumn *column = new DomColumn;
+
+ QList<DomProperty*> properties;
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) {
+ p = saveText(it.second, treeWidget->headerItem()->data(c, it.first.second));
+ // Prevent uic 4.4.X from crashing if it cannot find a column text
+ if (!p && it.first.first == Qt::EditRole && it.second == QLatin1String("text")) {
+ DomString *defaultHeader = new DomString;
+ defaultHeader->setText(QString::number(c + 1));
+ defaultHeader->setAttributeNotr(QLatin1String("true"));
+ p = new DomProperty;
+ p->setAttributeName(it.second);
+ p->setElementString(defaultHeader);
+ }
+ if (p)
+ properties.append(p);
+ }
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = treeWidget->headerItem()->data(c, it.first)).isValid() &&
+ (p = variantToDomProperty(this, &QAbstractFormBuilderGadget::staticMetaObject, it.second, v)))
+ properties.append(p);
+
+ if ((p = saveResource(treeWidget->headerItem()->data(c, Qt::DecorationPropertyRole))))
+ properties.append(p);
+
+ column->setElementProperty(properties);
+ columns.append(column);
+ }
+
+ ui_widget->setElementColumn(columns);
+
+ QList<DomItem *> items = ui_widget->elementItem();
+
+ QQueue<QPair<QTreeWidgetItem *, DomItem *> > pendingQueue;
+ for (int i = 0; i < treeWidget->topLevelItemCount(); i++)
+ pendingQueue.enqueue(qMakePair(treeWidget->topLevelItem(i), (DomItem *)0));
+
+ while (!pendingQueue.isEmpty()) {
+ const QPair<QTreeWidgetItem *, DomItem *> pair = pendingQueue.dequeue();
+ QTreeWidgetItem *item = pair.first;
+ DomItem *parentDomItem = pair.second;
+
+ DomItem *currentDomItem = new DomItem;
+
+ QList<DomProperty*> properties;
+ for (int c = 0; c < treeWidget->columnCount(); c++) {
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = saveText(it.second, item->data(c, it.first.second))))
+ properties.append(p);
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((v = item->data(c, it.first)).isValid() &&
+ (p = variantToDomProperty(this, &QAbstractFormBuilderGadget::staticMetaObject, it.second, v)))
+ properties.append(p);
+
+ if ((p = saveResource(item->data(c, Qt::DecorationPropertyRole))))
+ properties.append(p);
+ }
+ storeItemFlags(item, &properties);
+ currentDomItem->setElementProperty(properties);
+
+ if (parentDomItem) {
+ QList<DomItem *> childrenItems = parentDomItem->elementItem();
+ childrenItems.append(currentDomItem);
+ parentDomItem->setElementItem(childrenItems);
+ } else
+ items.append(currentDomItem);
+
+ for (int i = 0; i < item->childCount(); i++)
+ pendingQueue.enqueue(qMakePair(item->child(i), currentDomItem));
+ }
+
+ ui_widget->setElementItem(items);
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveTableWidgetExtraInfo(QTableWidget *tableWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_parentWidget);
+
+ // save the horizontal header
+ QList<DomColumn*> columns;
+ for (int c = 0; c < tableWidget->columnCount(); c++) {
+ QList<DomProperty*> properties;
+ QTableWidgetItem *item = tableWidget->horizontalHeaderItem(c);
+ if (item)
+ storeItemProps(this, item, &properties);
+
+ DomColumn *column = new DomColumn;
+ column->setElementProperty(properties);
+ columns.append(column);
+ }
+ ui_widget->setElementColumn(columns);
+
+ // save the vertical header
+ QList<DomRow*> rows;
+ for (int r = 0; r < tableWidget->rowCount(); r++) {
+ QList<DomProperty*> properties;
+ QTableWidgetItem *item = tableWidget->verticalHeaderItem(r);
+ if (item)
+ storeItemProps(this, item, &properties);
+
+ DomRow *row = new DomRow;
+ row->setElementProperty(properties);
+ rows.append(row);
+ }
+ ui_widget->setElementRow(rows);
+
+ QList<DomItem *> items = ui_widget->elementItem();
+ for (int r = 0; r < tableWidget->rowCount(); r++)
+ for (int c = 0; c < tableWidget->columnCount(); c++) {
+ QTableWidgetItem *item = tableWidget->item(r, c);
+ if (item) {
+ QList<DomProperty*> properties;
+ storeItemPropsNFlags(this, item, &properties);
+
+ DomItem *domItem = new DomItem;
+ domItem->setAttributeRow(r);
+ domItem->setAttributeColumn(c);
+ domItem->setElementProperty(properties);
+ items.append(domItem);
+ }
+ }
+
+ ui_widget->setElementItem(items);
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveListWidgetExtraInfo(QListWidget *listWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_parentWidget);
+
+ QList<DomItem*> ui_items = ui_widget->elementItem();
+ for (int i=0; i<listWidget->count(); ++i) {
+ QList<DomProperty*> properties;
+ storeItemPropsNFlags(this, listWidget->item(i), &properties);
+
+ DomItem *ui_item = new DomItem();
+ ui_item->setElementProperty(properties);
+ ui_items.append(ui_item);
+ }
+
+ ui_widget->setElementItem(ui_items);
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveComboBoxExtraInfo(QComboBox *comboBox, DomWidget *ui_widget, DomWidget *ui_parentWidget)
+{
+ Q_UNUSED(ui_parentWidget);
+ QList<DomItem*> ui_items = ui_widget->elementItem();
+
+ const int count = comboBox->count();
+ for (int i=0; i < count; ++i) {
+ // We might encounter items for which both builders return 0 in Designer
+ // (indicating a custom combo adding items in the constructor). Ignore those.
+ DomProperty *textProperty = saveText(QFormBuilderStrings::instance().textAttribute,
+ comboBox->itemData(i, Qt::DisplayPropertyRole));
+ DomProperty *iconProperty = saveResource(comboBox->itemData(i, Qt::DecorationPropertyRole));
+ if (textProperty || iconProperty) {
+ QList<DomProperty*> properties;
+ if (textProperty)
+ properties.push_back(textProperty);
+ if (iconProperty)
+ properties.push_back(iconProperty);
+
+ DomItem *ui_item = new DomItem();
+ ui_item->setElementProperty(properties);
+ ui_items.push_back(ui_item);
+ }
+ }
+
+ ui_widget->setElementItem(ui_items);
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+void QAbstractFormBuilder::saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *)
+{
+ typedef QList<DomProperty*> DomPropertyList;
+ if (const QButtonGroup *buttonGroup = widget->group()) {
+ DomPropertyList attributes = ui_widget->elementAttribute();
+ DomString *domString = new DomString();
+ domString->setText(buttonGroup->objectName());
+ domString->setAttributeNotr(QLatin1String("true"));
+ DomProperty *domProperty = new DomProperty();
+ domProperty->setAttributeName(QLatin1String(buttonGroupPropertyC));
+ domProperty->setElementString(domString);
+ attributes += domProperty;
+ ui_widget->setElementAttribute(attributes);
+ }
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemView,
+ DomWidget *ui_widget, DomWidget *)
+{
+ //
+ // Special handling for qtableview/qtreeview fake header attributes
+ //
+ static QStringList realPropertyNames =
+ (QStringList() << QLatin1String("visible")
+ << QLatin1String("cascadingSectionResizes")
+ << QLatin1String("defaultSectionSize")
+ << QLatin1String("highlightSections")
+ << QLatin1String("minimumSectionSize")
+ << QLatin1String("showSortIndicator")
+ << QLatin1String("stretchLastSection"));
+
+ if (const QTreeView *treeView = qobject_cast<const QTreeView*>(itemView)) {
+ QList<DomProperty*> viewProperties = ui_widget->elementAttribute();
+ QList<DomProperty*> headerProperties = computeProperties(treeView->header());
+ foreach (const QString &realPropertyName, realPropertyNames) {
+ const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ + realPropertyName.mid(1);
+ const QString fakePropertyName = QLatin1String("header") + upperPropertyName;
+ foreach (DomProperty *property, headerProperties) {
+ if (property->attributeName() == realPropertyName) {
+ property->setAttributeName(fakePropertyName);
+ viewProperties << property;
+ }
+ }
+ }
+ ui_widget->setElementAttribute(viewProperties);
+ } else if (const QTableView *tableView = qobject_cast<const QTableView*>(itemView)) {
+ static QStringList headerPrefixes =
+ (QStringList() << QLatin1String("horizontalHeader")
+ << QLatin1String("verticalHeader"));
+
+ QList<DomProperty*> viewProperties = ui_widget->elementAttribute();
+ foreach (const QString &headerPrefix, headerPrefixes) {
+ QList<DomProperty*> headerProperties;
+ if (headerPrefix == QLatin1String("horizontalHeader"))
+ headerProperties = computeProperties(tableView->horizontalHeader());
+ else
+ headerProperties = computeProperties(tableView->verticalHeader());
+ foreach (const QString &realPropertyName, realPropertyNames) {
+ const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ + realPropertyName.mid(1);
+ const QString fakePropertyName = headerPrefix + upperPropertyName;
+ foreach (DomProperty *property, headerProperties) {
+ if (property->attributeName() == realPropertyName) {
+ property->setAttributeName(fakePropertyName);
+ viewProperties << property;
+ }
+ }
+ }
+ }
+ ui_widget->setElementAttribute(viewProperties);
+ }
+}
+
+/*!
+ \internal
+ \since 4.4
+*/
+
+void QAbstractFormBuilder::setResourceBuilder(QResourceBuilder *builder)
+{
+ d->setResourceBuilder(builder);
+}
+
+/*!
+ \internal
+ \since 4.4
+*/
+
+QResourceBuilder *QAbstractFormBuilder::resourceBuilder() const
+{
+ return d->resourceBuilder();
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+void QAbstractFormBuilder::setTextBuilder(QTextBuilder *builder)
+{
+ d->setTextBuilder(builder);
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+QTextBuilder *QAbstractFormBuilder::textBuilder() const
+{
+ return d->textBuilder();
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::saveExtraInfo(QWidget *widget, DomWidget *ui_widget,
+ DomWidget *ui_parentWidget)
+{
+ if (QListWidget *listWidget = qobject_cast<QListWidget*>(widget)) {
+ saveListWidgetExtraInfo(listWidget, ui_widget, ui_parentWidget);
+ } else if (QTreeWidget *treeWidget = qobject_cast<QTreeWidget*>(widget)) {
+ saveTreeWidgetExtraInfo(treeWidget, ui_widget, ui_parentWidget);
+ } else if (QTableWidget *tableWidget = qobject_cast<QTableWidget*>(widget)) {
+ saveTableWidgetExtraInfo(tableWidget, ui_widget, ui_parentWidget);
+ } else if (QComboBox *comboBox = qobject_cast<QComboBox*>(widget)) {
+ if (!qobject_cast<QFontComboBox*>(widget))
+ saveComboBoxExtraInfo(comboBox, ui_widget, ui_parentWidget);
+ } else if(QAbstractButton *ab = qobject_cast<QAbstractButton *>(widget)) {
+ saveButtonExtraInfo(ab, ui_widget, ui_parentWidget);
+ }
+ if (QAbstractItemView *itemView = qobject_cast<QAbstractItemView *>(widget)) {
+ saveItemViewExtraInfo(itemView, ui_widget, ui_parentWidget);
+ }
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::loadListWidgetExtraInfo(DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget)
+{
+ Q_UNUSED(parentWidget);
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+
+ foreach (DomItem *ui_item, ui_widget->elementItem()) {
+ const DomPropertyHash properties = propertyMap(ui_item->elementProperty());
+ QListWidgetItem *item = new QListWidgetItem(listWidget);
+#ifndef Q_CC_RVCT
+ loadItemPropsNFlags<QListWidgetItem>(this, item, properties);
+#else
+ loadItemPropsNFlags(this, item, properties);
+#endif
+ }
+
+ DomProperty *currentRow = propertyMap(ui_widget->elementProperty()).value(strings.currentRowProperty);
+ if (currentRow)
+ listWidget->setCurrentRow(currentRow->elementNumber());
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::loadTreeWidgetExtraInfo(DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget)
+{
+ Q_UNUSED(parentWidget);
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ const QMetaEnum itemFlags_enum = metaEnum<QAbstractFormBuilderGadget>("itemFlags");
+ const QList<DomColumn*> columns = ui_widget->elementColumn();
+ if (columns.count() > 0)
+ treeWidget->setColumnCount(columns.count());
+
+ for (int i = 0; i<columns.count(); ++i) {
+ const DomColumn *c = columns.at(i);
+ const DomPropertyHash properties = propertyMap(c->elementProperty());
+
+ DomProperty *p;
+ QVariant v;
+
+ foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles)
+ if ((p = properties.value(it.second)) &&
+ (v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid())
+ treeWidget->headerItem()->setData(i, it.first, v);
+
+ foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles)
+ if ((p = properties.value(it.second))) {
+ v = textBuilder()->loadText(p);
+ QVariant nativeValue = textBuilder()->toNativeValue(v);
+ treeWidget->headerItem()->setData(i, it.first.first, qvariant_cast<QString>(nativeValue));
+ treeWidget->headerItem()->setData(i, it.first.second, v);
+ }
+
+ if ((p = properties.value(strings.iconAttribute))) {
+ v = resourceBuilder()->loadResource(workingDirectory(), p);
+ QVariant nativeValue = resourceBuilder()->toNativeValue(v);
+ treeWidget->headerItem()->setIcon(i, qvariant_cast<QIcon>(nativeValue));
+ treeWidget->headerItem()->setData(i, Qt::DecorationPropertyRole, v);
+ }
+ }
+
+ QQueue<QPair<DomItem *, QTreeWidgetItem *> > pendingQueue;
+ foreach (DomItem *ui_item, ui_widget->elementItem())
+ pendingQueue.enqueue(qMakePair(ui_item, (QTreeWidgetItem *)0));
+
+ while (!pendingQueue.isEmpty()) {
+ const QPair<DomItem *, QTreeWidgetItem *> pair = pendingQueue.dequeue();
+ const DomItem *domItem = pair.first;
+ QTreeWidgetItem *parentItem = pair.second;
+
+ QTreeWidgetItem *currentItem = 0;
+
+ if (parentItem)
+ currentItem = new QTreeWidgetItem(parentItem);
+ else
+ currentItem = new QTreeWidgetItem(treeWidget);
+
+ const QList<DomProperty *> properties = domItem->elementProperty();
+ int col = -1;
+ foreach (DomProperty *property, properties) {
+ if (property->attributeName() == strings.flagsAttribute && !property->elementSet().isEmpty()) {
+ currentItem->setFlags(enumKeysToValue<Qt::ItemFlags>(itemFlags_enum, property->elementSet().toAscii()));
+ } else if (property->attributeName() == strings.textAttribute && property->elementString()) {
+ col++;
+ QVariant textV = textBuilder()->loadText(property);
+ QVariant nativeValue = textBuilder()->toNativeValue(textV);
+ currentItem->setText(col, qvariant_cast<QString>(nativeValue));
+ currentItem->setData(col, Qt::DisplayPropertyRole, textV);
+ } else if (col >= 0) {
+ if (property->attributeName() == strings.iconAttribute) {
+ QVariant v = resourceBuilder()->loadResource(workingDirectory(), property);
+ if (v.isValid()) {
+ QVariant nativeValue = resourceBuilder()->toNativeValue(v);
+ currentItem->setIcon(col, qvariant_cast<QIcon>(nativeValue));
+ currentItem->setData(col, Qt::DecorationPropertyRole, v);
+ }
+ } else {
+ QVariant v;
+ int role = strings.treeItemRoleHash.value(property->attributeName(), (Qt::ItemDataRole)-1);
+ if (role >= 0) {
+ if ((v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, property)).isValid())
+ currentItem->setData(col, role, v);
+ } else {
+ QPair<Qt::ItemDataRole, Qt::ItemDataRole> rolePair =
+ strings.treeItemTextRoleHash.value(property->attributeName(),
+ qMakePair((Qt::ItemDataRole)-1, (Qt::ItemDataRole)-1));
+ if (rolePair.first >= 0) {
+ QVariant textV = textBuilder()->loadText(property);
+ QVariant nativeValue = textBuilder()->toNativeValue(textV);
+ currentItem->setData(col, rolePair.first, qvariant_cast<QString>(nativeValue));
+ currentItem->setData(col, rolePair.second, textV);
+ }
+ }
+ }
+ }
+ }
+
+ foreach (DomItem *childItem, domItem->elementItem())
+ pendingQueue.enqueue(qMakePair(childItem, currentItem));
+
+ }
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::loadTableWidgetExtraInfo(DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget)
+{
+ Q_UNUSED(parentWidget);
+
+ const QList<DomColumn*> columns = ui_widget->elementColumn();
+ if (columns.count() > 0)
+ tableWidget->setColumnCount(columns.count());
+ for (int i = 0; i< columns.count(); i++) {
+ DomColumn *c = columns.at(i);
+ const DomPropertyHash properties = propertyMap(c->elementProperty());
+
+ if (!properties.isEmpty()) {
+ QTableWidgetItem *item = new QTableWidgetItem;
+ loadItemProps(this, item, properties);
+ tableWidget->setHorizontalHeaderItem(i, item);
+ }
+ }
+
+ const QList<DomRow*> rows = ui_widget->elementRow();
+ if (rows.count() > 0)
+ tableWidget->setRowCount(rows.count());
+ for (int i = 0; i< rows.count(); i++) {
+ const DomRow *r = rows.at(i);
+ const DomPropertyHash properties = propertyMap(r->elementProperty());
+
+ if (!properties.isEmpty()) {
+ QTableWidgetItem *item = new QTableWidgetItem;
+ loadItemProps(this, item, properties);
+ tableWidget->setVerticalHeaderItem(i, item);
+ }
+ }
+
+ foreach (DomItem *ui_item, ui_widget->elementItem()) {
+ if (ui_item->hasAttributeRow() && ui_item->hasAttributeColumn()) {
+ const DomPropertyHash properties = propertyMap(ui_item->elementProperty());
+ QTableWidgetItem *item = new QTableWidgetItem;
+ loadItemPropsNFlags(this, item, properties);
+ tableWidget->setItem(ui_item->attributeRow(), ui_item->attributeColumn(), item);
+ }
+ }
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::loadComboBoxExtraInfo(DomWidget *ui_widget, QComboBox *comboBox, QWidget *parentWidget)
+{
+ Q_UNUSED(parentWidget);
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ foreach (DomItem *ui_item, ui_widget->elementItem()) {
+ const DomPropertyHash properties = propertyMap(ui_item->elementProperty());
+ QString text;
+ QIcon icon;
+ QVariant textData;
+ QVariant iconData;
+
+ DomProperty *p = 0;
+
+ p = properties.value(strings.textAttribute);
+ if (p && p->elementString()) {
+ textData = textBuilder()->loadText(p);
+ text = qvariant_cast<QString>(textBuilder()->toNativeValue(textData));
+ }
+
+ p = properties.value(strings.iconAttribute);
+ if (p) {
+ iconData = resourceBuilder()->loadResource(workingDirectory(), p);
+ icon = qvariant_cast<QIcon>(resourceBuilder()->toNativeValue(iconData));
+ }
+
+ comboBox->addItem(icon, text);
+ comboBox->setItemData((comboBox->count()-1), iconData, Qt::DecorationPropertyRole);
+ comboBox->setItemData((comboBox->count()-1), textData, Qt::DisplayPropertyRole);
+ }
+
+ DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty);
+ if (currentIndex)
+ comboBox->setCurrentIndex(currentIndex->elementNumber());
+}
+
+// Get the button group name out of a widget's attribute list
+static QString buttonGroupName(const DomWidget *ui_widget)
+{
+ typedef QList<DomProperty*> DomPropertyList;
+ const DomPropertyList attributes = ui_widget->elementAttribute();
+ if (attributes.empty())
+ return QString();
+ const QString buttonGroupProperty = QLatin1String(buttonGroupPropertyC);
+ const DomPropertyList::const_iterator cend = attributes.constEnd();
+ for (DomPropertyList::const_iterator it = attributes.constBegin(); it != cend; ++it)
+ if ( (*it)->attributeName() == buttonGroupProperty)
+ return (*it)->elementString()->text();
+ return QString();
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+void QAbstractFormBuilder::loadButtonExtraInfo(const DomWidget *ui_widget, QAbstractButton *button, QWidget *)
+{
+ typedef QFormBuilderExtra::ButtonGroupEntry ButtonGroupEntry;
+ typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash;
+
+ const QString groupName = buttonGroupName(ui_widget);
+ if (groupName.isEmpty())
+ return;
+ // Find entry
+ ButtonGroupHash &buttonGroups = d->buttonGroups();
+ ButtonGroupHash::iterator it = buttonGroups.find(groupName);
+ if (it == buttonGroups.end()) {
+#ifdef QFORMINTERNAL_NAMESPACE // Suppress the warning when copying in Designer
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Invalid QButtonGroup reference '%1' referenced by '%2'.").arg(groupName, button->objectName()));
+#endif
+ return;
+ }
+ // Create button group on demand?
+ QButtonGroup *&group = it.value().second;
+ if (group == 0) {
+ group = new QButtonGroup;
+ group->setObjectName(groupName);
+ applyProperties(group, it.value().first->elementProperty());
+ }
+ group->addButton(button);
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstractItemView *itemView,
+ QWidget *)
+{
+ //
+ // Special handling for qtableview/qtreeview fake header attributes
+ //
+ static QStringList realPropertyNames =
+ (QStringList() << QLatin1String("visible")
+ << QLatin1String("cascadingSectionResizes")
+ << QLatin1String("defaultSectionSize")
+ << QLatin1String("highlightSections")
+ << QLatin1String("minimumSectionSize")
+ << QLatin1String("showSortIndicator")
+ << QLatin1String("stretchLastSection"));
+
+ if (QTreeView *treeView = qobject_cast<QTreeView*>(itemView)) {
+ QList<DomProperty*> allAttributes = ui_widget->elementAttribute();
+ QList<DomProperty*> headerProperties;
+ foreach (const QString &realPropertyName, realPropertyNames) {
+ const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ + realPropertyName.mid(1);
+ const QString fakePropertyName = QLatin1String("header") + upperPropertyName;
+ foreach (DomProperty *attr, allAttributes) {
+ if (attr->attributeName() == fakePropertyName) {
+ attr->setAttributeName(realPropertyName);
+ headerProperties << attr;
+ }
+ }
+ }
+ applyProperties(treeView->header(), headerProperties);
+ } else if (QTableView *tableView = qobject_cast<QTableView*>(itemView)) {
+ static QStringList headerPrefixes =
+ (QStringList() << QLatin1String("horizontalHeader")
+ << QLatin1String("verticalHeader"));
+
+ QList<DomProperty*> allAttributes = ui_widget->elementAttribute();
+ foreach (const QString &headerPrefix, headerPrefixes) {
+ QList<DomProperty*> headerProperties;
+ foreach (const QString &realPropertyName, realPropertyNames) {
+ const QString upperPropertyName = realPropertyName.at(0).toUpper()
+ + realPropertyName.mid(1);
+ const QString fakePropertyName = headerPrefix + upperPropertyName;
+ foreach (DomProperty *attr, allAttributes) {
+ if (attr->attributeName() == fakePropertyName) {
+ attr->setAttributeName(realPropertyName);
+ headerProperties << attr;
+ }
+ }
+ }
+ if (headerPrefix == QLatin1String("horizontalHeader"))
+ applyProperties(tableView->horizontalHeader(), headerProperties);
+ else
+ applyProperties(tableView->verticalHeader(), headerProperties);
+ }
+ }
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
+{
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ if (0) {
+#ifndef QT_NO_LISTWIDGET
+ } else if (QListWidget *listWidget = qobject_cast<QListWidget*>(widget)) {
+ loadListWidgetExtraInfo(ui_widget, listWidget, parentWidget);
+#endif
+#ifndef QT_NO_TREEWIDGET
+ } else if (QTreeWidget *treeWidget = qobject_cast<QTreeWidget*>(widget)) {
+ loadTreeWidgetExtraInfo(ui_widget, treeWidget, parentWidget);
+#endif
+#ifndef QT_NO_TABLEWIDGET
+ } else if (QTableWidget *tableWidget = qobject_cast<QTableWidget*>(widget)) {
+ loadTableWidgetExtraInfo(ui_widget, tableWidget, parentWidget);
+#endif
+#ifndef QT_NO_COMBOBOX
+ } else if (QComboBox *comboBox = qobject_cast<QComboBox*>(widget)) {
+ if (!qobject_cast<QFontComboBox *>(widget))
+ loadComboBoxExtraInfo(ui_widget, comboBox, parentWidget);
+#endif
+#ifndef QT_NO_TABWIDGET
+ } else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(widget)) {
+ const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty);
+ if (currentIndex)
+ tabWidget->setCurrentIndex(currentIndex->elementNumber());
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+ } else if (QStackedWidget *stackedWidget = qobject_cast<QStackedWidget*>(widget)) {
+ const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty);
+ if (currentIndex)
+ stackedWidget->setCurrentIndex(currentIndex->elementNumber());
+#endif
+#ifndef QT_NO_TOOLBOX
+ } else if (QToolBox *toolBox = qobject_cast<QToolBox*>(widget)) {
+ const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty);
+ if (currentIndex)
+ toolBox->setCurrentIndex(currentIndex->elementNumber());
+ const DomProperty *tabSpacing = propertyMap(ui_widget->elementProperty()).value(strings.tabSpacingProperty);
+ if (tabSpacing)
+ toolBox->layout()->setSpacing(tabSpacing->elementNumber());
+#endif
+ } else if (QAbstractButton *ab = qobject_cast<QAbstractButton *>(widget)) {
+ loadButtonExtraInfo(ui_widget, ab, parentWidget);
+ }
+ if (QAbstractItemView *itemView = qobject_cast<QAbstractItemView *>(widget)) {
+ loadItemViewExtraInfo(ui_widget, itemView, parentWidget);
+ }
+}
+
+/*!
+ Returns the current working directory of the form builder.
+
+ \sa setWorkingDirectory() */
+QDir QAbstractFormBuilder::workingDirectory() const
+{
+ return d->m_workingDirectory;
+}
+
+/*!
+ Sets the current working directory of the form builder to the
+ specified \a directory.
+
+ \sa workingDirectory()*/
+void QAbstractFormBuilder::setWorkingDirectory(const QDir &directory)
+{
+ d->m_workingDirectory = directory;
+}
+
+/*!
+ \internal
+*/
+DomAction *QAbstractFormBuilder::createDom(QAction *action)
+{
+ if (action->parentWidget() == action->menu() || action->isSeparator())
+ return 0;
+
+ DomAction *ui_action = new DomAction;
+ ui_action->setAttributeName(action->objectName());
+
+ const QList<DomProperty*> properties = computeProperties(action);
+ ui_action->setElementProperty(properties);
+
+ return ui_action;
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+DomButtonGroup *QAbstractFormBuilder::createDom(QButtonGroup *buttonGroup)
+{
+ if (buttonGroup->buttons().count() == 0) // Empty group left over on form?
+ return 0;
+ DomButtonGroup *domButtonGroup = new DomButtonGroup;
+ domButtonGroup->setAttributeName(buttonGroup->objectName());
+
+ QList<DomProperty*> properties = computeProperties(buttonGroup);
+ domButtonGroup->setElementProperty(properties);
+ return domButtonGroup;
+}
+
+/*!
+ \internal
+*/
+DomActionGroup *QAbstractFormBuilder::createDom(QActionGroup *actionGroup)
+{
+ DomActionGroup *ui_action_group = new DomActionGroup;
+ ui_action_group->setAttributeName(actionGroup->objectName());
+
+ QList<DomProperty*> properties = computeProperties(actionGroup);
+ ui_action_group->setElementProperty(properties);
+
+ QList<DomAction*> ui_actions;
+
+ foreach (QAction *action, actionGroup->actions()) {
+ if (DomAction *ui_action = createDom(action)) {
+ ui_actions.append(ui_action);
+ }
+ }
+
+ ui_action_group->setElementAction(ui_actions);
+
+ return ui_action_group;
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::addMenuAction(QAction *action)
+{
+ Q_UNUSED(action);
+}
+
+/*!
+ \internal
+*/
+void QAbstractFormBuilder::reset()
+{
+ d->m_laidout.clear();
+ d->m_actions.clear();
+ d->m_actionGroups.clear();
+ d->m_defaultMargin = INT_MIN;
+ d->m_defaultSpacing = INT_MIN;
+}
+
+/*!
+ \internal
+ Access meta enumeration for Qt::ToolBarArea
+*/
+
+QMetaEnum QAbstractFormBuilder::toolBarAreaMetaEnum()
+{
+ return metaEnum<QAbstractFormBuilderGadget>("toolBarArea");
+}
+
+/*!
+ \internal
+ Return paths of an icon.
+*/
+
+QAbstractFormBuilder::IconPaths QAbstractFormBuilder::iconPaths(const QIcon &icon) const
+{
+ Q_UNUSED(icon);
+ qWarning() << "QAbstractFormBuilder::iconPaths() is obsoleted";
+ return IconPaths();
+}
+
+/*!
+ \internal
+ Return paths of a pixmap.
+*/
+
+QAbstractFormBuilder::IconPaths QAbstractFormBuilder::pixmapPaths(const QPixmap &pixmap) const
+{
+ Q_UNUSED(pixmap);
+ qWarning() << "QAbstractFormBuilder::pixmapPaths() is obsoleted";
+ return IconPaths();
+}
+
+/*!
+ \internal
+ Set up a DOM property with icon.
+*/
+
+void QAbstractFormBuilder::setIconProperty(DomProperty &p, const IconPaths &ip) const
+{
+ DomResourceIcon *dpi = new DomResourceIcon;
+
+ /* TODO
+ if (!ip.second.isEmpty())
+ pix->setAttributeResource(ip.second);
+*/
+ dpi->setText(ip.first);
+
+ p.setAttributeName(QFormBuilderStrings::instance().iconAttribute);
+ p.setElementIconSet(dpi);
+}
+
+/*!
+ \internal
+ Set up a DOM property with pixmap.
+*/
+
+void QAbstractFormBuilder::setPixmapProperty(DomProperty &p, const IconPaths &ip) const
+{
+ DomResourcePixmap *pix = new DomResourcePixmap;
+ if (!ip.second.isEmpty())
+ pix->setAttributeResource(ip.second);
+
+ pix->setText(ip.first);
+
+ p.setAttributeName(QFormBuilderStrings::instance().pixmapAttribute);
+ p.setElementPixmap(pix);
+}
+
+/*!
+ \internal
+ Convenience. Return DOM property for icon; 0 if icon.isNull().
+*/
+
+DomProperty* QAbstractFormBuilder::iconToDomProperty(const QIcon &icon) const
+{
+ Q_UNUSED(icon);
+ qWarning() << "QAbstractFormBuilder::iconToDomProperty() is obsoleted";
+ return 0;
+}
+
+/*!
+ \internal
+ \since 4.4
+*/
+
+DomProperty *QAbstractFormBuilder::saveResource(const QVariant &v) const
+{
+ if (v.isNull())
+ return 0;
+
+ DomProperty *p = resourceBuilder()->saveResource(workingDirectory(), v);
+ if (p)
+ p->setAttributeName(QFormBuilderStrings::instance().iconAttribute);
+ return p;
+}
+
+/*!
+ \internal
+ \since 4.5
+*/
+
+DomProperty *QAbstractFormBuilder::saveText(const QString &attributeName, const QVariant &v) const
+{
+ if (v.isNull())
+ return 0;
+
+ DomProperty *p = textBuilder()->saveText(v);
+ if (p)
+ p->setAttributeName(attributeName);
+ return p;
+}
+
+/*!
+ \internal
+ Return the appropriate DOM pixmap for an image dom property.
+ From 4.4 - unused
+*/
+
+const DomResourcePixmap *QAbstractFormBuilder::domPixmap(const DomProperty* p) {
+ switch (p->kind()) {
+ case DomProperty::IconSet:
+ qDebug() << "** WARNING QAbstractFormBuilder::domPixmap() called for icon set!";
+ break;
+ case DomProperty::Pixmap:
+ return p->elementPixmap();
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*!
+ \internal
+ Create icon from DOM.
+ From 4.4 - unused
+*/
+
+QIcon QAbstractFormBuilder::domPropertyToIcon(const DomResourcePixmap *icon)
+{
+ Q_UNUSED(icon);
+ qWarning() << "QAbstractFormBuilder::domPropertyToIcon() is obsoleted";
+ return QIcon();
+}
+
+/*!
+ \internal
+ Create icon from DOM. Assert if !domPixmap
+ From 4.4 - unused
+*/
+
+QIcon QAbstractFormBuilder::domPropertyToIcon(const DomProperty* p)
+{
+ Q_UNUSED(p);
+ qWarning() << "QAbstractFormBuilder::domPropertyToIcon() is obsoleted";
+ return QIcon();
+}
+
+
+/*!
+ \internal
+ Create pixmap from DOM.
+ From 4.4 - unused
+*/
+
+QPixmap QAbstractFormBuilder::domPropertyToPixmap(const DomResourcePixmap* pixmap)
+{
+ Q_UNUSED(pixmap);
+ qWarning() << "QAbstractFormBuilder::domPropertyToPixmap() is obsoleted";
+ return QPixmap();
+}
+
+
+/*!
+ \internal
+ Create pixmap from DOM. Assert if !domPixmap
+ From 4.4 - unused
+*/
+
+QPixmap QAbstractFormBuilder::domPropertyToPixmap(const DomProperty* p)
+{
+ Q_UNUSED(p);
+ qWarning() << "QAbstractFormBuilder::domPropertyToPixmap() is obsoleted";
+ return QPixmap();
+}
+
+/*!
+ \fn void QAbstractFormBuilder::createConnections ( DomConnections *, QWidget * )
+ \internal
+*/
+
+/*!
+ \fn void QAbstractFormBuilder::createCustomWidgets ( DomCustomWidgets * )
+ \internal
+*/
+
+/*!
+ \fn void QAbstractFormBuilder::createResources ( DomResources * )
+ \internal
+*/
+
+/*!
+ \fn QFormScriptRunner *QAbstractFormBuilder::formScriptRunner() const
+ \internal
+ \since 4.3
+*/
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+QFormScriptRunner *QAbstractFormBuilder::formScriptRunner() const
+{
+ return &(d->formScriptRunner());
+}
+#endif
+
+/*!
+ Sets whether the execution of scripts is enabled to \a enabled.
+ \since 4.3
+ \internal
+*/
+
+void QAbstractFormBuilder::setScriptingEnabled(bool enabled)
+{
+#ifdef QT_FORMBUILDER_NO_SCRIPT
+ if (enabled)
+ uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "This version of the uitools library is linked without script support."));
+#else
+ QFormScriptRunner::Options options = formScriptRunner()->options();
+ if (enabled)
+ options &= ~QFormScriptRunner::DisableScripts;
+ else
+ options |= QFormScriptRunner::DisableScripts;
+ formScriptRunner()->setOptions(options);
+#endif
+}
+
+/*!
+ Returns whether the execution of scripts is enabled.
+ \sa setScriptingEnabled()
+ \since 4.3
+ \internal
+*/
+
+bool QAbstractFormBuilder::isScriptingEnabled() const
+{
+#ifdef QT_FORMBUILDER_NO_SCRIPT
+ return false;
+#else
+ return !(formScriptRunner()->options() & QFormScriptRunner::DisableScripts);
+#endif
+}
+
+/*!
+ Returns a human-readable description of the last error occurred in load().
+
+ \since 5.0
+ \sa load()
+*/
+
+QString QAbstractFormBuilder::errorString() const
+{
+ return d->m_errorString;
+}
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/abstractformbuilder.h b/src/designer/src/lib/uilib/abstractformbuilder.h
new file mode 100644
index 000000000..d0882500b
--- /dev/null
+++ b/src/designer/src/lib/uilib/abstractformbuilder.h
@@ -0,0 +1,283 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTFORMBUILDER_H
+#define ABSTRACTFORMBUILDER_H
+
+#include "uilib_global.h"
+
+#include <QtCore/QList>
+#include <QtCore/QHash>
+#include <QtCore/QDir>
+#include <QtCore/QScopedPointer>
+
+#include <QtWidgets/QSizePolicy>
+#include <QtGui/QPalette>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+#if 0
+// pragma for syncqt, don't remove.
+
+#pragma qt_class(QAbstractFormBuilder)
+#endif
+
+class QAction;
+class QButtonGroup;
+class QActionGroup;
+class QComboBox;
+class QIODevice;
+class QIcon;
+class QLayout;
+class QLayoutItem;
+class QListWidget;
+class QObject;
+class QSpacerItem;
+class QTreeWidget;
+class QTableWidget;
+class QVariant;
+class QWidget;
+class QAbstractButton;
+class QAbstractItemView;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class DomAction;
+class DomActionGroup;
+class DomButtonGroup;
+class DomButtonGroups;
+class DomActionRef;
+class DomBrush;
+class DomColorGroup;
+class DomConnections;
+class DomCustomWidgets;
+class DomLayout;
+class DomLayoutItem;
+class DomProperty;
+class DomResources;
+class DomSpacer;
+class DomString;
+class DomTabStops;
+class DomUI;
+class DomWidget;
+class DomResourcePixmap;
+
+class QResourceBuilder;
+class QTextBuilder;
+class QFormBuilderExtra;
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+class QFormScriptRunner;
+#endif
+
+class QDESIGNER_UILIB_EXPORT QAbstractFormBuilder
+{
+public:
+ QAbstractFormBuilder();
+ virtual ~QAbstractFormBuilder();
+
+ QDir workingDirectory() const;
+ void setWorkingDirectory(const QDir &directory);
+
+ virtual QWidget *load(QIODevice *dev, QWidget *parentWidget=0);
+ virtual void save(QIODevice *dev, QWidget *widget);
+
+ void setScriptingEnabled(bool enabled);
+ bool isScriptingEnabled() const;
+
+ QString errorString() const;
+
+protected:
+//
+// load
+//
+ virtual void loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
+
+ virtual QWidget *create(DomUI *ui, QWidget *parentWidget);
+ virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget);
+ virtual QLayout *create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget);
+ virtual QLayoutItem *create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget);
+
+ virtual QAction *create(DomAction *ui_action, QObject *parent);
+ virtual QActionGroup *create(DomActionGroup *ui_action_group, QObject *parent);
+ virtual void addMenuAction(QAction *action);
+
+ virtual void applyProperties(QObject *o, const QList<DomProperty*> &properties);
+ bool applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value);
+
+ virtual void applyTabStops(QWidget *widget, DomTabStops *tabStops);
+
+ virtual QWidget *createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name);
+ virtual QLayout *createLayout(const QString &layoutName, QObject *parent, const QString &name);
+ virtual QAction *createAction(QObject *parent, const QString &name);
+ virtual QActionGroup *createActionGroup(QObject *parent, const QString &name);
+
+ virtual void createCustomWidgets(DomCustomWidgets *) {}
+ virtual void createConnections(DomConnections *, QWidget *) {}
+ virtual void createResources(DomResources*) {}
+
+ virtual bool addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout);
+ virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
+
+//
+// save
+//
+ virtual void saveExtraInfo(QWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+
+ virtual void saveDom(DomUI *ui, QWidget *widget);
+
+ virtual DomActionRef *createActionRefDom(QAction *action);
+
+ virtual DomWidget *createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive = true);
+ virtual DomLayout *createDom(QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget);
+ virtual DomLayoutItem *createDom(QLayoutItem *item, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget);
+ virtual DomSpacer *createDom(QSpacerItem *spacer, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget);
+
+ virtual DomAction *createDom(QAction *action);
+ virtual DomActionGroup *createDom(QActionGroup *actionGroup);
+ DomButtonGroup *createDom(QButtonGroup *buttonGroup);
+
+ virtual DomConnections *saveConnections();
+ virtual DomCustomWidgets *saveCustomWidgets();
+ virtual DomTabStops *saveTabStops();
+ virtual DomResources *saveResources();
+ DomButtonGroups *saveButtonGroups(const QWidget *mainContainer);
+ virtual QList<DomProperty*> computeProperties(QObject *obj);
+ virtual bool checkProperty(QObject *obj, const QString &prop) const;
+ virtual DomProperty *createProperty(QObject *object, const QString &propertyName, const QVariant &value);
+
+ virtual void layoutInfo(DomLayout *layout, QObject *parent, int *margin, int *spacing);
+
+ void loadListWidgetExtraInfo(DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget);
+ void loadTreeWidgetExtraInfo(DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget);
+ void loadTableWidgetExtraInfo(DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget);
+ void loadComboBoxExtraInfo(DomWidget *ui_widget, QComboBox *comboBox, QWidget *parentWidget);
+ void loadButtonExtraInfo(const DomWidget *ui_widget, QAbstractButton *button, QWidget *parentWidget);
+ void loadItemViewExtraInfo(DomWidget *ui_widget, QAbstractItemView *itemView, QWidget *parentWidget);
+
+ void saveListWidgetExtraInfo(QListWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+ void saveTreeWidgetExtraInfo(QTreeWidget *treeWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+ void saveTableWidgetExtraInfo(QTableWidget *tablWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+ void saveComboBoxExtraInfo(QComboBox *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+ void saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+ void saveItemViewExtraInfo(const QAbstractItemView *itemView, DomWidget *ui_widget, DomWidget *ui_parentWidget);
+
+ void setResourceBuilder(QResourceBuilder *builder);
+ QResourceBuilder *resourceBuilder() const;
+ DomProperty *saveResource(const QVariant &v) const;
+
+ void setTextBuilder(QTextBuilder *builder);
+ QTextBuilder *textBuilder() const;
+ DomProperty *saveText(const QString &attributeName, const QVariant &v) const;
+//
+// utils
+//
+
+ QVariant toVariant(const QMetaObject *meta, DomProperty *property);
+ static QString toString(const DomString *str);
+
+ typedef QHash<QString, DomProperty*> DomPropertyHash;
+ static DomPropertyHash propertyMap(const QList<DomProperty*> &properties);
+
+ void setupColorGroup(QPalette &palette, QPalette::ColorGroup colorGroup, DomColorGroup *group);
+ DomColorGroup *saveColorGroup(const QPalette &palette);
+ QBrush setupBrush(DomBrush *brush);
+ DomBrush *saveBrush(const QBrush &brush);
+
+ void reset();
+ void initialize(const DomUI *ui);
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ QFormScriptRunner *formScriptRunner() const;
+#endif
+//
+// utils
+//
+
+ static QMetaEnum toolBarAreaMetaEnum();
+
+//
+// Icon/pixmap stuff
+//
+ // A Pair of icon path/qrc path.
+ typedef QPair<QString, QString> IconPaths;
+
+ IconPaths iconPaths(const QIcon &) const;
+ IconPaths pixmapPaths(const QPixmap &) const;
+ void setIconProperty(DomProperty &, const IconPaths &) const;
+ void setPixmapProperty(DomProperty &, const IconPaths &) const;
+ DomProperty* iconToDomProperty(const QIcon &) const;
+
+ static const DomResourcePixmap *domPixmap(const DomProperty* p);
+ QIcon domPropertyToIcon(const DomResourcePixmap *);
+ QIcon domPropertyToIcon(const DomProperty* p);
+ QPixmap domPropertyToPixmap(const DomResourcePixmap* p);
+ QPixmap domPropertyToPixmap(const DomProperty* p);
+
+private:
+//
+// utils
+//
+ static Qt::ToolBarArea toolbarAreaFromDOMAttributes(const DomPropertyHash &attributeMap);
+
+ QAbstractFormBuilder(const QAbstractFormBuilder &other);
+ void operator = (const QAbstractFormBuilder &other);
+
+ friend QDESIGNER_UILIB_EXPORT DomProperty *variantToDomProperty(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const QString &propertyName, const QVariant &value);
+ friend QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(QAbstractFormBuilder *abstractFormBuilder,const QMetaObject *meta, const DomProperty *property);
+
+protected:
+ QScopedPointer<QFormBuilderExtra> d;
+};
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // ABSTRACTFORMBUILDER_H
diff --git a/src/designer/src/lib/uilib/container.h b/src/designer/src/lib/uilib/container.h
new file mode 100644
index 000000000..cf670edaf
--- /dev/null
+++ b/src/designer/src/lib/uilib/container.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTAINER_H
+#define CONTAINER_H
+
+#include <QtDesigner/extension.h>
+#include <QtCore/QObject>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QWidget;
+
+class QDesignerContainerExtension
+{
+public:
+ virtual ~QDesignerContainerExtension() {}
+
+ virtual int count() const = 0;
+ virtual QWidget *widget(int index) const = 0;
+
+ virtual int currentIndex() const = 0;
+ virtual void setCurrentIndex(int index) = 0;
+
+ virtual void addWidget(QWidget *widget) = 0;
+ virtual void insertWidget(int index, QWidget *widget) = 0;
+ virtual void remove(int index) = 0;
+
+ virtual bool canAddWidget() const
+ // ### Qt6 remove body, provided in Qt5 for source compatibility to Qt4.
+ { return true; }
+ virtual bool canRemove(int index) const
+ // ### Qt6 remove body, provided in Qt5 for source compatibility to Qt4.
+ { Q_UNUSED(index); return true; }
+};
+Q_DECLARE_EXTENSION_INTERFACE(QDesignerContainerExtension, "com.trolltech.Qt.Designer.Container")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // CONTAINER_H
diff --git a/src/designer/src/lib/uilib/container.qdoc b/src/designer/src/lib/uilib/container.qdoc
new file mode 100644
index 000000000..8f7a07d30
--- /dev/null
+++ b/src/designer/src/lib/uilib/container.qdoc
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QDesignerContainerExtension
+ \brief The QDesignerContainerExtension class allows you to add pages to
+ a custom multi-page container in Qt Designer's workspace.
+ \inmodule QtDesigner
+
+ QDesignerContainerExtension provide an interface for creating
+ custom container extensions. A container extension consists of a
+ collection of functions that \QD needs to manage a multi-page
+ container plugin, and a list of the container's pages.
+
+ \image containerextension-example.png
+
+ \warning This is \e not an extension for container plugins in
+ general, only custom \e multi-page containers.
+
+ To create a container extension, your extension class must inherit
+ from both QObject and QDesignerContainerExtension. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 6
+
+ Since we are implementing an interface, we must ensure that it's
+ made known to the meta object system using the Q_INTERFACES()
+ macro. This enables \QD to use the qobject_cast() function to
+ query for supported interfaces using nothing but a QObject
+ pointer.
+
+ You must reimplement several functions to enable \QD to manage a
+ custom multi-page container widget: \QD uses count() to keep track
+ of the number pages in your container, widget() to return the page
+ at a given index in the list of the container's pages, and
+ currentIndex() to return the list index of the selected page. \QD
+ uses the addWidget() function to add a given page to the
+ container, expecting it to be appended to the list of pages, while
+ it expects the insertWidget() function to add a given page to the
+ container by inserting it at a given index.
+
+ In \QD the extensions are not created until they are
+ required. For that reason you must also create a
+ QExtensionFactory, i.e a class that is able to make an instance of
+ your extension, and register it using \QD's \l
+ {QExtensionManager}{extension manager}.
+
+ When a container extension is required, \QD's \l
+ {QExtensionManager}{extension manager} will run through all its
+ registered factories calling QExtensionFactory::createExtension()
+ for each until the first one that is able to create a container
+ extension, is found. This factory will then create the extension
+ for the plugin.
+
+ There are four available types of extensions in \QD:
+ QDesignerContainerExtension , QDesignerMemberSheetExtension,
+ QDesignerPropertySheetExtension and QDesignerTaskMenuExtension.
+ \QD's behavior is the same whether the requested extension is
+ associated with a multi page container, a member sheet, a property
+ sheet or a task menu.
+
+ The QExtensionFactory class provides a standard extension factory,
+ and can also be used as an interface for custom extension
+ factories. You can either create a new QExtensionFactory and
+ reimplement the QExtensionFactory::createExtension() function. For
+ example:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 7
+
+ Or you can use an existing factory, expanding the
+ QExtensionFactory::createExtension() function to make the factory
+ able to create a container extension as well. For example:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 8
+
+ For a complete example using the QDesignerContainerExtension
+ class, see the \l {designer/containerextension}{Container
+ Extension example}. The example shows how to create a custom
+ multi-page plugin for \QD.
+
+ \sa QExtensionFactory, QExtensionManager, {Creating Custom Widget
+ Extensions}
+*/
+
+/*!
+ \fn QDesignerContainerExtension::~QDesignerContainerExtension()
+
+ Destroys the extension.
+*/
+
+/*!
+ \fn int QDesignerContainerExtension::count() const
+
+ Returns the number of pages in the container.
+*/
+
+/*!
+ \fn QWidget *QDesignerContainerExtension::widget(int index) const
+
+ Returns the page at the given \a index in the extension's list of
+ pages.
+
+ \sa addWidget(), insertWidget()
+*/
+
+/*!
+ \fn int QDesignerContainerExtension::currentIndex() const
+
+ Returns the index of the currently selected page in the
+ container.
+
+ \sa setCurrentIndex()
+*/
+
+/*!
+ \fn void QDesignerContainerExtension::setCurrentIndex(int index)
+
+ Sets the currently selected page in the container to be the
+ page at the given \a index in the extension's list of pages.
+
+ \sa currentIndex()
+*/
+
+/*!
+ \fn void QDesignerContainerExtension::addWidget(QWidget *page)
+
+ Adds the given \a page to the container by appending it to the
+ extension's list of pages.
+
+ \sa insertWidget(), remove(), widget()
+*/
+
+/*!
+ \fn void QDesignerContainerExtension::insertWidget(int index, QWidget *page)
+
+ Adds the given \a page to the container by inserting it at the
+ given \a index in the extension's list of pages.
+
+ \sa addWidget(), remove(), widget()
+*/
+
+/*!
+ \fn void QDesignerContainerExtension::remove(int index)
+
+ Removes the page at the given \a index from the extension's list
+ of pages.
+
+ \sa addWidget(), insertWidget()
+*/
+
+/*!
+ \fn bool QDesignerContainerExtension::canAddWidget() const
+
+ Returns whether a widget can be added. This determines whether
+ the context menu options to add or insert pages are enabled.
+
+ This should return false for containers that have a single, fixed
+ page, for example QScrollArea or QDockWidget.
+
+ \since 5.0
+ \sa addWidget(), canRemove()
+*/
+
+/*!
+ \fn bool QDesignerContainerExtension::canRemove(int index) const
+
+ Returns whether the widget at the given \a index can be removed.
+ This determines whether the context menu option to remove the current
+ page is enabled.
+
+ This should return false for containers that have a single, fixed
+ page, for example QScrollArea or QDockWidget.
+
+ \since 5.0
+ \sa remove(), canAddWidget()
+*/
diff --git a/src/designer/src/lib/uilib/customwidget.h b/src/designer/src/lib/uilib/customwidget.h
new file mode 100644
index 000000000..43cc05504
--- /dev/null
+++ b/src/designer/src/lib/uilib/customwidget.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CUSTOMWIDGET_H
+#define CUSTOMWIDGET_H
+
+#include "extension.h"
+#include <QtCore/QObject>
+#include <QtCore/QString>
+#include <QtWidgets/QIcon>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QWidget;
+class QDesignerFormEditorInterface;
+
+class QDesignerCustomWidgetInterface
+{
+public:
+ virtual ~QDesignerCustomWidgetInterface() {}
+
+ virtual QString name() const = 0;
+ virtual QString group() const = 0;
+ virtual QString toolTip() const = 0;
+ virtual QString whatsThis() const = 0;
+ virtual QString includeFile() const = 0;
+ virtual QIcon icon() const = 0;
+
+ virtual bool isContainer() const = 0;
+
+ virtual QWidget *createWidget(QWidget *parent) = 0;
+
+ virtual bool isInitialized() const { return false; }
+ virtual void initialize(QDesignerFormEditorInterface *core) { Q_UNUSED(core); }
+
+ virtual QString domXml() const
+ {
+ return QString::fromUtf8("<widget class=\"%1\" name=\"%2\"/>")
+ .arg(name()).arg(name().toLower());
+ }
+
+ virtual QString codeTemplate() const { return QString(); }
+};
+Q_DECLARE_INTERFACE(QDesignerCustomWidgetInterface, "com.trolltech.Qt.Designer.CustomWidget")
+
+
+class QDesignerCustomWidgetCollectionInterface
+{
+public:
+ virtual ~QDesignerCustomWidgetCollectionInterface() {}
+
+ virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const = 0;
+};
+Q_DECLARE_INTERFACE(QDesignerCustomWidgetCollectionInterface,
+ "com.trolltech.Qt.Designer.CustomWidgetCollection")
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // CUSTOMWIDGET_H
diff --git a/src/designer/src/lib/uilib/customwidget.qdoc b/src/designer/src/lib/uilib/customwidget.qdoc
new file mode 100644
index 000000000..9c3bfdd9d
--- /dev/null
+++ b/src/designer/src/lib/uilib/customwidget.qdoc
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QDesignerCustomWidgetInterface
+
+ \brief The QDesignerCustomWidgetInterface class enables Qt Designer
+ to access and construct custom widgets.
+
+ \inmodule QtDesigner
+
+ QDesignerCustomWidgetInterface provides a custom widget with an
+ interface. The class contains a set of functions that must be subclassed
+ to return basic information about the widget, such as its class name and
+ the name of its header file. Other functions must be implemented to
+ initialize the plugin when it is loaded, and to construct instances of
+ the custom widget for \QD to use.
+
+ When implementing a custom widget you must subclass
+ QDesignerCustomWidgetInterface to expose your widget to \QD. For
+ example, this is the declaration for the plugin used in the
+ \l{Custom Widget Plugin Example}{Custom Widget Plugin example} that
+ enables an analog clock custom widget to be used by \QD:
+
+ \snippet examples/designer/customwidgetplugin/customwidgetplugin.h 0
+
+ Note that the only part of the class definition that is specific
+ to this particular custom widget is the class name. In addition,
+ since we are implementing an interface, we must ensure that it's
+ made known to the meta object system using the Q_INTERFACES()
+ macro. This enables \QD to use the qobject_cast() function to
+ query for supported interfaces using nothing but a QObject
+ pointer.
+
+ After \QD loads a custom widget plugin, it calls the interface's
+ initialize() function to enable it to set up any resources that it
+ may need. This function is called with a QDesignerFormEditorInterface
+ parameter that provides the plugin with a gateway to all of \QD's API.
+
+ \QD constructs instances of the custom widget by calling the plugin's
+ createWidget() function with a suitable parent widget. Plugins must
+ construct and return an instance of a custom widget with the specified
+ parent widget.
+
+ In the implementation of the class you must remember to export
+ your custom widget plugin to \QD using the Q_EXPORT_PLUGIN2()
+ macro. For example, if a library called \c libcustomwidgetplugin.so
+ (on Unix) or \c libcustomwidget.dll (on Windows) contains a widget
+ class called \c MyCustomWidget, we can export it by adding the
+ following line to the file containing the plugin implementation:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 14
+
+ This macro ensures that \QD can access and construct the custom widget.
+ Without this macro, there is no way for \QD to use it.
+
+ When implementing a custom widget plugin, you build it as a
+ separate library. If you want to include several custom widget
+ plugins in the same library, you must in addition subclass
+ QDesignerCustomWidgetCollectionInterface.
+
+ \warning If your custom widget plugin contains QVariant
+ properties, be aware that only the following \l
+ {QVariant::Type}{types} are supported:
+
+ \list
+ \o QVariant::ByteArray
+ \o QVariant::Bool
+ \o QVariant::Color
+ \o QVariant::Cursor
+ \o QVariant::Date
+ \o QVariant::DateTime
+ \o QVariant::Double
+ \o QVariant::Int
+ \o QVariant::Point
+ \o QVariant::Rect
+ \o QVariant::Size
+ \o QVariant::SizePolicy
+ \o QVariant::String
+ \o QVariant::Time
+ \o QVariant::UInt
+ \endlist
+
+ For a complete example using the QDesignerCustomWidgetInterface
+ class, see the \l {designer/customwidgetplugin}{Custom Widget
+ Example}. The example shows how to create a custom widget plugin
+ for \QD.
+
+ \sa QDesignerCustomWidgetCollectionInterface {Creating Custom
+ Widgets for Qt Designer}
+*/
+
+/*!
+ \fn QDesignerCustomWidgetInterface::~QDesignerCustomWidgetInterface()
+
+ Destroys the custom widget interface.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::name() const
+
+ Returns the class name of the custom widget supplied by the interface.
+
+ The name returned \e must be identical to the class name used for the
+ custom widget.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::group() const
+
+ Returns the name of the group to which the custom widget belongs.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::toolTip() const
+
+ Returns a short description of the widget that can be used by \QD
+ in a tool tip.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::whatsThis() const
+
+ Returns a description of the widget that can be used by \QD in
+ "What's This?" help for the widget.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::includeFile() const
+
+ Returns the path to the include file that \l uic uses when
+ creating code for the custom widget.
+*/
+
+/*!
+ \fn QIcon QDesignerCustomWidgetInterface::icon() const
+
+ Returns the icon used to represent the custom widget in \QD's
+ widget box.
+*/
+
+/*!
+ \fn bool QDesignerCustomWidgetInterface::isContainer() const
+
+ Returns true if the custom widget is intended to be used as a
+ container; otherwise returns false.
+
+ Most custom widgets are not used to hold other widgets, so their
+ implementations of this function will return false, but custom
+ containers will return true to ensure that they behave correctly
+ in \QD.
+*/
+
+/*!
+ \fn QWidget *QDesignerCustomWidgetInterface::createWidget(QWidget *parent)
+
+ Returns a new instance of the custom widget, with the given \a
+ parent.
+*/
+
+/*!
+ \fn bool QDesignerCustomWidgetInterface::isInitialized() const
+
+ Returns true if the widget has been initialized; otherwise returns
+ false.
+
+ \sa initialize()
+*/
+
+/*!
+ \fn void QDesignerCustomWidgetInterface::initialize(QDesignerFormEditorInterface *formEditor)
+
+ Initializes the widget for use with the specified \a formEditor
+ interface.
+
+ \sa isInitialized()
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::domXml() const
+
+ Returns the XML that is used to describe the custom widget's
+ properties to \QD.
+*/
+
+/*!
+ \fn QString QDesignerCustomWidgetInterface::codeTemplate() const
+
+ This function is reserved for future use by \QD.
+
+ \omit
+ Returns the code template that \QD includes in forms that contain
+ the custom widget when they are saved.
+ \endomit
+*/
+
+/*!
+ \macro QDESIGNER_WIDGET_EXPORT
+ \relates QDesignerCustomWidgetInterface
+ \since 4.1
+
+ This macro is used when defining custom widgets to ensure that they are
+ correctly exported from plugins for use with \QD.
+
+ On some platforms, the symbols required by \QD to create new widgets
+ are removed from plugins by the build system, making them unusable.
+ Using this macro ensures that the symbols are retained on those platforms,
+ and has no side effects on other platforms.
+
+ For example, the \l{designer/worldtimeclockplugin}{World Time Clock Plugin}
+ example exports a custom widget class with the following declaration:
+
+ \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 0
+ \dots
+ \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 2
+
+ \sa {Creating Custom Widgets for Qt Designer}
+*/
+
+
+
+
+
+/*!
+ \class QDesignerCustomWidgetCollectionInterface
+
+ \brief The QDesignerCustomWidgetCollectionInterface class allows
+ you to include several custom widgets in one single library.
+
+ \inmodule QtDesigner
+
+ When implementing a custom widget plugin, you build it as a
+ separate library. If you want to include several custom widget
+ plugins in the same library, you must in addition subclass
+ QDesignerCustomWidgetCollectionInterface.
+
+ QDesignerCustomWidgetCollectionInterface contains one single
+ function returning a list of the collection's
+ QDesignerCustomWidgetInterface objects. For example, if you have
+ several custom widgets \c CustomWidgetOne, \c CustomWidgetTwo and
+ \c CustomWidgetThree, the class definition may look like this:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 12
+
+ In the class constructor you add the interfaces to your custom
+ widgets to the list which you return in the customWidgets()
+ function:
+
+ \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 13
+
+ Note that instead of exporting each custom widget plugin using the
+ Q_EXPORT_PLUGIN2() macro, you export the entire collection. The
+ Q_EXPORT_PLUGIN2() macro ensures that \QD can access and construct
+ the custom widgets. Without this macro, there is no way for \QD to
+ use them.
+
+ \sa QDesignerCustomWidgetInterface, {Creating Custom Widgets for
+ Qt Designer}
+*/
+
+/*!
+ \fn QDesignerCustomWidgetCollectionInterface::~QDesignerCustomWidgetCollectionInterface() {
+
+ Destroys the custom widget collection interface.
+*/
+
+/*!
+ \fn QList<QDesignerCustomWidgetInterface*> QDesignerCustomWidgetCollectionInterface::customWidgets() const
+
+ Returns a list of interfaces to the collection's custom widgets.
+*/
diff --git a/src/designer/src/lib/uilib/extension.h b/src/designer/src/lib/uilib/extension.h
new file mode 100644
index 000000000..9d6754e9e
--- /dev/null
+++ b/src/designer/src/lib/uilib/extension.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef EXTENSION_H
+#define EXTENSION_H
+
+#include <QtCore/QString>
+#include <QtCore/QObject>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+#define Q_TYPEID(IFace) QLatin1String(IFace##_iid)
+
+class QAbstractExtensionFactory
+{
+public:
+ virtual ~QAbstractExtensionFactory() {}
+
+ virtual QObject *extension(QObject *object, const QString &iid) const = 0;
+};
+Q_DECLARE_INTERFACE(QAbstractExtensionFactory, "com.trolltech.Qt.QAbstractExtensionFactory")
+
+class QAbstractExtensionManager
+{
+public:
+ virtual ~QAbstractExtensionManager() {}
+
+ virtual void registerExtensions(QAbstractExtensionFactory *factory, const QString &iid) = 0;
+ virtual void unregisterExtensions(QAbstractExtensionFactory *factory, const QString &iid) = 0;
+
+ virtual QObject *extension(QObject *object, const QString &iid) const = 0;
+};
+Q_DECLARE_INTERFACE(QAbstractExtensionManager, "com.trolltech.Qt.QAbstractExtensionManager")
+
+#if defined(Q_CC_MSVC) && (_MSC_VER < 1300)
+
+template <class T>
+inline T qt_extension_helper(QAbstractExtensionManager *, QObject *, T)
+{ return 0; }
+
+template <class T>
+inline T qt_extension(QAbstractExtensionManager* manager, QObject *object)
+{ return qt_extension_helper(manager, object, T(0)); }
+
+#define Q_DECLARE_EXTENSION_INTERFACE(IFace, IId) \
+const char * const IFace##_iid = IId; \
+Q_DECLARE_INTERFACE(IFace, IId) \
+template <> inline IFace *qt_extension_helper<IFace *>(QAbstractExtensionManager *manager, QObject *object, IFace *) \
+{ QObject *extension = manager->extension(object, Q_TYPEID(IFace)); return (IFace *)(extension ? extension->qt_metacast(IFace##_iid) : 0); }
+
+#else
+
+template <class T>
+inline T qt_extension(QAbstractExtensionManager* manager, QObject *object)
+{ return 0; }
+
+#define Q_DECLARE_EXTENSION_INTERFACE(IFace, IId) \
+const char * const IFace##_iid = IId; \
+Q_DECLARE_INTERFACE(IFace, IId) \
+template <> inline IFace *qt_extension<IFace *>(QAbstractExtensionManager *manager, QObject *object) \
+{ QObject *extension = manager->extension(object, Q_TYPEID(IFace)); return extension ? static_cast<IFace *>(extension->qt_metacast(IFace##_iid)) : static_cast<IFace *>(0); }
+
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // EXTENSION_H
diff --git a/src/designer/src/lib/uilib/formbuilder.cpp b/src/designer/src/lib/uilib/formbuilder.cpp
new file mode 100644
index 000000000..5e22ddb99
--- /dev/null
+++ b/src/designer/src/lib/uilib/formbuilder.cpp
@@ -0,0 +1,550 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "customwidget.h"
+#include "formbuilder.h"
+#include "formbuilderextra_p.h"
+#include "ui4_p.h"
+
+#include <QtGui/QtGui>
+#include <QtWidgets/QtWidgets>
+#include <QtCore/QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal {
+#endif
+
+/*!
+ \class QFormBuilder
+
+ \brief The QFormBuilder class is used to dynamically construct
+ user interfaces from UI files at run-time.
+
+ \inmodule QtDesigner
+
+ The QFormBuilder class provides a mechanism for dynamically
+ creating user interfaces at run-time, based on UI files
+ created with \QD. For example:
+
+ \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 0
+
+ By including the user interface in the example's resources (\c
+ myForm.qrc), we ensure that it will be present when the example is
+ run:
+
+ \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 1
+
+ QFormBuilder extends the QAbstractFormBuilder base class with a
+ number of functions that are used to support custom widget
+ plugins:
+
+ \list
+ \o pluginPaths() returns the list of paths that the form builder
+ searches when loading custom widget plugins.
+ \o addPluginPath() allows additional paths to be registered with
+ the form builder.
+ \o setPluginPath() is used to replace the existing list of paths
+ with a list obtained from some other source.
+ \o clearPluginPaths() removes all paths registered with the form
+ builder.
+ \o customWidgets() returns a list of interfaces to plugins that
+ can be used to create new instances of registered custom widgets.
+ \endlist
+
+ The QFormBuilder class is typically used by custom components and
+ applications that embed \QD. Standalone applications that need to
+ dynamically generate user interfaces at run-time use the
+ QUiLoader class, found in the QtUiTools module.
+
+ \sa QAbstractFormBuilder, {QtUiTools Module}
+*/
+
+/*!
+ \fn QFormBuilder::QFormBuilder()
+
+ Constructs a new form builder.
+*/
+
+QFormBuilder::QFormBuilder()
+{
+}
+
+/*!
+ Destroys the form builder.
+*/
+QFormBuilder::~QFormBuilder()
+{
+}
+
+/*!
+ \internal
+*/
+QWidget *QFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget)
+{
+ if (!d->parentWidgetIsSet())
+ d->setParentWidget(parentWidget);
+ // Is this a QLayoutWidget with a margin of 0: Not a known page-based
+ // container and no method for adding pages registered.
+ d->setProcessingLayoutWidget(false);
+ if (ui_widget->attributeClass() == QFormBuilderStrings::instance().qWidgetClass && !ui_widget->hasAttributeNative()
+ && parentWidget
+#ifndef QT_NO_MAINWINDOW
+ && !qobject_cast<QMainWindow *>(parentWidget)
+#endif
+#ifndef QT_NO_TOOLBOX
+ && !qobject_cast<QToolBox *>(parentWidget)
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+ && !qobject_cast<QStackedWidget *>(parentWidget)
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+ && !qobject_cast<QTabWidget *>(parentWidget)
+#endif
+#ifndef QT_NO_SCROLLAREA
+ && !qobject_cast<QScrollArea *>(parentWidget)
+#endif
+#ifndef QT_NO_MDIAREA
+ && !qobject_cast<QMdiArea *>(parentWidget)
+#endif
+#ifndef QT_NO_DOCKWIDGET
+ && !qobject_cast<QDockWidget *>(parentWidget)
+#endif
+ ) {
+ const QString parentClassName = QLatin1String(parentWidget->metaObject()->className());
+ if (!d->isCustomWidgetContainer(parentClassName))
+ d->setProcessingLayoutWidget(true);
+ }
+ return QAbstractFormBuilder::create(ui_widget, parentWidget);
+}
+
+
+/*!
+ \internal
+*/
+QWidget *QFormBuilder::createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name)
+{
+ if (widgetName.isEmpty()) {
+ //: Empty class name passed to widget factory method
+ qWarning() << QCoreApplication::translate("QFormBuilder", "An empty class name was passed on to %1 (object name: '%2').").arg(QString::fromUtf8(Q_FUNC_INFO), name);
+ return 0;
+ }
+
+ QWidget *w = 0;
+
+#ifndef QT_NO_TABWIDGET
+ if (qobject_cast<QTabWidget*>(parentWidget))
+ parentWidget = 0;
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+ if (qobject_cast<QStackedWidget*>(parentWidget))
+ parentWidget = 0;
+#endif
+#ifndef QT_NO_TOOLBOX
+ if (qobject_cast<QToolBox*>(parentWidget))
+ parentWidget = 0;
+#endif
+
+ // ### special-casing for Line (QFrame) -- fix for 4.2
+ do {
+ if (widgetName == QFormBuilderStrings::instance().lineClass) {
+ w = new QFrame(parentWidget);
+ static_cast<QFrame*>(w)->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ break;
+ }
+ const QByteArray widgetNameBA = widgetName.toUtf8();
+ const char *widgetNameC = widgetNameBA.constData();
+ if (w) { // symmetry for macro
+ }
+
+#define DECLARE_LAYOUT(L, C)
+#define DECLARE_COMPAT_WIDGET(W, C)
+#define DECLARE_WIDGET(W, C) else if (!qstrcmp(widgetNameC, #W)) { Q_ASSERT(w == 0); w = new W(parentWidget); }
+#define DECLARE_WIDGET_1(W, C) else if (!qstrcmp(widgetNameC, #W)) { Q_ASSERT(w == 0); w = new W(0, parentWidget); }
+
+#include "widgets.table"
+
+#undef DECLARE_COMPAT_WIDGET
+#undef DECLARE_LAYOUT
+#undef DECLARE_WIDGET
+#undef DECLARE_WIDGET_1
+
+ if (w)
+ break;
+
+ // try with a registered custom widget
+ QDesignerCustomWidgetInterface *factory = d->m_customWidgets.value(widgetName);
+ if (factory != 0)
+ w = factory->createWidget(parentWidget);
+ } while(false);
+
+ if (w == 0) { // Attempt to instantiate base class of promoted/custom widgets
+ const QString baseClassName = d->customWidgetBaseClass(widgetName);
+ if (!baseClassName.isEmpty()) {
+ qWarning() << QCoreApplication::translate("QFormBuilder", "QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'.").arg(widgetName, baseClassName);
+ return createWidget(baseClassName, parentWidget, name);
+ }
+ }
+
+ if (w == 0) { // nothing to do
+ qWarning() << QCoreApplication::translate("QFormBuilder", "QFormBuilder was unable to create a widget of the class '%1'.").arg(widgetName);
+ return 0;
+ }
+
+ w->setObjectName(name);
+
+ if (qobject_cast<QDialog *>(w))
+ w->setParent(parentWidget);
+
+ return w;
+}
+
+/*!
+ \internal
+*/
+QLayout *QFormBuilder::createLayout(const QString &layoutName, QObject *parent, const QString &name)
+{
+ QLayout *l = 0;
+
+ QWidget *parentWidget = qobject_cast<QWidget*>(parent);
+ QLayout *parentLayout = qobject_cast<QLayout*>(parent);
+
+ Q_ASSERT(parentWidget || parentLayout);
+
+#define DECLARE_WIDGET(W, C)
+#define DECLARE_COMPAT_WIDGET(W, C)
+
+#define DECLARE_LAYOUT(L, C) \
+ if (layoutName == QLatin1String(#L)) { \
+ Q_ASSERT(l == 0); \
+ l = parentLayout \
+ ? new L() \
+ : new L(parentWidget); \
+ }
+
+#include "widgets.table"
+
+#undef DECLARE_LAYOUT
+#undef DECLARE_COMPAT_WIDGET
+#undef DECLARE_WIDGET
+
+ if (l) {
+ l->setObjectName(name);
+ } else {
+ qWarning() << QCoreApplication::translate("QFormBuilder", "The layout type `%1' is not supported.").arg(layoutName);
+ }
+
+ return l;
+}
+
+/*!
+ \internal
+*/
+bool QFormBuilder::addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout)
+{
+ return QAbstractFormBuilder::addItem(ui_item, item, layout);
+}
+
+/*!
+ \internal
+*/
+bool QFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
+{
+ return QAbstractFormBuilder::addItem(ui_widget, widget, parentWidget);
+}
+
+/*!
+ \internal
+*/
+QWidget *QFormBuilder::widgetByName(QWidget *topLevel, const QString &name)
+{
+ Q_ASSERT(topLevel);
+ if (topLevel->objectName() == name)
+ return topLevel;
+
+ return topLevel->findChild<QWidget*>(name);
+}
+
+static QObject *objectByName(QWidget *topLevel, const QString &name)
+{
+ Q_ASSERT(topLevel);
+ if (topLevel->objectName() == name)
+ return topLevel;
+
+ return topLevel->findChild<QObject*>(name);
+}
+
+/*!
+ \internal
+*/
+void QFormBuilder::createConnections(DomConnections *ui_connections, QWidget *widget)
+{
+ typedef QList<DomConnection*> DomConnectionList;
+ Q_ASSERT(widget != 0);
+
+ if (ui_connections == 0)
+ return;
+
+ const DomConnectionList connections = ui_connections->elementConnection();
+ if (!connections.empty()) {
+ const DomConnectionList::const_iterator cend = connections.constEnd();
+ for (DomConnectionList::const_iterator it = connections.constBegin(); it != cend; ++it) {
+
+ QObject *sender = objectByName(widget, (*it)->elementSender());
+ QObject *receiver = objectByName(widget, (*it)->elementReceiver());
+ if (!sender || !receiver)
+ continue;
+
+ QByteArray sig = (*it)->elementSignal().toUtf8();
+ sig.prepend("2");
+ QByteArray sl = (*it)->elementSlot().toUtf8();
+ sl.prepend("1");
+ QObject::connect(sender, sig, receiver, sl);
+ }
+ }
+}
+
+/*!
+ \internal
+*/
+QWidget *QFormBuilder::create(DomUI *ui, QWidget *parentWidget)
+{
+ return QAbstractFormBuilder::create(ui, parentWidget);
+}
+
+/*!
+ \internal
+*/
+QLayout *QFormBuilder::create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget)
+{
+ // Is this a temporary layout widget used to represent QLayout hierarchies in Designer?
+ // Set its margins to 0.
+ bool layoutWidget = d->processingLayoutWidget();
+ QLayout *l = QAbstractFormBuilder::create(ui_layout, layout, parentWidget);
+ if (layoutWidget) {
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ int left, top, right, bottom;
+ left = top = right = bottom = 0;
+ const DomPropertyHash properties = propertyMap(ui_layout->elementProperty());
+
+ if (DomProperty *prop = properties.value(strings.leftMarginProperty))
+ left = prop->elementNumber();
+
+ if (DomProperty *prop = properties.value(strings.topMarginProperty))
+ top = prop->elementNumber();
+
+ if (DomProperty *prop = properties.value(strings.rightMarginProperty))
+ right = prop->elementNumber();
+
+ if (DomProperty *prop = properties.value(strings.bottomMarginProperty))
+ bottom = prop->elementNumber();
+
+ l->setContentsMargins(left, top, right, bottom);
+ d->setProcessingLayoutWidget(false);
+ }
+ return l;
+}
+
+/*!
+ \internal
+*/
+QLayoutItem *QFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget)
+{
+ return QAbstractFormBuilder::create(ui_layoutItem, layout, parentWidget);
+}
+
+/*!
+ \internal
+*/
+QAction *QFormBuilder::create(DomAction *ui_action, QObject *parent)
+{
+ return QAbstractFormBuilder::create(ui_action, parent);
+}
+
+/*!
+ \internal
+*/
+QActionGroup *QFormBuilder::create(DomActionGroup *ui_action_group, QObject *parent)
+{
+ return QAbstractFormBuilder::create(ui_action_group, parent);
+}
+
+/*!
+ Returns the list of paths the form builder searches for plugins.
+
+ \sa addPluginPath()
+*/
+QStringList QFormBuilder::pluginPaths() const
+{
+ return d->m_pluginPaths;
+}
+
+/*!
+ Clears the list of paths that the form builder uses to search for
+ custom widget plugins.
+
+ \sa pluginPaths()
+*/
+void QFormBuilder::clearPluginPaths()
+{
+ d->m_pluginPaths.clear();
+ updateCustomWidgets();
+}
+
+/*!
+ Adds a new plugin path specified by \a pluginPath to the list of
+ paths that will be searched by the form builder when loading a
+ custom widget plugin.
+
+ \sa setPluginPath(), clearPluginPaths()
+*/
+void QFormBuilder::addPluginPath(const QString &pluginPath)
+{
+ d->m_pluginPaths.append(pluginPath);
+ updateCustomWidgets();
+}
+
+/*!
+ Sets the list of plugin paths to the list specified by \a pluginPaths.
+
+ \sa addPluginPath()
+*/
+void QFormBuilder::setPluginPath(const QStringList &pluginPaths)
+{
+ d->m_pluginPaths = pluginPaths;
+ updateCustomWidgets();
+}
+
+static void insertPlugins(QObject *o, QMap<QString, QDesignerCustomWidgetInterface*> *customWidgets)
+{
+ // step 1) try with a normal plugin
+ if (QDesignerCustomWidgetInterface *iface = qobject_cast<QDesignerCustomWidgetInterface *>(o)) {
+ customWidgets->insert(iface->name(), iface);
+ return;
+ }
+ // step 2) try with a collection of plugins
+ if (QDesignerCustomWidgetCollectionInterface *c = qobject_cast<QDesignerCustomWidgetCollectionInterface *>(o)) {
+ foreach (QDesignerCustomWidgetInterface *iface, c->customWidgets())
+ customWidgets->insert(iface->name(), iface);
+ }
+}
+
+/*!
+ \internal
+*/
+void QFormBuilder::updateCustomWidgets()
+{
+ d->m_customWidgets.clear();
+
+ foreach (const QString &path, d->m_pluginPaths) {
+ const QDir dir(path);
+ const QStringList candidates = dir.entryList(QDir::Files);
+
+ foreach (const QString &plugin, candidates) {
+ if (!QLibrary::isLibrary(plugin))
+ continue;
+
+ QString loaderPath = path;
+ loaderPath += QLatin1Char('/');
+ loaderPath += plugin;
+
+ QPluginLoader loader(loaderPath);
+ if (loader.load())
+ insertPlugins(loader.instance(), &d->m_customWidgets);
+ }
+ }
+ // Check statically linked plugins
+ const QObjectList staticPlugins = QPluginLoader::staticInstances();
+ if (!staticPlugins.empty())
+ foreach (QObject *o, staticPlugins)
+ insertPlugins(o, &d->m_customWidgets);
+}
+
+/*!
+ \fn QList<QDesignerCustomWidgetInterface*> QFormBuilder::customWidgets() const
+
+ Returns a list of the available plugins.
+*/
+QList<QDesignerCustomWidgetInterface*> QFormBuilder::customWidgets() const
+{
+ return d->m_customWidgets.values();
+}
+
+/*!
+ \internal
+*/
+
+void QFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> &properties)
+{
+ typedef QList<DomProperty*> DomPropertyList;
+
+ if (properties.empty())
+ return;
+
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+
+ const DomPropertyList::const_iterator cend = properties.constEnd();
+ for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) {
+ const QVariant v = toVariant(o->metaObject(), *it);
+ if (v.isNull())
+ continue;
+
+ const QString attributeName = (*it)->attributeName();
+ const bool isWidget = o->isWidgetType();
+ if (isWidget && o->parent() == d->parentWidget() && attributeName == strings.geometryProperty) {
+ // apply only the size part of a geometry for the root widget
+ static_cast<QWidget*>(o)->resize(qvariant_cast<QRect>(v).size());
+ } else if (d->applyPropertyInternally(o, attributeName, v)) {
+ } else if (isWidget && !qstrcmp("QFrame", o->metaObject()->className ()) && attributeName == strings.orientationProperty) {
+ // ### special-casing for Line (QFrame) -- try to fix me
+ o->setProperty("frameShape", v); // v is of QFrame::Shape enum
+ } else {
+ o->setProperty(attributeName.toUtf8(), v);
+ }
+ }
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+} // namespace QFormInternal
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/formbuilder.h b/src/designer/src/lib/uilib/formbuilder.h
new file mode 100644
index 000000000..b94db06eb
--- /dev/null
+++ b/src/designer/src/lib/uilib/formbuilder.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FORMBUILDER_H
+#define FORMBUILDER_H
+
+#include "uilib_global.h"
+#include "abstractformbuilder.h"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+#if 0
+// pragma for syncqt, don't remove.
+
+#pragma qt_class(QFormBuilder)
+#endif
+
+class QDesignerCustomWidgetInterface;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class QDESIGNER_UILIB_EXPORT QFormBuilder: public QAbstractFormBuilder
+{
+public:
+ QFormBuilder();
+ virtual ~QFormBuilder();
+
+ QStringList pluginPaths() const;
+
+ void clearPluginPaths();
+ void addPluginPath(const QString &pluginPath);
+ void setPluginPath(const QStringList &pluginPaths);
+
+ QList<QDesignerCustomWidgetInterface*> customWidgets() const;
+
+protected:
+ virtual QWidget *create(DomUI *ui, QWidget *parentWidget);
+ virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget);
+ virtual QLayout *create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget);
+ virtual QLayoutItem *create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget);
+ virtual QAction *create(DomAction *ui_action, QObject *parent);
+ virtual QActionGroup *create(DomActionGroup *ui_action_group, QObject *parent);
+
+ virtual QWidget *createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name);
+ virtual QLayout *createLayout(const QString &layoutName, QObject *parent, const QString &name);
+
+ virtual void createConnections(DomConnections *connections, QWidget *widget);
+
+ virtual bool addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout);
+ virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
+
+ virtual void updateCustomWidgets();
+ virtual void applyProperties(QObject *o, const QList<DomProperty*> &properties);
+
+ static QWidget *widgetByName(QWidget *topLevel, const QString &name);
+
+private:
+};
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // FORMBUILDER_H
diff --git a/src/designer/src/lib/uilib/formbuilderextra.cpp b/src/designer/src/lib/uilib/formbuilderextra.cpp
new file mode 100644
index 000000000..3d34a20bf
--- /dev/null
+++ b/src/designer/src/lib/uilib/formbuilderextra.cpp
@@ -0,0 +1,533 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "formbuilderextra_p.h"
+#include "abstractformbuilder.h"
+#include "resourcebuilder_p.h"
+#include "textbuilder_p.h"
+#include "ui4_p.h"
+
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QBoxLayout>
+#include <QtWidgets/QGridLayout>
+
+#include <QtCore/QVariant>
+#include <QtCore/qdebug.h>
+#include <QtCore/QTextStream>
+#include <QtCore/QStringList>
+#include <QtCore/QCoreApplication>
+
+#include <limits.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal {
+#endif
+
+void uiLibWarning(const QString &message) {
+ qWarning("Designer: %s", qPrintable(message));
+}
+
+
+QFormBuilderExtra::CustomWidgetData::CustomWidgetData() :
+ isContainer(false)
+{
+}
+
+QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw) :
+ addPageMethod(dcw->elementAddPageMethod()),
+ baseClass(dcw->elementExtends()),
+ isContainer(dcw->hasElementContainer() && dcw->elementContainer() != 0)
+{
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ if (const DomScript *domScript = dcw->elementScript())
+ script = domScript->text();
+#endif
+}
+
+QFormBuilderExtra::QFormBuilderExtra() :
+ m_defaultMargin(INT_MIN),
+ m_defaultSpacing(INT_MIN),
+ m_language(QLatin1String("c++")),
+ m_layoutWidget(false),
+ m_resourceBuilder(0),
+ m_textBuilder(0)
+{
+}
+
+QFormBuilderExtra::~QFormBuilderExtra()
+{
+ clearResourceBuilder();
+ clearTextBuilder();
+}
+
+void QFormBuilderExtra::clear()
+{
+ m_buddies.clear();
+ m_parentWidget = 0;
+ m_parentWidgetIsSet = false;
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ m_FormScriptRunner.clearErrors();
+#endif
+ m_customWidgetDataHash.clear();
+ m_buttonGroups.clear();
+}
+
+
+bool QFormBuilderExtra::applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value)
+{
+ // Store buddies and apply them later on as the widgets might not exist yet.
+ QLabel *label = qobject_cast<QLabel*>(o);
+ if (!label || propertyName != QFormBuilderStrings::instance().buddyProperty)
+ return false;
+
+ m_buddies.insert(label, value.toString());
+ return true;
+}
+
+void QFormBuilderExtra::applyInternalProperties() const
+{
+ if (m_buddies.empty())
+ return;
+
+ const BuddyHash::const_iterator cend = m_buddies.constEnd();
+ for (BuddyHash::const_iterator it = m_buddies.constBegin(); it != cend; ++it )
+ applyBuddy(it.value(), BuddyApplyAll, it.key());
+}
+
+bool QFormBuilderExtra::applyBuddy(const QString &buddyName, BuddyMode applyMode, QLabel *label)
+{
+ if (buddyName.isEmpty()) {
+ label->setBuddy(0);
+ return false;
+ }
+
+ const QWidgetList widgets = label->topLevelWidget()->findChildren<QWidget*>(buddyName);
+ if (widgets.empty()) {
+ label->setBuddy(0);
+ return false;
+ }
+
+ const QWidgetList::const_iterator cend = widgets.constEnd();
+ for ( QWidgetList::const_iterator it = widgets.constBegin(); it != cend; ++it) {
+ if (applyMode == BuddyApplyAll || !(*it)->isHidden()) {
+ label->setBuddy(*it);
+ return true;
+ }
+ }
+
+ label->setBuddy(0);
+ return false;
+}
+
+const QPointer<QWidget> &QFormBuilderExtra::parentWidget() const
+{
+ return m_parentWidget;
+}
+
+bool QFormBuilderExtra::parentWidgetIsSet() const
+{
+ return m_parentWidgetIsSet;
+}
+
+void QFormBuilderExtra::setParentWidget(const QPointer<QWidget> &w)
+{
+ // Parent widget requires special handling of the geometry property.
+ m_parentWidget = w;
+ m_parentWidgetIsSet = true;
+}
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+QFormScriptRunner &QFormBuilderExtra::formScriptRunner()
+{
+ return m_FormScriptRunner;
+}
+
+QString QFormBuilderExtra::customWidgetScript(const QString &className) const
+{
+ const QHash<QString, CustomWidgetData>::const_iterator it = m_customWidgetDataHash.constFind(className);
+ if (it != m_customWidgetDataHash.constEnd())
+ return it.value().script;
+ return QString();
+}
+
+#endif
+
+void QFormBuilderExtra::storeCustomWidgetData(const QString &className, const DomCustomWidget *d)
+{
+ if (d)
+ m_customWidgetDataHash.insert(className, CustomWidgetData(d));
+}
+
+QString QFormBuilderExtra::customWidgetBaseClass(const QString &className) const
+{
+ const QHash<QString, CustomWidgetData>::const_iterator it = m_customWidgetDataHash.constFind(className);
+ if (it != m_customWidgetDataHash.constEnd())
+ return it.value().baseClass;
+ return QString();
+}
+
+QString QFormBuilderExtra::customWidgetAddPageMethod(const QString &className) const
+{
+ const QHash<QString, CustomWidgetData>::const_iterator it = m_customWidgetDataHash.constFind(className);
+ if (it != m_customWidgetDataHash.constEnd())
+ return it.value().addPageMethod;
+ return QString();
+}
+
+bool QFormBuilderExtra::isCustomWidgetContainer(const QString &className) const
+{
+ const QHash<QString, CustomWidgetData>::const_iterator it = m_customWidgetDataHash.constFind(className);
+ if (it != m_customWidgetDataHash.constEnd())
+ return it.value().isContainer;
+ return false;
+}
+
+void QFormBuilderExtra::setProcessingLayoutWidget(bool processing)
+{
+ m_layoutWidget = processing;
+}
+
+ bool QFormBuilderExtra::processingLayoutWidget() const
+{
+ return m_layoutWidget;
+}
+void QFormBuilderExtra::setResourceBuilder(QResourceBuilder *builder)
+{
+ if (m_resourceBuilder == builder)
+ return;
+ clearResourceBuilder();
+ m_resourceBuilder = builder;
+}
+
+QResourceBuilder *QFormBuilderExtra::resourceBuilder() const
+{
+ return m_resourceBuilder;
+}
+
+void QFormBuilderExtra::clearResourceBuilder()
+{
+ if (m_resourceBuilder) {
+ delete m_resourceBuilder;
+ m_resourceBuilder = 0;
+ }
+}
+
+void QFormBuilderExtra::setTextBuilder(QTextBuilder *builder)
+{
+ if (m_textBuilder == builder)
+ return;
+ clearTextBuilder();
+ m_textBuilder = builder;
+}
+
+QTextBuilder *QFormBuilderExtra::textBuilder() const
+{
+ return m_textBuilder;
+}
+
+void QFormBuilderExtra::clearTextBuilder()
+{
+ if (m_textBuilder) {
+ delete m_textBuilder;
+ m_textBuilder = 0;
+ }
+}
+
+void QFormBuilderExtra::registerButtonGroups(const DomButtonGroups *domGroups)
+{
+ typedef QList<DomButtonGroup*> DomButtonGroupList;
+ const DomButtonGroupList domGroupList = domGroups->elementButtonGroup();
+ const DomButtonGroupList::const_iterator cend = domGroupList.constEnd();
+ for (DomButtonGroupList::const_iterator it = domGroupList.constBegin(); it != cend; ++it) {
+ DomButtonGroup *domGroup = *it;
+ m_buttonGroups.insert(domGroup->attributeName(), ButtonGroupEntry(domGroup, 0));
+ }
+}
+
+// Utilities for parsing per-cell integer properties that have setters and
+// getters of the form 'setX(int idx, int value)' and 'x(int index)'
+// (converting them to comma-separated string lists and back).
+// Used for layout stretch and grid per-row/column properties.
+
+// Format a list of cell-properties of one dimension as a ','-separated list
+template <class Layout>
+inline QString perCellPropertyToString(const Layout *l, int count, int (Layout::*getter)(int) const)
+{
+ if (count == 0)
+ return QString();
+ QString rc;
+ {
+ QTextStream str(&rc);
+ for (int i = 0; i < count; i++) {
+ if (i)
+ str << QLatin1Char(',');
+ str << (l->*getter)(i);
+ }
+ }
+ return rc;
+}
+
+// Clear the property, set all cells to 0
+
+template <class Layout>
+inline void clearPerCellValue(Layout *l, int count, void (Layout::*setter)(int,int), int value = 0)
+{
+ for (int i = 0; i < count; i++)
+ (l->*setter)(i, value);
+}
+
+// Parse and set the property from a comma-separated list
+
+template <class Layout>
+inline bool parsePerCellProperty(Layout *l, int count, void (Layout::*setter)(int,int), const QString &s, int defaultValue = 0)
+{
+ if (s.isEmpty()) {
+ clearPerCellValue(l, count, setter, defaultValue);
+ return true;
+ }
+ const QStringList list = s.split(QLatin1Char(','));
+ if (list.empty()) {
+ clearPerCellValue(l, count, setter, defaultValue);
+ return true;
+ }
+ // Apply all values contained in list
+ const int ac = qMin(count, list.size());
+ bool ok;
+ int i = 0;
+ for ( ; i < ac; i++) {
+ const int value = list.at(i).toInt(&ok);
+ if (!ok || value < 0)
+ return false;
+ (l->*setter)(i, value);
+ }
+ // Clear rest
+ for ( ; i < count; i++)
+ (l->*setter)(i, defaultValue);
+ return true;
+}
+
+// Read and write stretch
+static QString msgInvalidStretch(const QString &objectName, const QString &stretch)
+{
+ //: Parsing layout stretch values
+ return QCoreApplication::translate("FormBuilder", "Invalid stretch value for '%1': '%2'").arg(objectName, stretch);
+}
+
+QString QFormBuilderExtra::boxLayoutStretch(const QBoxLayout *box)
+{
+ return perCellPropertyToString(box, box->count(), &QBoxLayout::stretch);
+}
+
+bool QFormBuilderExtra::setBoxLayoutStretch(const QString &s, QBoxLayout *box)
+{
+ const bool rc = parsePerCellProperty(box, box->count(), &QBoxLayout::setStretch, s);
+ if (!rc)
+ uiLibWarning(msgInvalidStretch(box->objectName(), s));
+ return rc;
+}
+
+void QFormBuilderExtra::clearBoxLayoutStretch(QBoxLayout *box)
+{
+ clearPerCellValue(box, box->count(), &QBoxLayout::setStretch);
+}
+
+QString QFormBuilderExtra::gridLayoutRowStretch(const QGridLayout *grid)
+{
+ return perCellPropertyToString(grid, grid->rowCount(), &QGridLayout::rowStretch);
+}
+
+bool QFormBuilderExtra::setGridLayoutRowStretch(const QString &s, QGridLayout *grid)
+{
+ const bool rc = parsePerCellProperty(grid, grid->rowCount(), &QGridLayout::setRowStretch, s);
+ if (!rc)
+ uiLibWarning(msgInvalidStretch(grid->objectName(), s));
+ return rc;
+}
+
+void QFormBuilderExtra::clearGridLayoutRowStretch(QGridLayout *grid)
+{
+ clearPerCellValue(grid, grid->rowCount(), &QGridLayout::setRowStretch);
+}
+
+QString QFormBuilderExtra::gridLayoutColumnStretch(const QGridLayout *grid)
+{
+ return perCellPropertyToString(grid, grid->columnCount(), &QGridLayout::columnStretch);
+}
+
+bool QFormBuilderExtra::setGridLayoutColumnStretch(const QString &s, QGridLayout *grid)
+{
+ const bool rc = parsePerCellProperty(grid, grid->columnCount(), &QGridLayout::setColumnStretch, s);
+ if (!rc)
+ uiLibWarning(msgInvalidStretch(grid->objectName(), s));
+ return rc;
+}
+
+void QFormBuilderExtra::clearGridLayoutColumnStretch(QGridLayout *grid)
+{
+ clearPerCellValue(grid, grid->columnCount(), &QGridLayout::setColumnStretch);
+}
+
+// Read and write grid layout row/column size limits
+
+static QString msgInvalidMinimumSize(const QString &objectName, const QString &ms)
+{
+ //: Parsing grid layout minimum size values
+ return QCoreApplication::translate("FormBuilder", "Invalid minimum size for '%1': '%2'").arg(objectName, ms);
+}
+
+QString QFormBuilderExtra::gridLayoutRowMinimumHeight(const QGridLayout *grid)
+{
+ return perCellPropertyToString(grid, grid->rowCount(), &QGridLayout::rowMinimumHeight);
+}
+
+bool QFormBuilderExtra::setGridLayoutRowMinimumHeight(const QString &s, QGridLayout *grid)
+{
+ const bool rc = parsePerCellProperty(grid, grid->rowCount(), &QGridLayout::setRowMinimumHeight, s);
+ if (!rc)
+ uiLibWarning(msgInvalidMinimumSize(grid->objectName(), s));
+ return rc;
+}
+
+void QFormBuilderExtra::clearGridLayoutRowMinimumHeight(QGridLayout *grid)
+{
+ clearPerCellValue(grid, grid->rowCount(), &QGridLayout::setRowMinimumHeight);
+}
+
+QString QFormBuilderExtra::gridLayoutColumnMinimumWidth(const QGridLayout *grid)
+{
+ return perCellPropertyToString(grid, grid->columnCount(), &QGridLayout::columnMinimumWidth);
+}
+
+bool QFormBuilderExtra::setGridLayoutColumnMinimumWidth(const QString &s, QGridLayout *grid)
+{
+ const bool rc = parsePerCellProperty(grid, grid->columnCount(), &QGridLayout::setColumnMinimumWidth, s);
+ if (!rc)
+ uiLibWarning(msgInvalidMinimumSize(grid->objectName(), s));
+ return rc;
+}
+
+void QFormBuilderExtra::clearGridLayoutColumnMinimumWidth(QGridLayout *grid)
+{
+ clearPerCellValue(grid, grid->columnCount(), &QGridLayout::setColumnMinimumWidth);
+}
+
+// ------------ QFormBuilderStrings
+
+QFormBuilderStrings::QFormBuilderStrings() :
+ buddyProperty(QLatin1String("buddy")),
+ cursorProperty(QLatin1String("cursor")),
+ objectNameProperty(QLatin1String("objectName")),
+ trueValue(QLatin1String("true")),
+ falseValue(QLatin1String("false")),
+ horizontalPostFix(QLatin1String("Horizontal")),
+ separator(QLatin1String("separator")),
+ defaultTitle(QLatin1String("Page")),
+ titleAttribute(QLatin1String("title")),
+ labelAttribute(QLatin1String("label")),
+ toolTipAttribute(QLatin1String("toolTip")),
+ whatsThisAttribute(QLatin1String("whatsThis")),
+ flagsAttribute(QLatin1String("flags")),
+ iconAttribute(QLatin1String("icon")),
+ pixmapAttribute(QLatin1String("pixmap")),
+ textAttribute(QLatin1String("text")),
+ currentIndexProperty(QLatin1String("currentIndex")),
+ toolBarAreaAttribute(QLatin1String("toolBarArea")),
+ toolBarBreakAttribute(QLatin1String("toolBarBreak")),
+ dockWidgetAreaAttribute(QLatin1String("dockWidgetArea")),
+ marginProperty(QLatin1String("margin")),
+ spacingProperty(QLatin1String("spacing")),
+ leftMarginProperty(QLatin1String("leftMargin")),
+ topMarginProperty(QLatin1String("topMargin")),
+ rightMarginProperty(QLatin1String("rightMargin")),
+ bottomMarginProperty(QLatin1String("bottomMargin")),
+ horizontalSpacingProperty(QLatin1String("horizontalSpacing")),
+ verticalSpacingProperty(QLatin1String("verticalSpacing")),
+ sizeHintProperty(QLatin1String("sizeHint")),
+ sizeTypeProperty(QLatin1String("sizeType")),
+ orientationProperty(QLatin1String("orientation")),
+ styleSheetProperty(QLatin1String("styleSheet")),
+ qtHorizontal(QLatin1String("Qt::Horizontal")),
+ qtVertical(QLatin1String("Qt::Vertical")),
+ currentRowProperty(QLatin1String("currentRow")),
+ tabSpacingProperty(QLatin1String("tabSpacing")),
+ qWidgetClass(QLatin1String("QWidget")),
+ lineClass(QLatin1String("Line")),
+ geometryProperty(QLatin1String("geometry")),
+ scriptWidgetVariable(QLatin1String("widget")),
+ scriptChildWidgetsVariable(QLatin1String("childWidgets"))
+{
+ itemRoles.append(qMakePair(Qt::FontRole, QString::fromLatin1("font")));
+ itemRoles.append(qMakePair(Qt::TextAlignmentRole, QString::fromLatin1("textAlignment")));
+ itemRoles.append(qMakePair(Qt::BackgroundRole, QString::fromLatin1("background")));
+ itemRoles.append(qMakePair(Qt::ForegroundRole, QString::fromLatin1("foreground")));
+ itemRoles.append(qMakePair(Qt::CheckStateRole, QString::fromLatin1("checkState")));
+
+ foreach (const RoleNName &it, itemRoles)
+ treeItemRoleHash.insert(it.second, it.first);
+
+ itemTextRoles.append(qMakePair(qMakePair(Qt::EditRole, Qt::DisplayPropertyRole),
+ textAttribute)); // This must be first for the loop below
+ itemTextRoles.append(qMakePair(qMakePair(Qt::ToolTipRole, Qt::ToolTipPropertyRole),
+ toolTipAttribute));
+ itemTextRoles.append(qMakePair(qMakePair(Qt::StatusTipRole, Qt::StatusTipPropertyRole),
+ QString::fromLatin1("statusTip")));
+ itemTextRoles.append(qMakePair(qMakePair(Qt::WhatsThisRole, Qt::WhatsThisPropertyRole),
+ whatsThisAttribute));
+
+ // Note: this skips the first item!
+ QList<TextRoleNName>::const_iterator it = itemTextRoles.constBegin(), end = itemTextRoles.constEnd();
+ while (++it != end)
+ treeItemTextRoleHash.insert(it->second, it->first);
+}
+
+const QFormBuilderStrings &QFormBuilderStrings::instance()
+{
+ static const QFormBuilderStrings rc;
+ return rc;
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+} // namespace QFormInternal
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/formbuilderextra_p.h b/src/designer/src/lib/uilib/formbuilderextra_p.h
new file mode 100644
index 000000000..20516a548
--- /dev/null
+++ b/src/designer/src/lib/uilib/formbuilderextra_p.h
@@ -0,0 +1,276 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ABSTRACTFORMBUILDERPRIVATE_H
+#define ABSTRACTFORMBUILDERPRIVATE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "uilib_global.h"
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+# include "formscriptrunner_p.h"
+#endif
+
+#include <QtCore/QHash>
+#include <QtCore/QPointer>
+#include <QtCore/QStringList>
+#include <QtCore/QMap>
+#include <QtCore/QDir>
+
+QT_BEGIN_NAMESPACE
+
+class QDesignerCustomWidgetInterface;
+class QObject;
+class QVariant;
+class QWidget;
+class QObject;
+class QLabel;
+class QButtonGroup;
+class QBoxLayout;
+class QGridLayout;
+class QAction;
+class QActionGroup;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class DomButtonGroups;
+class DomButtonGroup;
+class DomCustomWidget;
+
+class QAbstractFormBuilder;
+class QResourceBuilder;
+class QTextBuilder;
+
+class QDESIGNER_UILIB_EXPORT QFormBuilderExtra
+{
+public:
+ QFormBuilderExtra();
+ ~QFormBuilderExtra();
+
+ struct CustomWidgetData {
+ CustomWidgetData();
+ explicit CustomWidgetData(const DomCustomWidget *dc);
+
+ QString addPageMethod;
+ QString script;
+ QString baseClass;
+ bool isContainer;
+ };
+
+ void clear();
+
+ bool applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value);
+
+ enum BuddyMode { BuddyApplyAll, BuddyApplyVisibleOnly };
+
+ void applyInternalProperties() const;
+ static bool applyBuddy(const QString &buddyName, BuddyMode applyMode, QLabel *label);
+
+ const QPointer<QWidget> &parentWidget() const;
+ bool parentWidgetIsSet() const;
+ void setParentWidget(const QPointer<QWidget> &w);
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ QFormScriptRunner &formScriptRunner();
+ QString customWidgetScript(const QString &className) const;
+#endif
+
+ void setProcessingLayoutWidget(bool processing);
+ bool processingLayoutWidget() const;
+
+ void setResourceBuilder(QResourceBuilder *builder);
+ QResourceBuilder *resourceBuilder() const;
+
+ void setTextBuilder(QTextBuilder *builder);
+ QTextBuilder *textBuilder() const;
+
+ void storeCustomWidgetData(const QString &className, const DomCustomWidget *d);
+ QString customWidgetAddPageMethod(const QString &className) const;
+ QString customWidgetBaseClass(const QString &className) const;
+ bool isCustomWidgetContainer(const QString &className) const;
+
+ // --- Hash used in creating button groups on demand. Store a map of name and pair of dom group and real group
+ void registerButtonGroups(const DomButtonGroups *groups);
+
+ typedef QPair<DomButtonGroup *, QButtonGroup*> ButtonGroupEntry;
+ typedef QHash<QString, ButtonGroupEntry> ButtonGroupHash;
+ const ButtonGroupHash &buttonGroups() const { return m_buttonGroups; }
+ ButtonGroupHash &buttonGroups() { return m_buttonGroups; }
+
+ // return stretch as a comma-separated list
+ static QString boxLayoutStretch(const QBoxLayout*);
+ // apply stretch
+ static bool setBoxLayoutStretch(const QString &, QBoxLayout*);
+ static void clearBoxLayoutStretch(QBoxLayout*);
+
+ static QString gridLayoutRowStretch(const QGridLayout *);
+ static bool setGridLayoutRowStretch(const QString &, QGridLayout *);
+ static void clearGridLayoutRowStretch(QGridLayout *);
+
+ static QString gridLayoutColumnStretch(const QGridLayout *);
+ static bool setGridLayoutColumnStretch(const QString &, QGridLayout *);
+ static void clearGridLayoutColumnStretch(QGridLayout *);
+
+ // return the row/column sizes as comma-separated lists
+ static QString gridLayoutRowMinimumHeight(const QGridLayout *);
+ static bool setGridLayoutRowMinimumHeight(const QString &, QGridLayout *);
+ static void clearGridLayoutRowMinimumHeight(QGridLayout *);
+
+ static QString gridLayoutColumnMinimumWidth(const QGridLayout *);
+ static bool setGridLayoutColumnMinimumWidth(const QString &, QGridLayout *);
+ static void clearGridLayoutColumnMinimumWidth(QGridLayout *);
+
+ QStringList m_pluginPaths;
+ QMap<QString, QDesignerCustomWidgetInterface*> m_customWidgets;
+
+ QHash<QObject*, bool> m_laidout;
+ QHash<QString, QAction*> m_actions;
+ QHash<QString, QActionGroup*> m_actionGroups;
+ int m_defaultMargin;
+ int m_defaultSpacing;
+ QDir m_workingDirectory;
+ QString m_errorString;
+ QString m_language;
+
+private:
+ void clearResourceBuilder();
+ void clearTextBuilder();
+
+ typedef QHash<QLabel*, QString> BuddyHash;
+ BuddyHash m_buddies;
+
+#ifndef QT_FORMBUILDER_NO_SCRIPT
+ QFormScriptRunner m_FormScriptRunner;
+#endif
+
+ QHash<QString, CustomWidgetData> m_customWidgetDataHash;
+
+ ButtonGroupHash m_buttonGroups;
+
+ bool m_layoutWidget;
+ QResourceBuilder *m_resourceBuilder;
+ QTextBuilder *m_textBuilder;
+
+ QPointer<QWidget> m_parentWidget;
+ bool m_parentWidgetIsSet;
+};
+
+void uiLibWarning(const QString &message);
+
+// Struct with static accessor that provides most strings used in the form builder.
+struct QDESIGNER_UILIB_EXPORT QFormBuilderStrings {
+ QFormBuilderStrings();
+
+ static const QFormBuilderStrings &instance();
+
+ const QString buddyProperty;
+ const QString cursorProperty;
+ const QString objectNameProperty;
+ const QString trueValue;
+ const QString falseValue;
+ const QString horizontalPostFix;
+ const QString separator;
+ const QString defaultTitle;
+ const QString titleAttribute;
+ const QString labelAttribute;
+ const QString toolTipAttribute;
+ const QString whatsThisAttribute;
+ const QString flagsAttribute;
+ const QString iconAttribute;
+ const QString pixmapAttribute;
+ const QString textAttribute;
+ const QString currentIndexProperty;
+ const QString toolBarAreaAttribute;
+ const QString toolBarBreakAttribute;
+ const QString dockWidgetAreaAttribute;
+ const QString marginProperty;
+ const QString spacingProperty;
+ const QString leftMarginProperty;
+ const QString topMarginProperty;
+ const QString rightMarginProperty;
+ const QString bottomMarginProperty;
+ const QString horizontalSpacingProperty;
+ const QString verticalSpacingProperty;
+ const QString sizeHintProperty;
+ const QString sizeTypeProperty;
+ const QString orientationProperty;
+ const QString styleSheetProperty;
+ const QString qtHorizontal;
+ const QString qtVertical;
+ const QString currentRowProperty;
+ const QString tabSpacingProperty;
+ const QString qWidgetClass;
+ const QString lineClass;
+ const QString geometryProperty;
+ const QString scriptWidgetVariable;
+ const QString scriptChildWidgetsVariable;
+
+ typedef QPair<Qt::ItemDataRole, QString> RoleNName;
+ QList<RoleNName> itemRoles;
+ QHash<QString, Qt::ItemDataRole> treeItemRoleHash;
+
+ // first.first is primary role, first.second is shadow role.
+ // Shadow is used for either the translation source or the designer
+ // representation of the string value.
+ typedef QPair<QPair<Qt::ItemDataRole, Qt::ItemDataRole>, QString> TextRoleNName;
+ QList<TextRoleNName> itemTextRoles;
+ QHash<QString, QPair<Qt::ItemDataRole, Qt::ItemDataRole> > treeItemTextRoleHash;
+};
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // ABSTRACTFORMBUILDERPRIVATE_H
diff --git a/src/designer/src/lib/uilib/formscriptrunner.cpp b/src/designer/src/lib/uilib/formscriptrunner.cpp
new file mode 100644
index 000000000..8efb12f9e
--- /dev/null
+++ b/src/designer/src/lib/uilib/formscriptrunner.cpp
@@ -0,0 +1,208 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "formscriptrunner_p.h"
+#include "formbuilderextra_p.h"
+#include "ui4_p.h"
+
+#include <QtScript/QScriptEngine>
+#include <QtWidgets/QWidget>
+#include <QtCore/QDebug>
+#include <QtCore/QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+ enum { debugFormScriptRunner = 0 };
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal {
+#endif
+
+class QFormScriptRunner::QFormScriptRunnerPrivate {
+public:
+ QFormScriptRunnerPrivate() : m_options(DisableScripts) {}
+ void clearErrors() { m_errors.clear(); }
+
+ bool run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage);
+
+ static void initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine);
+ static QString engineError(QScriptEngine &scriptEngine);
+
+ Options options() const { return m_options; }
+ void setOptions(Options options) { m_options = options; }
+
+ Errors errors() const { return m_errors; }
+private:
+ QScriptEngine m_scriptEngine;
+ Options m_options;
+ Errors m_errors;
+};
+
+bool QFormScriptRunner::QFormScriptRunnerPrivate::run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage) {
+ bool rc = false;
+ initializeEngine(widget, children, m_scriptEngine);
+
+ do {
+ m_scriptEngine.evaluate(script);
+ if (m_scriptEngine.hasUncaughtException ()) {
+ *errorMessage = QCoreApplication::tr("Exception at line %1: %2").arg(m_scriptEngine.uncaughtExceptionLineNumber()).arg(engineError(m_scriptEngine));
+ break;
+ }
+ rc = true;
+ } while (false);
+ m_scriptEngine.popContext();
+
+ if (!rc) {
+ Error error;
+ error.objectName = widget->objectName();
+ error.script = script;
+ error.errorMessage = *errorMessage;
+ m_errors.push_back(error);
+ }
+ return rc;
+}
+
+void QFormScriptRunner::QFormScriptRunnerPrivate::initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine) {
+ // Populate the script variables. This pushes a context which must be popped.
+ QScriptContext *ctx = scriptEngine.pushContext();
+ QScriptValue widgetObject = scriptEngine.newQObject(w);
+ QScriptValue childrenArray = scriptEngine.newArray (children.size());
+
+ for(int i = 0; i < children.size(); i++) {
+ childrenArray.setProperty(i, scriptEngine.newQObject(children[i]));
+ }
+
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ ctx ->activationObject().setProperty(strings.scriptWidgetVariable, widgetObject);
+ ctx ->activationObject().setProperty(strings.scriptChildWidgetsVariable, childrenArray);
+}
+
+QString QFormScriptRunner::QFormScriptRunnerPrivate::engineError(QScriptEngine &scriptEngine) {
+ QScriptValue error = scriptEngine.evaluate(QLatin1String("Error"));
+ if (error.isValid())
+ return error.toString();
+ return QCoreApplication::tr("Unknown error");
+}
+// -- QFormScriptRunner
+
+QFormScriptRunner::QFormScriptRunner() : m_impl(new QFormScriptRunnerPrivate)
+{
+}
+
+QFormScriptRunner::~QFormScriptRunner()
+{
+ delete m_impl;
+}
+
+bool QFormScriptRunner::run(const DomWidget *domWidget,
+ const QString &customWidgetScript,
+ QWidget *widget, const WidgetList &children,
+ QString *errorMessage)
+{
+ typedef QList<DomScript*> DomScripts;
+
+ const Options scriptOptions = m_impl->options();
+ if (scriptOptions & DisableScripts)
+ return true;
+ // get list
+ const DomScripts domScripts = domWidget->elementScript();
+ // Concatenate snippets, starting with custom widget script
+ QString script = customWidgetScript;
+ if (script.isEmpty() && domScripts.empty())
+ return true;
+
+ foreach (const DomScript *scriptSnippet, domScripts) {
+ // Ensure new line
+ if (!script.isEmpty() && !script.endsWith(QLatin1Char('\n')))
+ script += QLatin1Char('\n');
+ script += scriptSnippet->text();
+ }
+
+ if (script.isEmpty())
+ return true;
+
+ const bool rc = m_impl->run(script, widget, children, errorMessage);
+
+ if (debugFormScriptRunner) {
+ qDebug() << "For " << widget << " with " << children.size() << " children, ran: " << script;
+ if (!rc)
+ qDebug() << *errorMessage;
+ }
+
+ if (!rc) {
+ if (!(scriptOptions & DisableWarnings)) {
+ const QString message = QCoreApplication::tr("An error occurred while running the script for %1: %2\nScript: %3").
+ arg(widget->objectName()).arg(*errorMessage).arg(script);
+ qWarning() << message;
+ }
+ }
+ return rc;
+}
+
+QFormScriptRunner::Options QFormScriptRunner::options() const
+{
+ return m_impl->options();
+}
+
+void QFormScriptRunner::setOptions(Options options)
+{
+ m_impl->setOptions(options);
+}
+
+
+QFormScriptRunner::Errors QFormScriptRunner::errors() const
+{
+ return m_impl->errors();
+}
+
+void QFormScriptRunner::clearErrors()
+{
+ m_impl->clearErrors();
+}
+
+
+#ifdef QFORMINTERNAL_NAMESPACE
+} // namespace QFormInternal
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/formscriptrunner_p.h b/src/designer/src/lib/uilib/formscriptrunner_p.h
new file mode 100644
index 000000000..f0a6a368c
--- /dev/null
+++ b/src/designer/src/lib/uilib/formscriptrunner_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FORMSCRIPTRUNNER_H
+#define FORMSCRIPTRUNNER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "uilib_global.h"
+#include <QtCore/QList>
+#include <QtCore/QFlags>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+class QWidget;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class DomWidget;
+
+class QDESIGNER_UILIB_EXPORT QFormScriptRunner
+{
+public:
+ QFormScriptRunner();
+ ~QFormScriptRunner();
+
+ typedef QList<QWidget*> WidgetList;
+
+ bool run(const DomWidget *domWidget,
+ const QString &customWidgetScript,
+ QWidget *widget, const WidgetList &children,
+ QString *errorMessage);
+
+ struct Error {
+ QString objectName;
+ QString script;
+ QString errorMessage;
+ };
+ typedef QList<Error> Errors;
+ Errors errors() const;
+ void clearErrors();
+
+ enum Option {
+ NoOptions = 0x0,
+ DisableWarnings = 0x1,
+ DisableScripts = 02
+ };
+ Q_DECLARE_FLAGS(Options, Option)
+
+ Options options() const;
+ void setOptions(Options options);
+
+private:
+ class QFormScriptRunnerPrivate;
+ QFormScriptRunnerPrivate *m_impl;
+
+ QFormScriptRunner(const QFormScriptRunner &);
+ void operator = (const QFormScriptRunner &);
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QFormScriptRunner::Options)
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // FORMSCRIPTRUNNER_H
diff --git a/src/designer/src/lib/uilib/properties.cpp b/src/designer/src/lib/uilib/properties.cpp
new file mode 100644
index 000000000..88cd455d6
--- /dev/null
+++ b/src/designer/src/lib/uilib/properties.cpp
@@ -0,0 +1,681 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "properties_p.h"
+#include "ui4_p.h"
+#include "abstractformbuilder.h"
+#include "formbuilderextra_p.h"
+#include "resourcebuilder_p.h"
+
+#include <QtCore/QDateTime>
+#include <QtCore/QUrl>
+#include <QtCore/qdebug.h>
+
+#include <QtWidgets/QIcon>
+#include <QtGui/QPixmap>
+#include <QtGui/QFont>
+#include <QtWidgets/QFrame>
+#include <QtWidgets/QAbstractScrollArea>
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+static inline void fixEnum(QString &s)
+{
+ int qualifierIndex = s.lastIndexOf(QLatin1Char(':'));
+ if (qualifierIndex == -1)
+ qualifierIndex = s.lastIndexOf(QLatin1Char('.'));
+ if (qualifierIndex != -1)
+ s.remove(0, qualifierIndex + 1);
+}
+// Convert complex DOM types with the help of QAbstractFormBuilder
+QVariant domPropertyToVariant(QAbstractFormBuilder *afb,const QMetaObject *meta,const DomProperty *p)
+{
+ // Complex types that need functions from QAbstractFormBuilder
+ switch(p->kind()) {
+ case DomProperty::String: {
+ const int index = meta->indexOfProperty(p->attributeName().toUtf8());
+ if (index != -1 && meta->property(index).type() == QVariant::KeySequence)
+ return QVariant::fromValue(QKeySequence(p->elementString()->text()));
+ }
+ break;
+
+ case DomProperty::Palette: {
+ const DomPalette *dom = p->elementPalette();
+ QPalette palette;
+
+ if (dom->elementActive())
+ afb->setupColorGroup(palette, QPalette::Active, dom->elementActive());
+
+ if (dom->elementInactive())
+ afb->setupColorGroup(palette, QPalette::Inactive, dom->elementInactive());
+
+ if (dom->elementDisabled())
+ afb->setupColorGroup(palette, QPalette::Disabled, dom->elementDisabled());
+
+ palette.setCurrentColorGroup(QPalette::Active);
+ return QVariant::fromValue(palette);
+ }
+
+ case DomProperty::Set: {
+ const QByteArray pname = p->attributeName().toUtf8();
+ const int index = meta->indexOfProperty(pname);
+ if (index == -1) {
+ uiLibWarning(QCoreApplication::translate("QFormBuilder", "The set-type property %1 could not be read.").arg(p->attributeName()));
+ return QVariant();
+ }
+
+ const QMetaEnum e = meta->property(index).enumerator();
+ Q_ASSERT(e.isFlag() == true);
+ return QVariant(e.keysToValue(p->elementSet().toUtf8()));
+ }
+
+ case DomProperty::Enum: {
+ const QByteArray pname = p->attributeName().toUtf8();
+ const int index = meta->indexOfProperty(pname);
+ QString enumValue = p->elementEnum();
+ // Triggers in case of objects in Designer like Spacer/Line for which properties
+ // are serialized using language introspection. On preview, however, these objects are
+ // emulated by hacks in the formbuilder (size policy/orientation)
+ fixEnum(enumValue);
+ if (index == -1) {
+ // ### special-casing for Line (QFrame) -- fix for 4.2. Jambi hack for enumerations
+ if (!qstrcmp(meta->className(), "QFrame")
+ && (pname == QByteArray("orientation"))) {
+ return QVariant(enumValue == QFormBuilderStrings::instance().horizontalPostFix ? QFrame::HLine : QFrame::VLine);
+ } else {
+ uiLibWarning(QCoreApplication::translate("QFormBuilder", "The enumeration-type property %1 could not be read.").arg(p->attributeName()));
+ return QVariant();
+ }
+ }
+
+ const QMetaEnum e = meta->property(index).enumerator();
+ return QVariant(e.keyToValue(enumValue.toUtf8()));
+ }
+ case DomProperty::Brush:
+ return QVariant::fromValue(afb->setupBrush(p->elementBrush()));
+ default:
+ if (afb->resourceBuilder()->isResourceProperty(p)) {
+ return afb->resourceBuilder()->loadResource(afb->workingDirectory(), p);
+ }
+
+ break;
+ }
+
+ // simple type
+ return domPropertyToVariant(p);
+}
+
+// Convert simple DOM types
+QVariant domPropertyToVariant(const DomProperty *p)
+{
+ // requires non-const virtual nameToIcon, etc.
+ switch(p->kind()) {
+ case DomProperty::Bool:
+ return QVariant(p->elementBool() == QFormBuilderStrings::instance().trueValue);
+
+ case DomProperty::Cstring:
+ return QVariant(p->elementCstring().toUtf8());
+
+ case DomProperty::Point: {
+ const DomPoint *point = p->elementPoint();
+ return QVariant(QPoint(point->elementX(), point->elementY()));
+ }
+
+ case DomProperty::PointF: {
+ const DomPointF *pointf = p->elementPointF();
+ return QVariant(QPointF(pointf->elementX(), pointf->elementY()));
+ }
+
+ case DomProperty::Size: {
+ const DomSize *size = p->elementSize();
+ return QVariant(QSize(size->elementWidth(), size->elementHeight()));
+ }
+
+ case DomProperty::SizeF: {
+ const DomSizeF *sizef = p->elementSizeF();
+ return QVariant(QSizeF(sizef->elementWidth(), sizef->elementHeight()));
+ }
+
+ case DomProperty::Rect: {
+ const DomRect *rc = p->elementRect();
+ const QRect g(rc->elementX(), rc->elementY(), rc->elementWidth(), rc->elementHeight());
+ return QVariant(g);
+ }
+
+ case DomProperty::RectF: {
+ const DomRectF *rcf = p->elementRectF();
+ const QRectF g(rcf->elementX(), rcf->elementY(), rcf->elementWidth(), rcf->elementHeight());
+ return QVariant(g);
+ }
+
+ case DomProperty::String:
+ return QVariant(p->elementString()->text());
+
+ case DomProperty::Number:
+ return QVariant(p->elementNumber());
+
+ case DomProperty::UInt:
+ return QVariant(p->elementUInt());
+
+ case DomProperty::LongLong:
+ return QVariant(p->elementLongLong());
+
+ case DomProperty::ULongLong:
+ return QVariant(p->elementULongLong());
+
+ case DomProperty::Double:
+ return QVariant(p->elementDouble());
+
+ case DomProperty::Char: {
+ const DomChar *character = p->elementChar();
+ const QChar c(character->elementUnicode());
+ return QVariant::fromValue(c);
+ }
+
+ case DomProperty::Color: {
+ const DomColor *color = p->elementColor();
+ QColor c(color->elementRed(), color->elementGreen(), color->elementBlue());
+ if (color->hasAttributeAlpha())
+ c.setAlpha(color->attributeAlpha());
+ return QVariant::fromValue(c);
+ }
+
+ case DomProperty::Font: {
+ const DomFont *font = p->elementFont();
+
+ QFont f;
+ if (font->hasElementFamily() && !font->elementFamily().isEmpty())
+ f.setFamily(font->elementFamily());
+ if (font->hasElementPointSize() && font->elementPointSize() > 0)
+ f.setPointSize(font->elementPointSize());
+ if (font->hasElementWeight() && font->elementWeight() > 0)
+ f.setWeight(font->elementWeight());
+ if (font->hasElementItalic())
+ f.setItalic(font->elementItalic());
+ if (font->hasElementBold())
+ f.setBold(font->elementBold());
+ if (font->hasElementUnderline())
+ f.setUnderline(font->elementUnderline());
+ if (font->hasElementStrikeOut())
+ f.setStrikeOut(font->elementStrikeOut());
+ if (font->hasElementKerning())
+ f.setKerning(font->elementKerning());
+ if (font->hasElementAntialiasing())
+ f.setStyleStrategy(font->elementAntialiasing() ? QFont::PreferDefault : QFont::NoAntialias);
+ if (font->hasElementStyleStrategy()) {
+ f.setStyleStrategy(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QFont::StyleStrategy>("styleStrategy", font->elementStyleStrategy().toLatin1()));
+ }
+ return QVariant::fromValue(f);
+ }
+
+ case DomProperty::Date: {
+ const DomDate *date = p->elementDate();
+ return QVariant(QDate(date->elementYear(), date->elementMonth(), date->elementDay()));
+ }
+
+ case DomProperty::Time: {
+ const DomTime *t = p->elementTime();
+ return QVariant(QTime(t->elementHour(), t->elementMinute(), t->elementSecond()));
+ }
+
+ case DomProperty::DateTime: {
+ const DomDateTime *dateTime = p->elementDateTime();
+ const QDate d(dateTime->elementYear(), dateTime->elementMonth(), dateTime->elementDay());
+ const QTime tm(dateTime->elementHour(), dateTime->elementMinute(), dateTime->elementSecond());
+ return QVariant(QDateTime(d, tm));
+ }
+
+ case DomProperty::Url: {
+ const DomUrl *url = p->elementUrl();
+ return QVariant(QUrl(url->elementString()->text()));
+ }
+
+#ifndef QT_NO_CURSOR
+ case DomProperty::Cursor:
+ return QVariant::fromValue(QCursor(static_cast<Qt::CursorShape>(p->elementCursor())));
+
+ case DomProperty::CursorShape:
+ return QVariant::fromValue(QCursor(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, Qt::CursorShape>("cursorShape", p->elementCursorShape().toLatin1())));
+#endif
+
+ case DomProperty::Locale: {
+ const DomLocale *locale = p->elementLocale();
+ return QVariant::fromValue(QLocale(enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QLocale::Language>("language", locale->attributeLanguage().toLatin1()),
+ enumKeyOfObjectToValue<QAbstractFormBuilderGadget, QLocale::Country>("country", locale->attributeCountry().toLatin1())));
+ }
+ case DomProperty::SizePolicy: {
+ const DomSizePolicy *sizep = p->elementSizePolicy();
+
+ QSizePolicy sizePolicy;
+ sizePolicy.setHorizontalStretch(sizep->elementHorStretch());
+ sizePolicy.setVerticalStretch(sizep->elementVerStretch());
+
+ const QMetaEnum sizeType_enum = metaEnum<QAbstractFormBuilderGadget>("sizeType");
+
+ if (sizep->hasElementHSizeType()) {
+ sizePolicy.setHorizontalPolicy((QSizePolicy::Policy) sizep->elementHSizeType());
+ } else if (sizep->hasAttributeHSizeType()) {
+ const QSizePolicy::Policy sp = enumKeyToValue<QSizePolicy::Policy>(sizeType_enum, sizep->attributeHSizeType().toLatin1());
+ sizePolicy.setHorizontalPolicy(sp);
+ }
+
+ if (sizep->hasElementVSizeType()) {
+ sizePolicy.setVerticalPolicy((QSizePolicy::Policy) sizep->elementVSizeType());
+ } else if (sizep->hasAttributeVSizeType()) {
+ const QSizePolicy::Policy sp = enumKeyToValue<QSizePolicy::Policy>(sizeType_enum, sizep->attributeVSizeType().toLatin1());
+ sizePolicy.setVerticalPolicy(sp);
+ }
+
+ return QVariant::fromValue(sizePolicy);
+ }
+
+ case DomProperty::StringList:
+ return QVariant(p->elementStringList()->elementString());
+
+ default:
+ uiLibWarning(QCoreApplication::translate("QFormBuilder", "Reading properties of the type %1 is not supported yet.").arg(p->kind()));
+ break;
+ }
+
+ return QVariant();
+}
+
+// Apply a simple variant type to a DOM property
+static bool applySimpleProperty(const QVariant &v, bool translateString, DomProperty *dom_prop)
+{
+ switch (v.type()) {
+ case QVariant::String: {
+ DomString *str = new DomString();
+ str->setText(v.toString());
+ if (!translateString)
+ str->setAttributeNotr(QLatin1String("true"));
+ dom_prop->setElementString(str);
+ }
+ return true;
+
+ case QVariant::ByteArray:
+ dom_prop->setElementCstring(QString::fromUtf8(v.toByteArray()));
+ return true;
+
+ case QVariant::Int:
+ dom_prop->setElementNumber(v.toInt());
+ return true;
+
+ case QVariant::UInt:
+ dom_prop->setElementUInt(v.toUInt());
+ return true;
+
+ case QVariant::LongLong:
+ dom_prop->setElementLongLong(v.toLongLong());
+ return true;
+
+ case QVariant::ULongLong:
+ dom_prop->setElementULongLong(v.toULongLong());
+ return true;
+
+ case QVariant::Double:
+ dom_prop->setElementDouble(v.toDouble());
+ return true;
+
+ case QVariant::Bool:
+ dom_prop->setElementBool(v.toBool() ? QFormBuilderStrings::instance().trueValue : QFormBuilderStrings::instance().falseValue);
+ return true;
+
+ case QVariant::Char: {
+ DomChar *ch = new DomChar();
+ const QChar character = v.toChar();
+ ch->setElementUnicode(character.unicode());
+ dom_prop->setElementChar(ch);
+ }
+ return true;
+
+ case QVariant::Point: {
+ DomPoint *pt = new DomPoint();
+ const QPoint point = v.toPoint();
+ pt->setElementX(point.x());
+ pt->setElementY(point.y());
+ dom_prop->setElementPoint(pt);
+ }
+ return true;
+
+ case QVariant::PointF: {
+ DomPointF *ptf = new DomPointF();
+ const QPointF pointf = v.toPointF();
+ ptf->setElementX(pointf.x());
+ ptf->setElementY(pointf.y());
+ dom_prop->setElementPointF(ptf);
+ }
+ return true;
+
+ case QVariant::Color: {
+ DomColor *clr = new DomColor();
+ const QColor color = qvariant_cast<QColor>(v);
+ clr->setElementRed(color.red());
+ clr->setElementGreen(color.green());
+ clr->setElementBlue(color.blue());
+ const int alphaChannel = color.alpha();
+ if (alphaChannel != 255)
+ clr->setAttributeAlpha(alphaChannel);
+ dom_prop->setElementColor(clr);
+ }
+ return true;
+
+ case QVariant::Size: {
+ DomSize *sz = new DomSize();
+ const QSize size = v.toSize();
+ sz->setElementWidth(size.width());
+ sz->setElementHeight(size.height());
+ dom_prop->setElementSize(sz);
+ }
+ return true;
+
+ case QVariant::SizeF: {
+ DomSizeF *szf = new DomSizeF();
+ const QSizeF sizef = v.toSizeF();
+ szf->setElementWidth(sizef.width());
+ szf->setElementHeight(sizef.height());
+ dom_prop->setElementSizeF(szf);
+ }
+ return true;
+
+ case QVariant::Rect: {
+ DomRect *rc = new DomRect();
+ const QRect rect = v.toRect();
+ rc->setElementX(rect.x());
+ rc->setElementY(rect.y());
+ rc->setElementWidth(rect.width());
+ rc->setElementHeight(rect.height());
+ dom_prop->setElementRect(rc);
+ }
+ return true;
+
+ case QVariant::RectF: {
+ DomRectF *rcf = new DomRectF();
+ const QRectF rectf = v.toRectF();
+ rcf->setElementX(rectf.x());
+ rcf->setElementY(rectf.y());
+ rcf->setElementWidth(rectf.width());
+ rcf->setElementHeight(rectf.height());
+ dom_prop->setElementRectF(rcf);
+ }
+ return true;
+
+ case QVariant::Font: {
+ DomFont *fnt = new DomFont();
+ const QFont font = qvariant_cast<QFont>(v);
+ const uint mask = font.resolve();
+ if (mask & QFont::WeightResolved) {
+ fnt->setElementBold(font.bold());
+ fnt->setElementWeight(font.weight());
+ }
+ if (mask & QFont::FamilyResolved)
+ fnt->setElementFamily(font.family());
+ if (mask & QFont::StyleResolved)
+ fnt->setElementItalic(font.italic());
+ if (mask & QFont::SizeResolved)
+ fnt->setElementPointSize(font.pointSize());
+ if (mask & QFont::StrikeOutResolved)
+ fnt->setElementStrikeOut(font.strikeOut());
+ if (mask & QFont::UnderlineResolved)
+ fnt->setElementUnderline(font.underline());
+ if (mask & QFont::KerningResolved)
+ fnt->setElementKerning(font.kerning());
+ if (mask & QFont::StyleStrategyResolved) {
+ const QMetaEnum styleStrategy_enum = metaEnum<QAbstractFormBuilderGadget>("styleStrategy");
+ fnt->setElementStyleStrategy(QLatin1String(styleStrategy_enum.valueToKey(font.styleStrategy())));
+ }
+ dom_prop->setElementFont(fnt);
+ }
+ return true;
+
+#ifndef QT_NO_CURSOR
+ case QVariant::Cursor: {
+ const QMetaEnum cursorShape_enum = metaEnum<QAbstractFormBuilderGadget>("cursorShape");
+ dom_prop->setElementCursorShape(QLatin1String(cursorShape_enum.valueToKey(qvariant_cast<QCursor>(v).shape())));
+ }
+ return true;
+#endif
+
+ case QVariant::KeySequence: {
+ DomString *s = new DomString();
+ s->setText(qvariant_cast<QKeySequence>(v).toString(QKeySequence::PortableText));
+ dom_prop->setElementString(s);
+ }
+ return true;
+
+ case QVariant::Locale: {
+ DomLocale *dom = new DomLocale();
+ const QLocale locale = qvariant_cast<QLocale>(v);
+
+ const QMetaEnum language_enum = metaEnum<QAbstractFormBuilderGadget>("language");
+ const QMetaEnum country_enum = metaEnum<QAbstractFormBuilderGadget>("country");
+
+ dom->setAttributeLanguage(QLatin1String(language_enum.valueToKey(locale.language())));
+ dom->setAttributeCountry(QLatin1String(country_enum.valueToKey(locale.country())));
+
+ dom_prop->setElementLocale(dom);
+ }
+ return true;
+
+ case QVariant::SizePolicy: {
+ DomSizePolicy *dom = new DomSizePolicy();
+ const QSizePolicy sizePolicy = qvariant_cast<QSizePolicy>(v);
+
+ dom->setElementHorStretch(sizePolicy.horizontalStretch());
+ dom->setElementVerStretch(sizePolicy.verticalStretch());
+
+ const QMetaEnum sizeType_enum = metaEnum<QAbstractFormBuilderGadget>("sizeType");
+
+ dom->setAttributeHSizeType(QLatin1String(sizeType_enum.valueToKey(sizePolicy.horizontalPolicy())));
+ dom->setAttributeVSizeType(QLatin1String(sizeType_enum.valueToKey(sizePolicy.verticalPolicy())));
+
+ dom_prop->setElementSizePolicy(dom);
+ }
+ return true;
+
+ case QVariant::Date: {
+ DomDate *dom = new DomDate();
+ const QDate date = qvariant_cast<QDate>(v);
+
+ dom->setElementYear(date.year());
+ dom->setElementMonth(date.month());
+ dom->setElementDay(date.day());
+
+ dom_prop->setElementDate(dom);
+ }
+ return true;
+
+ case QVariant::Time: {
+ DomTime *dom = new DomTime();
+ const QTime time = qvariant_cast<QTime>(v);
+
+ dom->setElementHour(time.hour());
+ dom->setElementMinute(time.minute());
+ dom->setElementSecond(time.second());
+
+ dom_prop->setElementTime(dom);
+ }
+ return true;
+
+ case QVariant::DateTime: {
+ DomDateTime *dom = new DomDateTime();
+ const QDateTime dateTime = qvariant_cast<QDateTime>(v);
+
+ dom->setElementHour(dateTime.time().hour());
+ dom->setElementMinute(dateTime.time().minute());
+ dom->setElementSecond(dateTime.time().second());
+ dom->setElementYear(dateTime.date().year());
+ dom->setElementMonth(dateTime.date().month());
+ dom->setElementDay(dateTime.date().day());
+
+ dom_prop->setElementDateTime(dom);
+ }
+ return true;
+
+ case QVariant::Url: {
+ DomUrl *dom = new DomUrl();
+ const QUrl url = v.toUrl();
+
+ DomString *str = new DomString();
+ str->setText(url.toString());
+ dom->setElementString(str);
+
+ dom_prop->setElementUrl(dom);
+ }
+ return true;
+
+ case QVariant::StringList: {
+ DomStringList *sl = new DomStringList;
+ sl->setElementString(qvariant_cast<QStringList>(v));
+ dom_prop->setElementStringList(sl);
+ }
+ return true;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+static QString msgCannotWriteProperty(const QString &pname, const QVariant &v)
+{
+ return QCoreApplication::translate("QFormBuilder", "The property %1 could not be written. The type %2 is not supported yet.").
+ arg(pname).arg(QLatin1String(v.typeName()));
+
+}
+
+static bool isOfType(const QMetaObject *what, const QMetaObject *type)
+{
+ do {
+ if (what == type)
+ return true;
+ } while ((what = what->superClass()));
+ return false;
+}
+
+static bool isTranslatable(const QString &pname, const QVariant &v, const QMetaObject *meta)
+{
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+ if (pname == strings.objectNameProperty)
+ return false;
+ if (pname == strings.styleSheetProperty && v.type() == QVariant::String && isOfType(meta, &QWidget::staticMetaObject))
+ return false;
+ return true;
+}
+
+// Convert complex variant types to DOM properties with the help of QAbstractFormBuilder
+// Does not perform a check using QAbstractFormBuilder::checkProperty().
+DomProperty *variantToDomProperty(QAbstractFormBuilder *afb, const QMetaObject *meta,
+ const QString &pname, const QVariant &v)
+{
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+
+ DomProperty *dom_prop = new DomProperty();
+ dom_prop->setAttributeName(pname);
+
+ const int pindex = meta->indexOfProperty(pname.toLatin1());
+ if (pindex != -1) {
+ QMetaProperty meta_property = meta->property(pindex);
+ if ((v.type() == QVariant::Int || v.type() == QVariant::UInt) && meta_property.isEnumType()) {
+ const QMetaEnum e = meta_property.enumerator();
+ if (e.isFlag())
+ dom_prop->setElementSet(QString::fromAscii(e.valueToKeys(v.toInt())));
+ else
+ dom_prop->setElementEnum(QString::fromAscii(e.valueToKey(v.toInt())));
+ return dom_prop;
+ }
+ if (!meta_property.hasStdCppSet() || (isOfType(meta, &QAbstractScrollArea::staticMetaObject) && pname == strings.cursorProperty))
+ dom_prop->setAttributeStdset(0);
+ }
+
+ // Try simple properties
+ if (applySimpleProperty(v, isTranslatable(pname, v, meta), dom_prop))
+ return dom_prop;
+
+ // Complex properties
+ switch (v.type()) {
+ case QVariant::Palette: {
+ DomPalette *dom = new DomPalette();
+ QPalette palette = qvariant_cast<QPalette>(v);
+
+ palette.setCurrentColorGroup(QPalette::Active);
+ dom->setElementActive(afb->saveColorGroup(palette));
+
+ palette.setCurrentColorGroup(QPalette::Inactive);
+ dom->setElementInactive(afb->saveColorGroup(palette));
+
+ palette.setCurrentColorGroup(QPalette::Disabled);
+ dom->setElementDisabled(afb->saveColorGroup(palette));
+
+ dom_prop->setElementPalette(dom);
+ } break;
+ case QVariant::Brush:
+ dom_prop->setElementBrush(afb->saveBrush(qvariant_cast<QBrush>(v)));
+ break;
+ default: {
+ const bool hadAttributeStdset = dom_prop->hasAttributeStdset();
+ const bool attributeStdset = dom_prop->attributeStdset();
+ delete dom_prop;
+ if (afb->resourceBuilder()->isResourceType(v)) {
+ dom_prop = afb->resourceBuilder()->saveResource(afb->workingDirectory(), v);
+ if (dom_prop) {
+ dom_prop->setAttributeName(pname);
+ if (hadAttributeStdset)
+ dom_prop->setAttributeStdset(attributeStdset);
+ }
+ break;
+ }
+ uiLibWarning(msgCannotWriteProperty(pname, v));
+ } return 0;
+ }
+ return dom_prop;
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/properties_p.h b/src/designer/src/lib/uilib/properties_p.h
new file mode 100644
index 000000000..98b84fce9
--- /dev/null
+++ b/src/designer/src/lib/uilib/properties_p.h
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of Qt Designer. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef UILIBPROPERTIES_H
+#define UILIBPROPERTIES_H
+
+#include "uilib_global.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QMetaProperty>
+#include <QtCore/QLocale>
+#include <QtCore/QCoreApplication>
+
+#include <QtWidgets/QWidget>
+
+#include "formbuilderextra_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class QAbstractFormBuilder;
+class DomProperty;
+
+QDESIGNER_UILIB_EXPORT DomProperty *variantToDomProperty(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const QString &propertyName, const QVariant &value);
+
+
+QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(const DomProperty *property);
+QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const DomProperty *property);
+
+// This class exists to provide meta information
+// for enumerations only.
+class QAbstractFormBuilderGadget: public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(Qt::ItemFlags itemFlags READ fakeItemFlags)
+ Q_PROPERTY(Qt::CheckState checkState READ fakeCheckState)
+ Q_PROPERTY(Qt::Alignment textAlignment READ fakeAlignment)
+ Q_PROPERTY(Qt::Orientation orientation READ fakeOrientation)
+ Q_PROPERTY(QSizePolicy::Policy sizeType READ fakeSizeType)
+ Q_PROPERTY(QPalette::ColorRole colorRole READ fakeColorRole)
+ Q_PROPERTY(QPalette::ColorGroup colorGroup READ fakeColorGroup)
+ Q_PROPERTY(QFont::StyleStrategy styleStrategy READ fakeStyleStrategy)
+ Q_PROPERTY(Qt::CursorShape cursorShape READ fakeCursorShape)
+ Q_PROPERTY(Qt::BrushStyle brushStyle READ fakeBrushStyle)
+ Q_PROPERTY(Qt::ToolBarArea toolBarArea READ fakeToolBarArea)
+ Q_PROPERTY(QGradient::Type gradientType READ fakeGradientType)
+ Q_PROPERTY(QGradient::Spread gradientSpread READ fakeGradientSpread)
+ Q_PROPERTY(QGradient::CoordinateMode gradientCoordinate READ fakeGradientCoordinate)
+ Q_PROPERTY(QLocale::Language language READ fakeLanguage)
+ Q_PROPERTY(QLocale::Country country READ fakeCountry)
+public:
+ QAbstractFormBuilderGadget() { Q_ASSERT(0); }
+
+ Qt::Orientation fakeOrientation() const { Q_ASSERT(0); return Qt::Horizontal; }
+ QSizePolicy::Policy fakeSizeType() const { Q_ASSERT(0); return QSizePolicy::Expanding; }
+ QPalette::ColorGroup fakeColorGroup() const { Q_ASSERT(0); return static_cast<QPalette::ColorGroup>(0); }
+ QPalette::ColorRole fakeColorRole() const { Q_ASSERT(0); return static_cast<QPalette::ColorRole>(0); }
+ QFont::StyleStrategy fakeStyleStrategy() const { Q_ASSERT(0); return QFont::PreferDefault; }
+ Qt::CursorShape fakeCursorShape() const { Q_ASSERT(0); return Qt::ArrowCursor; }
+ Qt::BrushStyle fakeBrushStyle() const { Q_ASSERT(0); return Qt::NoBrush; }
+ Qt::ToolBarArea fakeToolBarArea() const { Q_ASSERT(0); return Qt::NoToolBarArea; }
+ QGradient::Type fakeGradientType() const { Q_ASSERT(0); return QGradient::NoGradient; }
+ QGradient::Spread fakeGradientSpread() const { Q_ASSERT(0); return QGradient::PadSpread; }
+ QGradient::CoordinateMode fakeGradientCoordinate() const { Q_ASSERT(0); return QGradient::LogicalMode; }
+ QLocale::Language fakeLanguage() const { Q_ASSERT(0); return QLocale::C; }
+ QLocale::Country fakeCountry() const { Q_ASSERT(0); return QLocale::AnyCountry; }
+ Qt::ItemFlags fakeItemFlags() const { Q_ASSERT(0); return Qt::NoItemFlags; }
+ Qt::CheckState fakeCheckState() const { Q_ASSERT(0); return Qt::Unchecked; }
+ Qt::Alignment fakeAlignment() const { Q_ASSERT(0); return Qt::AlignLeft; }
+};
+
+// Convert key to value for a given QMetaEnum
+template <class EnumType>
+inline EnumType enumKeyToValue(const QMetaEnum &metaEnum,const char *key, const EnumType* = 0)
+{
+ int val = metaEnum.keyToValue(key);
+ if (val == -1) {
+
+ uiLibWarning(QCoreApplication::translate("QFormBuilder", "The enumeration-value '%1' is invalid. The default value '%2' will be used instead.")
+ .arg(QString::fromUtf8(key)).arg(QString::fromUtf8(metaEnum.key(0))));
+ val = metaEnum.value(0);
+ }
+ return static_cast<EnumType>(val);
+}
+
+// Convert keys to value for a given QMetaEnum
+template <class EnumType>
+inline EnumType enumKeysToValue(const QMetaEnum &metaEnum,const char *keys, const EnumType* = 0)
+{
+ int val = metaEnum.keysToValue(keys);
+ if (val == -1) {
+
+ uiLibWarning(QCoreApplication::translate("QFormBuilder", "The flag-value '%1' is invalid. Zero will be used instead.")
+ .arg(QString::fromUtf8(keys)));
+ val = 0;
+ }
+ return static_cast<EnumType>(QFlag(val));
+}
+
+// Access meta enumeration object of a qobject
+template <class QObjectType>
+inline QMetaEnum metaEnum(const char *name, const QObjectType* = 0)
+{
+ const int e_index = QObjectType::staticMetaObject.indexOfProperty(name);
+ Q_ASSERT(e_index != -1);
+ return QObjectType::staticMetaObject.property(e_index).enumerator();
+}
+
+// Convert key to value for enumeration by name
+template <class QObjectType, class EnumType>
+inline EnumType enumKeyOfObjectToValue(const char *enumName, const char *key, const QObjectType* = 0, const EnumType* = 0)
+{
+ const QMetaEnum me = metaEnum<QObjectType>(enumName);
+ return enumKeyToValue<EnumType>(me, key);
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // UILIBPROPERTIES_H
diff --git a/src/designer/src/lib/uilib/qdesignerexportwidget.h b/src/designer/src/lib/uilib/qdesignerexportwidget.h
new file mode 100644
index 000000000..54053ff27
--- /dev/null
+++ b/src/designer/src/lib/uilib/qdesignerexportwidget.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDESIGNEREXPORTWIDGET_H
+#define QDESIGNEREXPORTWIDGET_H
+
+#include <QtCore/QtGlobal>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+#if 0
+// pragma for syncqt, don't remove.
+#pragma qt_class(QDesignerExportWidget)
+#endif
+
+#if defined(QDESIGNER_EXPORT_WIDGETS)
+# define QDESIGNER_WIDGET_EXPORT Q_DECL_EXPORT
+#else
+# define QDESIGNER_WIDGET_EXPORT Q_DECL_IMPORT
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //QDESIGNEREXPORTWIDGET_H
diff --git a/src/designer/src/lib/uilib/resourcebuilder.cpp b/src/designer/src/lib/uilib/resourcebuilder.cpp
new file mode 100644
index 000000000..72921c636
--- /dev/null
+++ b/src/designer/src/lib/uilib/resourcebuilder.cpp
@@ -0,0 +1,180 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "resourcebuilder_p.h"
+#include "ui4_p.h"
+#include <QtCore/QVariant>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtCore/QDebug>
+#include <QtGui/QPixmap>
+#include <QtWidgets/QIcon>
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal {
+#endif
+
+enum { themeDebug = 0 };
+
+QResourceBuilder::QResourceBuilder()
+{
+
+}
+
+QResourceBuilder::~QResourceBuilder()
+{
+
+}
+
+int QResourceBuilder::iconStateFlags(const DomResourceIcon *dpi)
+{
+ int rc = 0;
+ if (dpi->hasElementNormalOff())
+ rc |= NormalOff;
+ if (dpi->hasElementNormalOn())
+ rc |= NormalOn;
+ if (dpi->hasElementDisabledOff())
+ rc |= DisabledOff;
+ if (dpi->hasElementDisabledOn())
+ rc |= DisabledOn;
+ if (dpi->hasElementActiveOff())
+ rc |= ActiveOff;
+ if (dpi->hasElementActiveOn())
+ rc |= ActiveOn;
+ if (dpi->hasElementSelectedOff())
+ rc |= SelectedOff;
+ if (dpi->hasElementSelectedOn())
+ rc |= SelectedOn;
+ return rc;
+}
+
+QVariant QResourceBuilder::loadResource(const QDir &workingDirectory, const DomProperty *property) const
+{
+ switch (property->kind()) {
+ case DomProperty::Pixmap: {
+ const DomResourcePixmap *dpx = property->elementPixmap();
+ QPixmap pixmap(QFileInfo(workingDirectory, dpx->text()).absoluteFilePath());
+ return QVariant::fromValue(pixmap);
+ }
+ case DomProperty::IconSet: {
+ const DomResourceIcon *dpi = property->elementIconSet();
+ if (!dpi->attributeTheme().isEmpty()) {
+ const QString theme = dpi->attributeTheme();
+ const bool known = QIcon::hasThemeIcon(theme);
+ if (themeDebug)
+ qDebug("Theme %s known %d", qPrintable(theme), known);
+ if (known)
+ return qVariantFromValue(QIcon::fromTheme(dpi->attributeTheme()));
+ } // non-empty theme
+ if (const int flags = iconStateFlags(dpi)) { // new, post 4.4 format
+ QIcon icon;
+ if (flags & NormalOff)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementNormalOff()->text()).absoluteFilePath(), QSize(), QIcon::Normal, QIcon::Off);
+ if (flags & NormalOn)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementNormalOn()->text()).absoluteFilePath(), QSize(), QIcon::Normal, QIcon::On);
+ if (flags & DisabledOff)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementDisabledOff()->text()).absoluteFilePath(), QSize(), QIcon::Disabled, QIcon::Off);
+ if (flags & DisabledOn)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementDisabledOn()->text()).absoluteFilePath(), QSize(), QIcon::Disabled, QIcon::On);
+ if (flags & ActiveOff)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementActiveOff()->text()).absoluteFilePath(), QSize(), QIcon::Active, QIcon::Off);
+ if (flags & ActiveOn)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementActiveOn()->text()).absoluteFilePath(), QSize(), QIcon::Active, QIcon::On);
+ if (flags & SelectedOff)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementSelectedOff()->text()).absoluteFilePath(), QSize(), QIcon::Selected, QIcon::Off);
+ if (flags & SelectedOn)
+ icon.addFile(QFileInfo(workingDirectory, dpi->elementSelectedOn()->text()).absoluteFilePath(), QSize(), QIcon::Selected, QIcon::On);
+ return QVariant::fromValue(icon);
+ } else { // 4.3 legacy
+ const QIcon icon(QFileInfo(workingDirectory, dpi->text()).absoluteFilePath());
+ return QVariant::fromValue(icon);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return QVariant();
+}
+
+QVariant QResourceBuilder::toNativeValue(const QVariant &value) const
+{
+ return value;
+}
+
+DomProperty *QResourceBuilder::saveResource(const QDir &workingDirectory, const QVariant &value) const
+{
+ Q_UNUSED(workingDirectory)
+ Q_UNUSED(value)
+ return 0;
+}
+
+bool QResourceBuilder::isResourceProperty(const DomProperty *p) const
+{
+ switch (p->kind()) {
+ case DomProperty::Pixmap:
+ case DomProperty::IconSet:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool QResourceBuilder::isResourceType(const QVariant &value) const
+{
+ switch (value.type()) {
+ case QVariant::Pixmap:
+ case QVariant::Icon:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+} // namespace QFormInternal
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/resourcebuilder_p.h b/src/designer/src/lib/uilib/resourcebuilder_p.h
new file mode 100644
index 000000000..ca699a05f
--- /dev/null
+++ b/src/designer/src/lib/uilib/resourcebuilder_p.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef RESOURCEBUILDER_H
+#define RESOURCEBUILDER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "uilib_global.h"
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+class QDir;
+class QVariant;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class DomProperty;
+class DomResourceIcon;
+
+class QDESIGNER_UILIB_EXPORT QResourceBuilder
+{
+public:
+ enum IconStateFlags {
+ NormalOff = 0x1, NormalOn = 0x2, DisabledOff = 0x4, DisabledOn = 0x8,
+ ActiveOff = 0x10, ActiveOn = 0x20, SelectedOff = 0x40, SelectedOn = 0x80
+ };
+
+ QResourceBuilder();
+ virtual ~QResourceBuilder();
+
+ virtual QVariant loadResource(const QDir &workingDirectory, const DomProperty *property) const;
+
+ virtual QVariant toNativeValue(const QVariant &value) const;
+
+ virtual DomProperty *saveResource(const QDir &workingDirectory, const QVariant &value) const;
+
+ virtual bool isResourceProperty(const DomProperty *p) const;
+
+ virtual bool isResourceType(const QVariant &value) const;
+
+ static int iconStateFlags(const DomResourceIcon *resIcon);
+};
+
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // RESOURCEBUILDER_H
diff --git a/src/designer/src/lib/uilib/textbuilder.cpp b/src/designer/src/lib/uilib/textbuilder.cpp
new file mode 100644
index 000000000..d9d2ac3b1
--- /dev/null
+++ b/src/designer/src/lib/uilib/textbuilder.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "textbuilder_p.h"
+#include "ui4_p.h"
+#include <QtCore/QVariant>
+
+QT_BEGIN_NAMESPACE
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal {
+#endif
+
+QTextBuilder::QTextBuilder()
+{
+
+}
+
+QTextBuilder::~QTextBuilder()
+{
+
+}
+
+QVariant QTextBuilder::loadText(const DomProperty *property) const
+{
+ if (property->kind() == DomProperty::String)
+ return property->elementString()->text();
+ return QVariant();
+}
+
+QVariant QTextBuilder::toNativeValue(const QVariant &value) const
+{
+ return value;
+}
+
+DomProperty *QTextBuilder::saveText(const QVariant &value) const
+{
+ Q_UNUSED(value)
+ return 0;
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+} // namespace QFormInternal
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/designer/src/lib/uilib/textbuilder_p.h b/src/designer/src/lib/uilib/textbuilder_p.h
new file mode 100644
index 000000000..bef4a64f0
--- /dev/null
+++ b/src/designer/src/lib/uilib/textbuilder_p.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TEXTBUILDER_H
+#define TEXTBUILDER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "uilib_global.h"
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+class QDir;
+class QVariant;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class DomProperty;
+class DomString;
+
+class QDESIGNER_UILIB_EXPORT QTextBuilder
+{
+public:
+ QTextBuilder();
+ virtual ~QTextBuilder();
+
+ virtual QVariant loadText(const DomProperty *property) const;
+
+ virtual QVariant toNativeValue(const QVariant &value) const;
+
+ virtual DomProperty *saveText(const QVariant &value) const;
+};
+
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // TEXTBUILDER_H
diff --git a/src/designer/src/lib/uilib/ui4.cpp b/src/designer/src/lib/uilib/ui4.cpp
new file mode 100644
index 000000000..5c232c862
--- /dev/null
+++ b/src/designer/src/lib/uilib/ui4.cpp
@@ -0,0 +1,8907 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "ui4_p.h"
+
+
+QT_BEGIN_NAMESPACE
+#ifdef QFORMINTERNAL_NAMESPACE
+using namespace QFormInternal;
+#endif
+
+/*******************************************************************************
+** Implementations
+*/
+
+void DomUI::clear(bool clear_all)
+{
+ delete m_widget;
+ delete m_layoutDefault;
+ delete m_layoutFunction;
+ delete m_customWidgets;
+ delete m_tabStops;
+ delete m_images;
+ delete m_includes;
+ delete m_resources;
+ delete m_connections;
+ delete m_designerdata;
+ delete m_slots;
+ delete m_buttonGroups;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_version = false;
+ m_has_attr_language = false;
+ m_has_attr_displayname = false;
+ m_has_attr_stdsetdef = false;
+ m_attr_stdsetdef = 0;
+ m_has_attr_stdSetDef = false;
+ m_attr_stdSetDef = 0;
+ }
+
+ m_children = 0;
+ m_widget = 0;
+ m_layoutDefault = 0;
+ m_layoutFunction = 0;
+ m_customWidgets = 0;
+ m_tabStops = 0;
+ m_images = 0;
+ m_includes = 0;
+ m_resources = 0;
+ m_connections = 0;
+ m_designerdata = 0;
+ m_slots = 0;
+ m_buttonGroups = 0;
+}
+
+DomUI::DomUI()
+{
+ m_children = 0;
+ m_has_attr_version = false;
+ m_has_attr_language = false;
+ m_has_attr_displayname = false;
+ m_has_attr_stdsetdef = false;
+ m_attr_stdsetdef = 0;
+ m_has_attr_stdSetDef = false;
+ m_attr_stdSetDef = 0;
+ m_widget = 0;
+ m_layoutDefault = 0;
+ m_layoutFunction = 0;
+ m_customWidgets = 0;
+ m_tabStops = 0;
+ m_images = 0;
+ m_includes = 0;
+ m_resources = 0;
+ m_connections = 0;
+ m_designerdata = 0;
+ m_slots = 0;
+ m_buttonGroups = 0;
+}
+
+DomUI::~DomUI()
+{
+ delete m_widget;
+ delete m_layoutDefault;
+ delete m_layoutFunction;
+ delete m_customWidgets;
+ delete m_tabStops;
+ delete m_images;
+ delete m_includes;
+ delete m_resources;
+ delete m_connections;
+ delete m_designerdata;
+ delete m_slots;
+ delete m_buttonGroups;
+}
+
+void DomUI::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("version")) {
+ setAttributeVersion(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("language")) {
+ setAttributeLanguage(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("displayname")) {
+ setAttributeDisplayname(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("stdsetdef")) {
+ setAttributeStdsetdef(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("stdSetDef")) {
+ setAttributeStdSetDef(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("author")) {
+ setElementAuthor(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("comment")) {
+ setElementComment(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("exportmacro")) {
+ setElementExportMacro(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("class")) {
+ setElementClass(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("widget")) {
+ DomWidget *v = new DomWidget();
+ v->read(reader);
+ setElementWidget(v);
+ continue;
+ }
+ if (tag == QStringLiteral("layoutdefault")) {
+ DomLayoutDefault *v = new DomLayoutDefault();
+ v->read(reader);
+ setElementLayoutDefault(v);
+ continue;
+ }
+ if (tag == QStringLiteral("layoutfunction")) {
+ DomLayoutFunction *v = new DomLayoutFunction();
+ v->read(reader);
+ setElementLayoutFunction(v);
+ continue;
+ }
+ if (tag == QStringLiteral("pixmapfunction")) {
+ setElementPixmapFunction(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("customwidgets")) {
+ DomCustomWidgets *v = new DomCustomWidgets();
+ v->read(reader);
+ setElementCustomWidgets(v);
+ continue;
+ }
+ if (tag == QStringLiteral("tabstops")) {
+ DomTabStops *v = new DomTabStops();
+ v->read(reader);
+ setElementTabStops(v);
+ continue;
+ }
+ if (tag == QStringLiteral("images")) {
+ DomImages *v = new DomImages();
+ v->read(reader);
+ setElementImages(v);
+ continue;
+ }
+ if (tag == QStringLiteral("includes")) {
+ DomIncludes *v = new DomIncludes();
+ v->read(reader);
+ setElementIncludes(v);
+ continue;
+ }
+ if (tag == QStringLiteral("resources")) {
+ DomResources *v = new DomResources();
+ v->read(reader);
+ setElementResources(v);
+ continue;
+ }
+ if (tag == QStringLiteral("connections")) {
+ DomConnections *v = new DomConnections();
+ v->read(reader);
+ setElementConnections(v);
+ continue;
+ }
+ if (tag == QStringLiteral("designerdata")) {
+ DomDesignerData *v = new DomDesignerData();
+ v->read(reader);
+ setElementDesignerdata(v);
+ continue;
+ }
+ if (tag == QStringLiteral("slots")) {
+ DomSlots *v = new DomSlots();
+ v->read(reader);
+ setElementSlots(v);
+ continue;
+ }
+ if (tag == QStringLiteral("buttongroups")) {
+ DomButtonGroups *v = new DomButtonGroups();
+ v->read(reader);
+ setElementButtonGroups(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("ui") : tagName.toLower());
+
+ if (hasAttributeVersion())
+ writer.writeAttribute(QStringLiteral("version"), attributeVersion());
+
+ if (hasAttributeLanguage())
+ writer.writeAttribute(QStringLiteral("language"), attributeLanguage());
+
+ if (hasAttributeDisplayname())
+ writer.writeAttribute(QStringLiteral("displayname"), attributeDisplayname());
+
+ if (hasAttributeStdsetdef())
+ writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdsetdef()));
+
+ if (hasAttributeStdSetDef())
+ writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdSetDef()));
+
+ if (m_children & Author) {
+ writer.writeTextElement(QStringLiteral("author"), m_author);
+ }
+
+ if (m_children & Comment) {
+ writer.writeTextElement(QStringLiteral("comment"), m_comment);
+ }
+
+ if (m_children & ExportMacro) {
+ writer.writeTextElement(QStringLiteral("exportmacro"), m_exportMacro);
+ }
+
+ if (m_children & Class) {
+ writer.writeTextElement(QStringLiteral("class"), m_class);
+ }
+
+ if (m_children & Widget) {
+ m_widget->write(writer, QStringLiteral("widget"));
+ }
+
+ if (m_children & LayoutDefault) {
+ m_layoutDefault->write(writer, QStringLiteral("layoutdefault"));
+ }
+
+ if (m_children & LayoutFunction) {
+ m_layoutFunction->write(writer, QStringLiteral("layoutfunction"));
+ }
+
+ if (m_children & PixmapFunction) {
+ writer.writeTextElement(QStringLiteral("pixmapfunction"), m_pixmapFunction);
+ }
+
+ if (m_children & CustomWidgets) {
+ m_customWidgets->write(writer, QStringLiteral("customwidgets"));
+ }
+
+ if (m_children & TabStops) {
+ m_tabStops->write(writer, QStringLiteral("tabstops"));
+ }
+
+ if (m_children & Images) {
+ m_images->write(writer, QStringLiteral("images"));
+ }
+
+ if (m_children & Includes) {
+ m_includes->write(writer, QStringLiteral("includes"));
+ }
+
+ if (m_children & Resources) {
+ m_resources->write(writer, QStringLiteral("resources"));
+ }
+
+ if (m_children & Connections) {
+ m_connections->write(writer, QStringLiteral("connections"));
+ }
+
+ if (m_children & Designerdata) {
+ m_designerdata->write(writer, QStringLiteral("designerdata"));
+ }
+
+ if (m_children & Slots) {
+ m_slots->write(writer, QStringLiteral("slots"));
+ }
+
+ if (m_children & ButtonGroups) {
+ m_buttonGroups->write(writer, QStringLiteral("buttongroups"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomUI::setElementAuthor(const QString& a)
+{
+ m_children |= Author;
+ m_author = a;
+}
+
+void DomUI::setElementComment(const QString& a)
+{
+ m_children |= Comment;
+ m_comment = a;
+}
+
+void DomUI::setElementExportMacro(const QString& a)
+{
+ m_children |= ExportMacro;
+ m_exportMacro = a;
+}
+
+void DomUI::setElementClass(const QString& a)
+{
+ m_children |= Class;
+ m_class = a;
+}
+
+DomWidget* DomUI::takeElementWidget()
+{
+ DomWidget* a = m_widget;
+ m_widget = 0;
+ m_children ^= Widget;
+ return a;
+}
+
+void DomUI::setElementWidget(DomWidget* a)
+{
+ delete m_widget;
+ m_children |= Widget;
+ m_widget = a;
+}
+
+DomLayoutDefault* DomUI::takeElementLayoutDefault()
+{
+ DomLayoutDefault* a = m_layoutDefault;
+ m_layoutDefault = 0;
+ m_children ^= LayoutDefault;
+ return a;
+}
+
+void DomUI::setElementLayoutDefault(DomLayoutDefault* a)
+{
+ delete m_layoutDefault;
+ m_children |= LayoutDefault;
+ m_layoutDefault = a;
+}
+
+DomLayoutFunction* DomUI::takeElementLayoutFunction()
+{
+ DomLayoutFunction* a = m_layoutFunction;
+ m_layoutFunction = 0;
+ m_children ^= LayoutFunction;
+ return a;
+}
+
+void DomUI::setElementLayoutFunction(DomLayoutFunction* a)
+{
+ delete m_layoutFunction;
+ m_children |= LayoutFunction;
+ m_layoutFunction = a;
+}
+
+void DomUI::setElementPixmapFunction(const QString& a)
+{
+ m_children |= PixmapFunction;
+ m_pixmapFunction = a;
+}
+
+DomCustomWidgets* DomUI::takeElementCustomWidgets()
+{
+ DomCustomWidgets* a = m_customWidgets;
+ m_customWidgets = 0;
+ m_children ^= CustomWidgets;
+ return a;
+}
+
+void DomUI::setElementCustomWidgets(DomCustomWidgets* a)
+{
+ delete m_customWidgets;
+ m_children |= CustomWidgets;
+ m_customWidgets = a;
+}
+
+DomTabStops* DomUI::takeElementTabStops()
+{
+ DomTabStops* a = m_tabStops;
+ m_tabStops = 0;
+ m_children ^= TabStops;
+ return a;
+}
+
+void DomUI::setElementTabStops(DomTabStops* a)
+{
+ delete m_tabStops;
+ m_children |= TabStops;
+ m_tabStops = a;
+}
+
+DomImages* DomUI::takeElementImages()
+{
+ DomImages* a = m_images;
+ m_images = 0;
+ m_children ^= Images;
+ return a;
+}
+
+void DomUI::setElementImages(DomImages* a)
+{
+ delete m_images;
+ m_children |= Images;
+ m_images = a;
+}
+
+DomIncludes* DomUI::takeElementIncludes()
+{
+ DomIncludes* a = m_includes;
+ m_includes = 0;
+ m_children ^= Includes;
+ return a;
+}
+
+void DomUI::setElementIncludes(DomIncludes* a)
+{
+ delete m_includes;
+ m_children |= Includes;
+ m_includes = a;
+}
+
+DomResources* DomUI::takeElementResources()
+{
+ DomResources* a = m_resources;
+ m_resources = 0;
+ m_children ^= Resources;
+ return a;
+}
+
+void DomUI::setElementResources(DomResources* a)
+{
+ delete m_resources;
+ m_children |= Resources;
+ m_resources = a;
+}
+
+DomConnections* DomUI::takeElementConnections()
+{
+ DomConnections* a = m_connections;
+ m_connections = 0;
+ m_children ^= Connections;
+ return a;
+}
+
+void DomUI::setElementConnections(DomConnections* a)
+{
+ delete m_connections;
+ m_children |= Connections;
+ m_connections = a;
+}
+
+DomDesignerData* DomUI::takeElementDesignerdata()
+{
+ DomDesignerData* a = m_designerdata;
+ m_designerdata = 0;
+ m_children ^= Designerdata;
+ return a;
+}
+
+void DomUI::setElementDesignerdata(DomDesignerData* a)
+{
+ delete m_designerdata;
+ m_children |= Designerdata;
+ m_designerdata = a;
+}
+
+DomSlots* DomUI::takeElementSlots()
+{
+ DomSlots* a = m_slots;
+ m_slots = 0;
+ m_children ^= Slots;
+ return a;
+}
+
+void DomUI::setElementSlots(DomSlots* a)
+{
+ delete m_slots;
+ m_children |= Slots;
+ m_slots = a;
+}
+
+DomButtonGroups* DomUI::takeElementButtonGroups()
+{
+ DomButtonGroups* a = m_buttonGroups;
+ m_buttonGroups = 0;
+ m_children ^= ButtonGroups;
+ return a;
+}
+
+void DomUI::setElementButtonGroups(DomButtonGroups* a)
+{
+ delete m_buttonGroups;
+ m_children |= ButtonGroups;
+ m_buttonGroups = a;
+}
+
+void DomUI::clearElementAuthor()
+{
+ m_children &= ~Author;
+}
+
+void DomUI::clearElementComment()
+{
+ m_children &= ~Comment;
+}
+
+void DomUI::clearElementExportMacro()
+{
+ m_children &= ~ExportMacro;
+}
+
+void DomUI::clearElementClass()
+{
+ m_children &= ~Class;
+}
+
+void DomUI::clearElementWidget()
+{
+ delete m_widget;
+ m_widget = 0;
+ m_children &= ~Widget;
+}
+
+void DomUI::clearElementLayoutDefault()
+{
+ delete m_layoutDefault;
+ m_layoutDefault = 0;
+ m_children &= ~LayoutDefault;
+}
+
+void DomUI::clearElementLayoutFunction()
+{
+ delete m_layoutFunction;
+ m_layoutFunction = 0;
+ m_children &= ~LayoutFunction;
+}
+
+void DomUI::clearElementPixmapFunction()
+{
+ m_children &= ~PixmapFunction;
+}
+
+void DomUI::clearElementCustomWidgets()
+{
+ delete m_customWidgets;
+ m_customWidgets = 0;
+ m_children &= ~CustomWidgets;
+}
+
+void DomUI::clearElementTabStops()
+{
+ delete m_tabStops;
+ m_tabStops = 0;
+ m_children &= ~TabStops;
+}
+
+void DomUI::clearElementImages()
+{
+ delete m_images;
+ m_images = 0;
+ m_children &= ~Images;
+}
+
+void DomUI::clearElementIncludes()
+{
+ delete m_includes;
+ m_includes = 0;
+ m_children &= ~Includes;
+}
+
+void DomUI::clearElementResources()
+{
+ delete m_resources;
+ m_resources = 0;
+ m_children &= ~Resources;
+}
+
+void DomUI::clearElementConnections()
+{
+ delete m_connections;
+ m_connections = 0;
+ m_children &= ~Connections;
+}
+
+void DomUI::clearElementDesignerdata()
+{
+ delete m_designerdata;
+ m_designerdata = 0;
+ m_children &= ~Designerdata;
+}
+
+void DomUI::clearElementSlots()
+{
+ delete m_slots;
+ m_slots = 0;
+ m_children &= ~Slots;
+}
+
+void DomUI::clearElementButtonGroups()
+{
+ delete m_buttonGroups;
+ m_buttonGroups = 0;
+ m_children &= ~ButtonGroups;
+}
+
+void DomIncludes::clear(bool clear_all)
+{
+ qDeleteAll(m_include);
+ m_include.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomIncludes::DomIncludes()
+{
+ m_children = 0;
+}
+
+DomIncludes::~DomIncludes()
+{
+ qDeleteAll(m_include);
+ m_include.clear();
+}
+
+void DomIncludes::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("include")) {
+ DomInclude *v = new DomInclude();
+ v->read(reader);
+ m_include.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomIncludes::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("includes") : tagName.toLower());
+
+ for (int i = 0; i < m_include.size(); ++i) {
+ DomInclude* v = m_include[i];
+ v->write(writer, QStringLiteral("include"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomIncludes::setElementInclude(const QList<DomInclude*>& a)
+{
+ m_children |= Include;
+ m_include = a;
+}
+
+void DomInclude::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_location = false;
+ m_has_attr_impldecl = false;
+ }
+
+ m_children = 0;
+}
+
+DomInclude::DomInclude()
+{
+ m_children = 0;
+ m_has_attr_location = false;
+ m_has_attr_impldecl = false;
+ m_text.clear();
+}
+
+DomInclude::~DomInclude()
+{
+}
+
+void DomInclude::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("location")) {
+ setAttributeLocation(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("impldecl")) {
+ setAttributeImpldecl(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomInclude::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("include") : tagName.toLower());
+
+ if (hasAttributeLocation())
+ writer.writeAttribute(QStringLiteral("location"), attributeLocation());
+
+ if (hasAttributeImpldecl())
+ writer.writeAttribute(QStringLiteral("impldecl"), attributeImpldecl());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomResources::clear(bool clear_all)
+{
+ qDeleteAll(m_include);
+ m_include.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+}
+
+DomResources::DomResources()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+}
+
+DomResources::~DomResources()
+{
+ qDeleteAll(m_include);
+ m_include.clear();
+}
+
+void DomResources::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("include")) {
+ DomResource *v = new DomResource();
+ v->read(reader);
+ m_include.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomResources::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resources") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ for (int i = 0; i < m_include.size(); ++i) {
+ DomResource* v = m_include[i];
+ v->write(writer, QStringLiteral("include"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomResources::setElementInclude(const QList<DomResource*>& a)
+{
+ m_children |= Include;
+ m_include = a;
+}
+
+void DomResource::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_location = false;
+ }
+
+ m_children = 0;
+}
+
+DomResource::DomResource()
+{
+ m_children = 0;
+ m_has_attr_location = false;
+}
+
+DomResource::~DomResource()
+{
+}
+
+void DomResource::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("location")) {
+ setAttributeLocation(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomResource::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resource") : tagName.toLower());
+
+ if (hasAttributeLocation())
+ writer.writeAttribute(QStringLiteral("location"), attributeLocation());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomActionGroup::clear(bool clear_all)
+{
+ qDeleteAll(m_action);
+ m_action.clear();
+ qDeleteAll(m_actionGroup);
+ m_actionGroup.clear();
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+}
+
+DomActionGroup::DomActionGroup()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+}
+
+DomActionGroup::~DomActionGroup()
+{
+ qDeleteAll(m_action);
+ m_action.clear();
+ qDeleteAll(m_actionGroup);
+ m_actionGroup.clear();
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+}
+
+void DomActionGroup::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("action")) {
+ DomAction *v = new DomAction();
+ v->read(reader);
+ m_action.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("actiongroup")) {
+ DomActionGroup *v = new DomActionGroup();
+ v->read(reader);
+ m_actionGroup.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("attribute")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_attribute.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomActionGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actiongroup") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ for (int i = 0; i < m_action.size(); ++i) {
+ DomAction* v = m_action[i];
+ v->write(writer, QStringLiteral("action"));
+ }
+ for (int i = 0; i < m_actionGroup.size(); ++i) {
+ DomActionGroup* v = m_actionGroup[i];
+ v->write(writer, QStringLiteral("actiongroup"));
+ }
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_attribute.size(); ++i) {
+ DomProperty* v = m_attribute[i];
+ v->write(writer, QStringLiteral("attribute"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomActionGroup::setElementAction(const QList<DomAction*>& a)
+{
+ m_children |= Action;
+ m_action = a;
+}
+
+void DomActionGroup::setElementActionGroup(const QList<DomActionGroup*>& a)
+{
+ m_children |= ActionGroup;
+ m_actionGroup = a;
+}
+
+void DomActionGroup::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomActionGroup::setElementAttribute(const QList<DomProperty*>& a)
+{
+ m_children |= Attribute;
+ m_attribute = a;
+}
+
+void DomAction::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ m_has_attr_menu = false;
+ }
+
+ m_children = 0;
+}
+
+DomAction::DomAction()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+ m_has_attr_menu = false;
+}
+
+DomAction::~DomAction()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+}
+
+void DomAction::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("menu")) {
+ setAttributeMenu(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("attribute")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_attribute.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomAction::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("action") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (hasAttributeMenu())
+ writer.writeAttribute(QStringLiteral("menu"), attributeMenu());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_attribute.size(); ++i) {
+ DomProperty* v = m_attribute[i];
+ v->write(writer, QStringLiteral("attribute"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomAction::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomAction::setElementAttribute(const QList<DomProperty*>& a)
+{
+ m_children |= Attribute;
+ m_attribute = a;
+}
+
+void DomActionRef::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+}
+
+DomActionRef::DomActionRef()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+}
+
+DomActionRef::~DomActionRef()
+{
+}
+
+void DomActionRef::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomActionRef::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actionref") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomButtonGroup::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+}
+
+DomButtonGroup::DomButtonGroup()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+}
+
+DomButtonGroup::~DomButtonGroup()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+}
+
+void DomButtonGroup::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("attribute")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_attribute.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomButtonGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroup") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_attribute.size(); ++i) {
+ DomProperty* v = m_attribute[i];
+ v->write(writer, QStringLiteral("attribute"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomButtonGroup::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomButtonGroup::setElementAttribute(const QList<DomProperty*>& a)
+{
+ m_children |= Attribute;
+ m_attribute = a;
+}
+
+void DomButtonGroups::clear(bool clear_all)
+{
+ qDeleteAll(m_buttonGroup);
+ m_buttonGroup.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomButtonGroups::DomButtonGroups()
+{
+ m_children = 0;
+}
+
+DomButtonGroups::~DomButtonGroups()
+{
+ qDeleteAll(m_buttonGroup);
+ m_buttonGroup.clear();
+}
+
+void DomButtonGroups::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("buttongroup")) {
+ DomButtonGroup *v = new DomButtonGroup();
+ v->read(reader);
+ m_buttonGroup.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomButtonGroups::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroups") : tagName.toLower());
+
+ for (int i = 0; i < m_buttonGroup.size(); ++i) {
+ DomButtonGroup* v = m_buttonGroup[i];
+ v->write(writer, QStringLiteral("buttongroup"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomButtonGroups::setElementButtonGroup(const QList<DomButtonGroup*>& a)
+{
+ m_children |= ButtonGroup;
+ m_buttonGroup = a;
+}
+
+void DomImages::clear(bool clear_all)
+{
+ qDeleteAll(m_image);
+ m_image.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomImages::DomImages()
+{
+ m_children = 0;
+}
+
+DomImages::~DomImages()
+{
+ qDeleteAll(m_image);
+ m_image.clear();
+}
+
+void DomImages::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("image")) {
+ DomImage *v = new DomImage();
+ v->read(reader);
+ m_image.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomImages::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("images") : tagName.toLower());
+
+ for (int i = 0; i < m_image.size(); ++i) {
+ DomImage* v = m_image[i];
+ v->write(writer, QStringLiteral("image"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomImages::setElementImage(const QList<DomImage*>& a)
+{
+ m_children |= Image;
+ m_image = a;
+}
+
+void DomImage::clear(bool clear_all)
+{
+ delete m_data;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+ m_data = 0;
+}
+
+DomImage::DomImage()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+ m_data = 0;
+}
+
+DomImage::~DomImage()
+{
+ delete m_data;
+}
+
+void DomImage::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("data")) {
+ DomImageData *v = new DomImageData();
+ v->read(reader);
+ setElementData(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomImage::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("image") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (m_children & Data) {
+ m_data->write(writer, QStringLiteral("data"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomImageData* DomImage::takeElementData()
+{
+ DomImageData* a = m_data;
+ m_data = 0;
+ m_children ^= Data;
+ return a;
+}
+
+void DomImage::setElementData(DomImageData* a)
+{
+ delete m_data;
+ m_children |= Data;
+ m_data = a;
+}
+
+void DomImage::clearElementData()
+{
+ delete m_data;
+ m_data = 0;
+ m_children &= ~Data;
+}
+
+void DomImageData::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_format = false;
+ m_has_attr_length = false;
+ m_attr_length = 0;
+ }
+
+ m_children = 0;
+}
+
+DomImageData::DomImageData()
+{
+ m_children = 0;
+ m_has_attr_format = false;
+ m_has_attr_length = false;
+ m_attr_length = 0;
+ m_text.clear();
+}
+
+DomImageData::~DomImageData()
+{
+}
+
+void DomImageData::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("format")) {
+ setAttributeFormat(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("length")) {
+ setAttributeLength(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomImageData::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("imagedata") : tagName.toLower());
+
+ if (hasAttributeFormat())
+ writer.writeAttribute(QStringLiteral("format"), attributeFormat());
+
+ if (hasAttributeLength())
+ writer.writeAttribute(QStringLiteral("length"), QString::number(attributeLength()));
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomCustomWidgets::clear(bool clear_all)
+{
+ qDeleteAll(m_customWidget);
+ m_customWidget.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomCustomWidgets::DomCustomWidgets()
+{
+ m_children = 0;
+}
+
+DomCustomWidgets::~DomCustomWidgets()
+{
+ qDeleteAll(m_customWidget);
+ m_customWidget.clear();
+}
+
+void DomCustomWidgets::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("customwidget")) {
+ DomCustomWidget *v = new DomCustomWidget();
+ v->read(reader);
+ m_customWidget.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomCustomWidgets::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidgets") : tagName.toLower());
+
+ for (int i = 0; i < m_customWidget.size(); ++i) {
+ DomCustomWidget* v = m_customWidget[i];
+ v->write(writer, QStringLiteral("customwidget"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomCustomWidgets::setElementCustomWidget(const QList<DomCustomWidget*>& a)
+{
+ m_children |= CustomWidget;
+ m_customWidget = a;
+}
+
+void DomHeader::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_location = false;
+ }
+
+ m_children = 0;
+}
+
+DomHeader::DomHeader()
+{
+ m_children = 0;
+ m_has_attr_location = false;
+ m_text.clear();
+}
+
+DomHeader::~DomHeader()
+{
+}
+
+void DomHeader::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("location")) {
+ setAttributeLocation(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomHeader::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("header") : tagName.toLower());
+
+ if (hasAttributeLocation())
+ writer.writeAttribute(QStringLiteral("location"), attributeLocation());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomCustomWidget::clear(bool clear_all)
+{
+ delete m_header;
+ delete m_sizeHint;
+ delete m_sizePolicy;
+ delete m_script;
+ delete m_properties;
+ delete m_slots;
+ delete m_propertyspecifications;
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_header = 0;
+ m_sizeHint = 0;
+ m_container = 0;
+ m_sizePolicy = 0;
+ m_script = 0;
+ m_properties = 0;
+ m_slots = 0;
+ m_propertyspecifications = 0;
+}
+
+DomCustomWidget::DomCustomWidget()
+{
+ m_children = 0;
+ m_header = 0;
+ m_sizeHint = 0;
+ m_container = 0;
+ m_sizePolicy = 0;
+ m_script = 0;
+ m_properties = 0;
+ m_slots = 0;
+ m_propertyspecifications = 0;
+}
+
+DomCustomWidget::~DomCustomWidget()
+{
+ delete m_header;
+ delete m_sizeHint;
+ delete m_sizePolicy;
+ delete m_script;
+ delete m_properties;
+ delete m_slots;
+ delete m_propertyspecifications;
+}
+
+void DomCustomWidget::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("class")) {
+ setElementClass(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("extends")) {
+ setElementExtends(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("header")) {
+ DomHeader *v = new DomHeader();
+ v->read(reader);
+ setElementHeader(v);
+ continue;
+ }
+ if (tag == QStringLiteral("sizehint")) {
+ DomSize *v = new DomSize();
+ v->read(reader);
+ setElementSizeHint(v);
+ continue;
+ }
+ if (tag == QStringLiteral("addpagemethod")) {
+ setElementAddPageMethod(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("container")) {
+ setElementContainer(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("sizepolicy")) {
+ DomSizePolicyData *v = new DomSizePolicyData();
+ v->read(reader);
+ setElementSizePolicy(v);
+ continue;
+ }
+ if (tag == QStringLiteral("pixmap")) {
+ setElementPixmap(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("script")) {
+ DomScript *v = new DomScript();
+ v->read(reader);
+ setElementScript(v);
+ continue;
+ }
+ if (tag == QStringLiteral("properties")) {
+ DomProperties *v = new DomProperties();
+ v->read(reader);
+ setElementProperties(v);
+ continue;
+ }
+ if (tag == QStringLiteral("slots")) {
+ DomSlots *v = new DomSlots();
+ v->read(reader);
+ setElementSlots(v);
+ continue;
+ }
+ if (tag == QStringLiteral("propertyspecifications")) {
+ DomPropertySpecifications *v = new DomPropertySpecifications();
+ v->read(reader);
+ setElementPropertyspecifications(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomCustomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidget") : tagName.toLower());
+
+ if (m_children & Class) {
+ writer.writeTextElement(QStringLiteral("class"), m_class);
+ }
+
+ if (m_children & Extends) {
+ writer.writeTextElement(QStringLiteral("extends"), m_extends);
+ }
+
+ if (m_children & Header) {
+ m_header->write(writer, QStringLiteral("header"));
+ }
+
+ if (m_children & SizeHint) {
+ m_sizeHint->write(writer, QStringLiteral("sizehint"));
+ }
+
+ if (m_children & AddPageMethod) {
+ writer.writeTextElement(QStringLiteral("addpagemethod"), m_addPageMethod);
+ }
+
+ if (m_children & Container) {
+ writer.writeTextElement(QStringLiteral("container"), QString::number(m_container));
+ }
+
+ if (m_children & SizePolicy) {
+ m_sizePolicy->write(writer, QStringLiteral("sizepolicy"));
+ }
+
+ if (m_children & Pixmap) {
+ writer.writeTextElement(QStringLiteral("pixmap"), m_pixmap);
+ }
+
+ if (m_children & Script) {
+ m_script->write(writer, QStringLiteral("script"));
+ }
+
+ if (m_children & Properties) {
+ m_properties->write(writer, QStringLiteral("properties"));
+ }
+
+ if (m_children & Slots) {
+ m_slots->write(writer, QStringLiteral("slots"));
+ }
+
+ if (m_children & Propertyspecifications) {
+ m_propertyspecifications->write(writer, QStringLiteral("propertyspecifications"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomCustomWidget::setElementClass(const QString& a)
+{
+ m_children |= Class;
+ m_class = a;
+}
+
+void DomCustomWidget::setElementExtends(const QString& a)
+{
+ m_children |= Extends;
+ m_extends = a;
+}
+
+DomHeader* DomCustomWidget::takeElementHeader()
+{
+ DomHeader* a = m_header;
+ m_header = 0;
+ m_children ^= Header;
+ return a;
+}
+
+void DomCustomWidget::setElementHeader(DomHeader* a)
+{
+ delete m_header;
+ m_children |= Header;
+ m_header = a;
+}
+
+DomSize* DomCustomWidget::takeElementSizeHint()
+{
+ DomSize* a = m_sizeHint;
+ m_sizeHint = 0;
+ m_children ^= SizeHint;
+ return a;
+}
+
+void DomCustomWidget::setElementSizeHint(DomSize* a)
+{
+ delete m_sizeHint;
+ m_children |= SizeHint;
+ m_sizeHint = a;
+}
+
+void DomCustomWidget::setElementAddPageMethod(const QString& a)
+{
+ m_children |= AddPageMethod;
+ m_addPageMethod = a;
+}
+
+void DomCustomWidget::setElementContainer(int a)
+{
+ m_children |= Container;
+ m_container = a;
+}
+
+DomSizePolicyData* DomCustomWidget::takeElementSizePolicy()
+{
+ DomSizePolicyData* a = m_sizePolicy;
+ m_sizePolicy = 0;
+ m_children ^= SizePolicy;
+ return a;
+}
+
+void DomCustomWidget::setElementSizePolicy(DomSizePolicyData* a)
+{
+ delete m_sizePolicy;
+ m_children |= SizePolicy;
+ m_sizePolicy = a;
+}
+
+void DomCustomWidget::setElementPixmap(const QString& a)
+{
+ m_children |= Pixmap;
+ m_pixmap = a;
+}
+
+DomScript* DomCustomWidget::takeElementScript()
+{
+ DomScript* a = m_script;
+ m_script = 0;
+ m_children ^= Script;
+ return a;
+}
+
+void DomCustomWidget::setElementScript(DomScript* a)
+{
+ delete m_script;
+ m_children |= Script;
+ m_script = a;
+}
+
+DomProperties* DomCustomWidget::takeElementProperties()
+{
+ DomProperties* a = m_properties;
+ m_properties = 0;
+ m_children ^= Properties;
+ return a;
+}
+
+void DomCustomWidget::setElementProperties(DomProperties* a)
+{
+ delete m_properties;
+ m_children |= Properties;
+ m_properties = a;
+}
+
+DomSlots* DomCustomWidget::takeElementSlots()
+{
+ DomSlots* a = m_slots;
+ m_slots = 0;
+ m_children ^= Slots;
+ return a;
+}
+
+void DomCustomWidget::setElementSlots(DomSlots* a)
+{
+ delete m_slots;
+ m_children |= Slots;
+ m_slots = a;
+}
+
+DomPropertySpecifications* DomCustomWidget::takeElementPropertyspecifications()
+{
+ DomPropertySpecifications* a = m_propertyspecifications;
+ m_propertyspecifications = 0;
+ m_children ^= Propertyspecifications;
+ return a;
+}
+
+void DomCustomWidget::setElementPropertyspecifications(DomPropertySpecifications* a)
+{
+ delete m_propertyspecifications;
+ m_children |= Propertyspecifications;
+ m_propertyspecifications = a;
+}
+
+void DomCustomWidget::clearElementClass()
+{
+ m_children &= ~Class;
+}
+
+void DomCustomWidget::clearElementExtends()
+{
+ m_children &= ~Extends;
+}
+
+void DomCustomWidget::clearElementHeader()
+{
+ delete m_header;
+ m_header = 0;
+ m_children &= ~Header;
+}
+
+void DomCustomWidget::clearElementSizeHint()
+{
+ delete m_sizeHint;
+ m_sizeHint = 0;
+ m_children &= ~SizeHint;
+}
+
+void DomCustomWidget::clearElementAddPageMethod()
+{
+ m_children &= ~AddPageMethod;
+}
+
+void DomCustomWidget::clearElementContainer()
+{
+ m_children &= ~Container;
+}
+
+void DomCustomWidget::clearElementSizePolicy()
+{
+ delete m_sizePolicy;
+ m_sizePolicy = 0;
+ m_children &= ~SizePolicy;
+}
+
+void DomCustomWidget::clearElementPixmap()
+{
+ m_children &= ~Pixmap;
+}
+
+void DomCustomWidget::clearElementScript()
+{
+ delete m_script;
+ m_script = 0;
+ m_children &= ~Script;
+}
+
+void DomCustomWidget::clearElementProperties()
+{
+ delete m_properties;
+ m_properties = 0;
+ m_children &= ~Properties;
+}
+
+void DomCustomWidget::clearElementSlots()
+{
+ delete m_slots;
+ m_slots = 0;
+ m_children &= ~Slots;
+}
+
+void DomCustomWidget::clearElementPropertyspecifications()
+{
+ delete m_propertyspecifications;
+ m_propertyspecifications = 0;
+ m_children &= ~Propertyspecifications;
+}
+
+void DomProperties::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomProperties::DomProperties()
+{
+ m_children = 0;
+}
+
+DomProperties::~DomProperties()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomProperties::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomPropertyData *v = new DomPropertyData();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomProperties::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("properties") : tagName.toLower());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomPropertyData* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomProperties::setElementProperty(const QList<DomPropertyData*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomPropertyData::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_type = false;
+ }
+
+ m_children = 0;
+}
+
+DomPropertyData::DomPropertyData()
+{
+ m_children = 0;
+ m_has_attr_type = false;
+}
+
+DomPropertyData::~DomPropertyData()
+{
+}
+
+void DomPropertyData::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("type")) {
+ setAttributeType(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomPropertyData::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertydata") : tagName.toLower());
+
+ if (hasAttributeType())
+ writer.writeAttribute(QStringLiteral("type"), attributeType());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSizePolicyData::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_horData = 0;
+ m_verData = 0;
+}
+
+DomSizePolicyData::DomSizePolicyData()
+{
+ m_children = 0;
+ m_horData = 0;
+ m_verData = 0;
+}
+
+DomSizePolicyData::~DomSizePolicyData()
+{
+}
+
+void DomSizePolicyData::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("hordata")) {
+ setElementHorData(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("verdata")) {
+ setElementVerData(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSizePolicyData::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicydata") : tagName.toLower());
+
+ if (m_children & HorData) {
+ writer.writeTextElement(QStringLiteral("hordata"), QString::number(m_horData));
+ }
+
+ if (m_children & VerData) {
+ writer.writeTextElement(QStringLiteral("verdata"), QString::number(m_verData));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSizePolicyData::setElementHorData(int a)
+{
+ m_children |= HorData;
+ m_horData = a;
+}
+
+void DomSizePolicyData::setElementVerData(int a)
+{
+ m_children |= VerData;
+ m_verData = a;
+}
+
+void DomSizePolicyData::clearElementHorData()
+{
+ m_children &= ~HorData;
+}
+
+void DomSizePolicyData::clearElementVerData()
+{
+ m_children &= ~VerData;
+}
+
+void DomLayoutDefault::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_spacing = false;
+ m_attr_spacing = 0;
+ m_has_attr_margin = false;
+ m_attr_margin = 0;
+ }
+
+ m_children = 0;
+}
+
+DomLayoutDefault::DomLayoutDefault()
+{
+ m_children = 0;
+ m_has_attr_spacing = false;
+ m_attr_spacing = 0;
+ m_has_attr_margin = false;
+ m_attr_margin = 0;
+}
+
+DomLayoutDefault::~DomLayoutDefault()
+{
+}
+
+void DomLayoutDefault::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("spacing")) {
+ setAttributeSpacing(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("margin")) {
+ setAttributeMargin(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomLayoutDefault::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutdefault") : tagName.toLower());
+
+ if (hasAttributeSpacing())
+ writer.writeAttribute(QStringLiteral("spacing"), QString::number(attributeSpacing()));
+
+ if (hasAttributeMargin())
+ writer.writeAttribute(QStringLiteral("margin"), QString::number(attributeMargin()));
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomLayoutFunction::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_spacing = false;
+ m_has_attr_margin = false;
+ }
+
+ m_children = 0;
+}
+
+DomLayoutFunction::DomLayoutFunction()
+{
+ m_children = 0;
+ m_has_attr_spacing = false;
+ m_has_attr_margin = false;
+}
+
+DomLayoutFunction::~DomLayoutFunction()
+{
+}
+
+void DomLayoutFunction::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("spacing")) {
+ setAttributeSpacing(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("margin")) {
+ setAttributeMargin(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomLayoutFunction::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutfunction") : tagName.toLower());
+
+ if (hasAttributeSpacing())
+ writer.writeAttribute(QStringLiteral("spacing"), attributeSpacing());
+
+ if (hasAttributeMargin())
+ writer.writeAttribute(QStringLiteral("margin"), attributeMargin());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomTabStops::clear(bool clear_all)
+{
+ m_tabStop.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomTabStops::DomTabStops()
+{
+ m_children = 0;
+}
+
+DomTabStops::~DomTabStops()
+{
+ m_tabStop.clear();
+}
+
+void DomTabStops::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("tabstop")) {
+ m_tabStop.append(reader.readElementText());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomTabStops::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("tabstops") : tagName.toLower());
+
+ for (int i = 0; i < m_tabStop.size(); ++i) {
+ QString v = m_tabStop[i];
+ writer.writeTextElement(QStringLiteral("tabstop"), v);
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomTabStops::setElementTabStop(const QStringList& a)
+{
+ m_children |= TabStop;
+ m_tabStop = a;
+}
+
+void DomLayout::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_class = false;
+ m_has_attr_name = false;
+ m_has_attr_stretch = false;
+ m_has_attr_rowStretch = false;
+ m_has_attr_columnStretch = false;
+ m_has_attr_rowMinimumHeight = false;
+ m_has_attr_columnMinimumWidth = false;
+ }
+
+ m_children = 0;
+}
+
+DomLayout::DomLayout()
+{
+ m_children = 0;
+ m_has_attr_class = false;
+ m_has_attr_name = false;
+ m_has_attr_stretch = false;
+ m_has_attr_rowStretch = false;
+ m_has_attr_columnStretch = false;
+ m_has_attr_rowMinimumHeight = false;
+ m_has_attr_columnMinimumWidth = false;
+}
+
+DomLayout::~DomLayout()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+}
+
+void DomLayout::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("class")) {
+ setAttributeClass(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("stretch")) {
+ setAttributeStretch(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("rowstretch")) {
+ setAttributeRowStretch(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("columnstretch")) {
+ setAttributeColumnStretch(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("rowminimumheight")) {
+ setAttributeRowMinimumHeight(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("columnminimumwidth")) {
+ setAttributeColumnMinimumWidth(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("attribute")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_attribute.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("item")) {
+ DomLayoutItem *v = new DomLayoutItem();
+ v->read(reader);
+ m_item.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomLayout::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layout") : tagName.toLower());
+
+ if (hasAttributeClass())
+ writer.writeAttribute(QStringLiteral("class"), attributeClass());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (hasAttributeStretch())
+ writer.writeAttribute(QStringLiteral("stretch"), attributeStretch());
+
+ if (hasAttributeRowStretch())
+ writer.writeAttribute(QStringLiteral("rowstretch"), attributeRowStretch());
+
+ if (hasAttributeColumnStretch())
+ writer.writeAttribute(QStringLiteral("columnstretch"), attributeColumnStretch());
+
+ if (hasAttributeRowMinimumHeight())
+ writer.writeAttribute(QStringLiteral("rowminimumheight"), attributeRowMinimumHeight());
+
+ if (hasAttributeColumnMinimumWidth())
+ writer.writeAttribute(QStringLiteral("columnminimumwidth"), attributeColumnMinimumWidth());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_attribute.size(); ++i) {
+ DomProperty* v = m_attribute[i];
+ v->write(writer, QStringLiteral("attribute"));
+ }
+ for (int i = 0; i < m_item.size(); ++i) {
+ DomLayoutItem* v = m_item[i];
+ v->write(writer, QStringLiteral("item"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomLayout::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomLayout::setElementAttribute(const QList<DomProperty*>& a)
+{
+ m_children |= Attribute;
+ m_attribute = a;
+}
+
+void DomLayout::setElementItem(const QList<DomLayoutItem*>& a)
+{
+ m_children |= Item;
+ m_item = a;
+}
+
+void DomLayoutItem::clear(bool clear_all)
+{
+ delete m_widget;
+ delete m_layout;
+ delete m_spacer;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_row = false;
+ m_attr_row = 0;
+ m_has_attr_column = false;
+ m_attr_column = 0;
+ m_has_attr_rowSpan = false;
+ m_attr_rowSpan = 0;
+ m_has_attr_colSpan = false;
+ m_attr_colSpan = 0;
+ m_has_attr_alignment = false;
+ }
+
+ m_kind = Unknown;
+
+ m_widget = 0;
+ m_layout = 0;
+ m_spacer = 0;
+}
+
+DomLayoutItem::DomLayoutItem()
+{
+ m_kind = Unknown;
+
+ m_has_attr_row = false;
+ m_attr_row = 0;
+ m_has_attr_column = false;
+ m_attr_column = 0;
+ m_has_attr_rowSpan = false;
+ m_attr_rowSpan = 0;
+ m_has_attr_colSpan = false;
+ m_attr_colSpan = 0;
+ m_has_attr_alignment = false;
+ m_widget = 0;
+ m_layout = 0;
+ m_spacer = 0;
+}
+
+DomLayoutItem::~DomLayoutItem()
+{
+ delete m_widget;
+ delete m_layout;
+ delete m_spacer;
+}
+
+void DomLayoutItem::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("row")) {
+ setAttributeRow(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("column")) {
+ setAttributeColumn(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("rowspan")) {
+ setAttributeRowSpan(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("colspan")) {
+ setAttributeColSpan(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("alignment")) {
+ setAttributeAlignment(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("widget")) {
+ DomWidget *v = new DomWidget();
+ v->read(reader);
+ setElementWidget(v);
+ continue;
+ }
+ if (tag == QStringLiteral("layout")) {
+ DomLayout *v = new DomLayout();
+ v->read(reader);
+ setElementLayout(v);
+ continue;
+ }
+ if (tag == QStringLiteral("spacer")) {
+ DomSpacer *v = new DomSpacer();
+ v->read(reader);
+ setElementSpacer(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomLayoutItem::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutitem") : tagName.toLower());
+
+ if (hasAttributeRow())
+ writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow()));
+
+ if (hasAttributeColumn())
+ writer.writeAttribute(QStringLiteral("column"), QString::number(attributeColumn()));
+
+ if (hasAttributeRowSpan())
+ writer.writeAttribute(QStringLiteral("rowspan"), QString::number(attributeRowSpan()));
+
+ if (hasAttributeColSpan())
+ writer.writeAttribute(QStringLiteral("colspan"), QString::number(attributeColSpan()));
+
+ if (hasAttributeAlignment())
+ writer.writeAttribute(QStringLiteral("alignment"), attributeAlignment());
+
+ switch (kind()) {
+ case Widget: {
+ DomWidget* v = elementWidget();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("widget"));
+ }
+ break;
+ }
+ case Layout: {
+ DomLayout* v = elementLayout();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("layout"));
+ }
+ break;
+ }
+ case Spacer: {
+ DomSpacer* v = elementSpacer();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("spacer"));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomWidget* DomLayoutItem::takeElementWidget()
+{
+ DomWidget* a = m_widget;
+ m_widget = 0;
+ return a;
+}
+
+void DomLayoutItem::setElementWidget(DomWidget* a)
+{
+ clear(false);
+ m_kind = Widget;
+ m_widget = a;
+}
+
+DomLayout* DomLayoutItem::takeElementLayout()
+{
+ DomLayout* a = m_layout;
+ m_layout = 0;
+ return a;
+}
+
+void DomLayoutItem::setElementLayout(DomLayout* a)
+{
+ clear(false);
+ m_kind = Layout;
+ m_layout = a;
+}
+
+DomSpacer* DomLayoutItem::takeElementSpacer()
+{
+ DomSpacer* a = m_spacer;
+ m_spacer = 0;
+ return a;
+}
+
+void DomLayoutItem::setElementSpacer(DomSpacer* a)
+{
+ clear(false);
+ m_kind = Spacer;
+ m_spacer = a;
+}
+
+void DomRow::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomRow::DomRow()
+{
+ m_children = 0;
+}
+
+DomRow::~DomRow()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomRow::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomRow::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("row") : tagName.toLower());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomRow::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomColumn::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomColumn::DomColumn()
+{
+ m_children = 0;
+}
+
+DomColumn::~DomColumn()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomColumn::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomColumn::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("column") : tagName.toLower());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomColumn::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomItem::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_row = false;
+ m_attr_row = 0;
+ m_has_attr_column = false;
+ m_attr_column = 0;
+ }
+
+ m_children = 0;
+}
+
+DomItem::DomItem()
+{
+ m_children = 0;
+ m_has_attr_row = false;
+ m_attr_row = 0;
+ m_has_attr_column = false;
+ m_attr_column = 0;
+}
+
+DomItem::~DomItem()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+}
+
+void DomItem::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("row")) {
+ setAttributeRow(attribute.value().toString().toInt());
+ continue;
+ }
+ if (name == QStringLiteral("column")) {
+ setAttributeColumn(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("item")) {
+ DomItem *v = new DomItem();
+ v->read(reader);
+ m_item.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomItem::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("item") : tagName.toLower());
+
+ if (hasAttributeRow())
+ writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow()));
+
+ if (hasAttributeColumn())
+ writer.writeAttribute(QStringLiteral("column"), QString::number(attributeColumn()));
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_item.size(); ++i) {
+ DomItem* v = m_item[i];
+ v->write(writer, QStringLiteral("item"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomItem::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomItem::setElementItem(const QList<DomItem*>& a)
+{
+ m_children |= Item;
+ m_item = a;
+}
+
+void DomWidget::clear(bool clear_all)
+{
+ m_class.clear();
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_script);
+ m_script.clear();
+ qDeleteAll(m_widgetData);
+ m_widgetData.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+ qDeleteAll(m_row);
+ m_row.clear();
+ qDeleteAll(m_column);
+ m_column.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+ qDeleteAll(m_layout);
+ m_layout.clear();
+ qDeleteAll(m_widget);
+ m_widget.clear();
+ qDeleteAll(m_action);
+ m_action.clear();
+ qDeleteAll(m_actionGroup);
+ m_actionGroup.clear();
+ qDeleteAll(m_addAction);
+ m_addAction.clear();
+ m_zOrder.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_class = false;
+ m_has_attr_name = false;
+ m_has_attr_native = false;
+ m_attr_native = false;
+ }
+
+ m_children = 0;
+}
+
+DomWidget::DomWidget()
+{
+ m_children = 0;
+ m_has_attr_class = false;
+ m_has_attr_name = false;
+ m_has_attr_native = false;
+ m_attr_native = false;
+}
+
+DomWidget::~DomWidget()
+{
+ m_class.clear();
+ qDeleteAll(m_property);
+ m_property.clear();
+ qDeleteAll(m_script);
+ m_script.clear();
+ qDeleteAll(m_widgetData);
+ m_widgetData.clear();
+ qDeleteAll(m_attribute);
+ m_attribute.clear();
+ qDeleteAll(m_row);
+ m_row.clear();
+ qDeleteAll(m_column);
+ m_column.clear();
+ qDeleteAll(m_item);
+ m_item.clear();
+ qDeleteAll(m_layout);
+ m_layout.clear();
+ qDeleteAll(m_widget);
+ m_widget.clear();
+ qDeleteAll(m_action);
+ m_action.clear();
+ qDeleteAll(m_actionGroup);
+ m_actionGroup.clear();
+ qDeleteAll(m_addAction);
+ m_addAction.clear();
+ m_zOrder.clear();
+}
+
+void DomWidget::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("class")) {
+ setAttributeClass(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("native")) {
+ setAttributeNative((attribute.value().toString() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("class")) {
+ m_class.append(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("script")) {
+ DomScript *v = new DomScript();
+ v->read(reader);
+ m_script.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("widgetdata")) {
+ DomWidgetData *v = new DomWidgetData();
+ v->read(reader);
+ m_widgetData.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("attribute")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_attribute.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("row")) {
+ DomRow *v = new DomRow();
+ v->read(reader);
+ m_row.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("column")) {
+ DomColumn *v = new DomColumn();
+ v->read(reader);
+ m_column.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("item")) {
+ DomItem *v = new DomItem();
+ v->read(reader);
+ m_item.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("layout")) {
+ DomLayout *v = new DomLayout();
+ v->read(reader);
+ m_layout.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("widget")) {
+ DomWidget *v = new DomWidget();
+ v->read(reader);
+ m_widget.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("action")) {
+ DomAction *v = new DomAction();
+ v->read(reader);
+ m_action.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("actiongroup")) {
+ DomActionGroup *v = new DomActionGroup();
+ v->read(reader);
+ m_actionGroup.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("addaction")) {
+ DomActionRef *v = new DomActionRef();
+ v->read(reader);
+ m_addAction.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("zorder")) {
+ m_zOrder.append(reader.readElementText());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widget") : tagName.toLower());
+
+ if (hasAttributeClass())
+ writer.writeAttribute(QStringLiteral("class"), attributeClass());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (hasAttributeNative())
+ writer.writeAttribute(QStringLiteral("native"), (attributeNative() ? QLatin1String("true") : QLatin1String("false")));
+
+ for (int i = 0; i < m_class.size(); ++i) {
+ QString v = m_class[i];
+ writer.writeTextElement(QStringLiteral("class"), v);
+ }
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ for (int i = 0; i < m_script.size(); ++i) {
+ DomScript* v = m_script[i];
+ v->write(writer, QStringLiteral("script"));
+ }
+ for (int i = 0; i < m_widgetData.size(); ++i) {
+ DomWidgetData* v = m_widgetData[i];
+ v->write(writer, QStringLiteral("widgetdata"));
+ }
+ for (int i = 0; i < m_attribute.size(); ++i) {
+ DomProperty* v = m_attribute[i];
+ v->write(writer, QStringLiteral("attribute"));
+ }
+ for (int i = 0; i < m_row.size(); ++i) {
+ DomRow* v = m_row[i];
+ v->write(writer, QStringLiteral("row"));
+ }
+ for (int i = 0; i < m_column.size(); ++i) {
+ DomColumn* v = m_column[i];
+ v->write(writer, QStringLiteral("column"));
+ }
+ for (int i = 0; i < m_item.size(); ++i) {
+ DomItem* v = m_item[i];
+ v->write(writer, QStringLiteral("item"));
+ }
+ for (int i = 0; i < m_layout.size(); ++i) {
+ DomLayout* v = m_layout[i];
+ v->write(writer, QStringLiteral("layout"));
+ }
+ for (int i = 0; i < m_widget.size(); ++i) {
+ DomWidget* v = m_widget[i];
+ v->write(writer, QStringLiteral("widget"));
+ }
+ for (int i = 0; i < m_action.size(); ++i) {
+ DomAction* v = m_action[i];
+ v->write(writer, QStringLiteral("action"));
+ }
+ for (int i = 0; i < m_actionGroup.size(); ++i) {
+ DomActionGroup* v = m_actionGroup[i];
+ v->write(writer, QStringLiteral("actiongroup"));
+ }
+ for (int i = 0; i < m_addAction.size(); ++i) {
+ DomActionRef* v = m_addAction[i];
+ v->write(writer, QStringLiteral("addaction"));
+ }
+ for (int i = 0; i < m_zOrder.size(); ++i) {
+ QString v = m_zOrder[i];
+ writer.writeTextElement(QStringLiteral("zorder"), v);
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomWidget::setElementClass(const QStringList& a)
+{
+ m_children |= Class;
+ m_class = a;
+}
+
+void DomWidget::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomWidget::setElementScript(const QList<DomScript*>& a)
+{
+ m_children |= Script;
+ m_script = a;
+}
+
+void DomWidget::setElementWidgetData(const QList<DomWidgetData*>& a)
+{
+ m_children |= WidgetData;
+ m_widgetData = a;
+}
+
+void DomWidget::setElementAttribute(const QList<DomProperty*>& a)
+{
+ m_children |= Attribute;
+ m_attribute = a;
+}
+
+void DomWidget::setElementRow(const QList<DomRow*>& a)
+{
+ m_children |= Row;
+ m_row = a;
+}
+
+void DomWidget::setElementColumn(const QList<DomColumn*>& a)
+{
+ m_children |= Column;
+ m_column = a;
+}
+
+void DomWidget::setElementItem(const QList<DomItem*>& a)
+{
+ m_children |= Item;
+ m_item = a;
+}
+
+void DomWidget::setElementLayout(const QList<DomLayout*>& a)
+{
+ m_children |= Layout;
+ m_layout = a;
+}
+
+void DomWidget::setElementWidget(const QList<DomWidget*>& a)
+{
+ m_children |= Widget;
+ m_widget = a;
+}
+
+void DomWidget::setElementAction(const QList<DomAction*>& a)
+{
+ m_children |= Action;
+ m_action = a;
+}
+
+void DomWidget::setElementActionGroup(const QList<DomActionGroup*>& a)
+{
+ m_children |= ActionGroup;
+ m_actionGroup = a;
+}
+
+void DomWidget::setElementAddAction(const QList<DomActionRef*>& a)
+{
+ m_children |= AddAction;
+ m_addAction = a;
+}
+
+void DomWidget::setElementZOrder(const QStringList& a)
+{
+ m_children |= ZOrder;
+ m_zOrder = a;
+}
+
+void DomSpacer::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ }
+
+ m_children = 0;
+}
+
+DomSpacer::DomSpacer()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+}
+
+DomSpacer::~DomSpacer()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomSpacer::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSpacer::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("spacer") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSpacer::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomColor::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_alpha = false;
+ m_attr_alpha = 0;
+ }
+
+ m_children = 0;
+ m_red = 0;
+ m_green = 0;
+ m_blue = 0;
+}
+
+DomColor::DomColor()
+{
+ m_children = 0;
+ m_has_attr_alpha = false;
+ m_attr_alpha = 0;
+ m_red = 0;
+ m_green = 0;
+ m_blue = 0;
+}
+
+DomColor::~DomColor()
+{
+}
+
+void DomColor::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("alpha")) {
+ setAttributeAlpha(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("red")) {
+ setElementRed(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("green")) {
+ setElementGreen(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("blue")) {
+ setElementBlue(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomColor::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("color") : tagName.toLower());
+
+ if (hasAttributeAlpha())
+ writer.writeAttribute(QStringLiteral("alpha"), QString::number(attributeAlpha()));
+
+ if (m_children & Red) {
+ writer.writeTextElement(QStringLiteral("red"), QString::number(m_red));
+ }
+
+ if (m_children & Green) {
+ writer.writeTextElement(QStringLiteral("green"), QString::number(m_green));
+ }
+
+ if (m_children & Blue) {
+ writer.writeTextElement(QStringLiteral("blue"), QString::number(m_blue));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomColor::setElementRed(int a)
+{
+ m_children |= Red;
+ m_red = a;
+}
+
+void DomColor::setElementGreen(int a)
+{
+ m_children |= Green;
+ m_green = a;
+}
+
+void DomColor::setElementBlue(int a)
+{
+ m_children |= Blue;
+ m_blue = a;
+}
+
+void DomColor::clearElementRed()
+{
+ m_children &= ~Red;
+}
+
+void DomColor::clearElementGreen()
+{
+ m_children &= ~Green;
+}
+
+void DomColor::clearElementBlue()
+{
+ m_children &= ~Blue;
+}
+
+void DomGradientStop::clear(bool clear_all)
+{
+ delete m_color;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_position = false;
+ m_attr_position = 0.0;
+ }
+
+ m_children = 0;
+ m_color = 0;
+}
+
+DomGradientStop::DomGradientStop()
+{
+ m_children = 0;
+ m_has_attr_position = false;
+ m_attr_position = 0.0;
+ m_color = 0;
+}
+
+DomGradientStop::~DomGradientStop()
+{
+ delete m_color;
+}
+
+void DomGradientStop::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("position")) {
+ setAttributePosition(attribute.value().toString().toDouble());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("color")) {
+ DomColor *v = new DomColor();
+ v->read(reader);
+ setElementColor(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomGradientStop::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradientstop") : tagName.toLower());
+
+ if (hasAttributePosition())
+ writer.writeAttribute(QStringLiteral("position"), QString::number(attributePosition(), 'f', 15));
+
+ if (m_children & Color) {
+ m_color->write(writer, QStringLiteral("color"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomColor* DomGradientStop::takeElementColor()
+{
+ DomColor* a = m_color;
+ m_color = 0;
+ m_children ^= Color;
+ return a;
+}
+
+void DomGradientStop::setElementColor(DomColor* a)
+{
+ delete m_color;
+ m_children |= Color;
+ m_color = a;
+}
+
+void DomGradientStop::clearElementColor()
+{
+ delete m_color;
+ m_color = 0;
+ m_children &= ~Color;
+}
+
+void DomGradient::clear(bool clear_all)
+{
+ qDeleteAll(m_gradientStop);
+ m_gradientStop.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_startX = false;
+ m_attr_startX = 0.0;
+ m_has_attr_startY = false;
+ m_attr_startY = 0.0;
+ m_has_attr_endX = false;
+ m_attr_endX = 0.0;
+ m_has_attr_endY = false;
+ m_attr_endY = 0.0;
+ m_has_attr_centralX = false;
+ m_attr_centralX = 0.0;
+ m_has_attr_centralY = false;
+ m_attr_centralY = 0.0;
+ m_has_attr_focalX = false;
+ m_attr_focalX = 0.0;
+ m_has_attr_focalY = false;
+ m_attr_focalY = 0.0;
+ m_has_attr_radius = false;
+ m_attr_radius = 0.0;
+ m_has_attr_angle = false;
+ m_attr_angle = 0.0;
+ m_has_attr_type = false;
+ m_has_attr_spread = false;
+ m_has_attr_coordinateMode = false;
+ }
+
+ m_children = 0;
+}
+
+DomGradient::DomGradient()
+{
+ m_children = 0;
+ m_has_attr_startX = false;
+ m_attr_startX = 0.0;
+ m_has_attr_startY = false;
+ m_attr_startY = 0.0;
+ m_has_attr_endX = false;
+ m_attr_endX = 0.0;
+ m_has_attr_endY = false;
+ m_attr_endY = 0.0;
+ m_has_attr_centralX = false;
+ m_attr_centralX = 0.0;
+ m_has_attr_centralY = false;
+ m_attr_centralY = 0.0;
+ m_has_attr_focalX = false;
+ m_attr_focalX = 0.0;
+ m_has_attr_focalY = false;
+ m_attr_focalY = 0.0;
+ m_has_attr_radius = false;
+ m_attr_radius = 0.0;
+ m_has_attr_angle = false;
+ m_attr_angle = 0.0;
+ m_has_attr_type = false;
+ m_has_attr_spread = false;
+ m_has_attr_coordinateMode = false;
+}
+
+DomGradient::~DomGradient()
+{
+ qDeleteAll(m_gradientStop);
+ m_gradientStop.clear();
+}
+
+void DomGradient::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("startx")) {
+ setAttributeStartX(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("starty")) {
+ setAttributeStartY(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("endx")) {
+ setAttributeEndX(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("endy")) {
+ setAttributeEndY(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("centralx")) {
+ setAttributeCentralX(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("centraly")) {
+ setAttributeCentralY(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("focalx")) {
+ setAttributeFocalX(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("focaly")) {
+ setAttributeFocalY(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("radius")) {
+ setAttributeRadius(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("angle")) {
+ setAttributeAngle(attribute.value().toString().toDouble());
+ continue;
+ }
+ if (name == QStringLiteral("type")) {
+ setAttributeType(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("spread")) {
+ setAttributeSpread(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("coordinatemode")) {
+ setAttributeCoordinateMode(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("gradientstop")) {
+ DomGradientStop *v = new DomGradientStop();
+ v->read(reader);
+ m_gradientStop.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomGradient::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradient") : tagName.toLower());
+
+ if (hasAttributeStartX())
+ writer.writeAttribute(QStringLiteral("startx"), QString::number(attributeStartX(), 'f', 15));
+
+ if (hasAttributeStartY())
+ writer.writeAttribute(QStringLiteral("starty"), QString::number(attributeStartY(), 'f', 15));
+
+ if (hasAttributeEndX())
+ writer.writeAttribute(QStringLiteral("endx"), QString::number(attributeEndX(), 'f', 15));
+
+ if (hasAttributeEndY())
+ writer.writeAttribute(QStringLiteral("endy"), QString::number(attributeEndY(), 'f', 15));
+
+ if (hasAttributeCentralX())
+ writer.writeAttribute(QStringLiteral("centralx"), QString::number(attributeCentralX(), 'f', 15));
+
+ if (hasAttributeCentralY())
+ writer.writeAttribute(QStringLiteral("centraly"), QString::number(attributeCentralY(), 'f', 15));
+
+ if (hasAttributeFocalX())
+ writer.writeAttribute(QStringLiteral("focalx"), QString::number(attributeFocalX(), 'f', 15));
+
+ if (hasAttributeFocalY())
+ writer.writeAttribute(QStringLiteral("focaly"), QString::number(attributeFocalY(), 'f', 15));
+
+ if (hasAttributeRadius())
+ writer.writeAttribute(QStringLiteral("radius"), QString::number(attributeRadius(), 'f', 15));
+
+ if (hasAttributeAngle())
+ writer.writeAttribute(QStringLiteral("angle"), QString::number(attributeAngle(), 'f', 15));
+
+ if (hasAttributeType())
+ writer.writeAttribute(QStringLiteral("type"), attributeType());
+
+ if (hasAttributeSpread())
+ writer.writeAttribute(QStringLiteral("spread"), attributeSpread());
+
+ if (hasAttributeCoordinateMode())
+ writer.writeAttribute(QStringLiteral("coordinatemode"), attributeCoordinateMode());
+
+ for (int i = 0; i < m_gradientStop.size(); ++i) {
+ DomGradientStop* v = m_gradientStop[i];
+ v->write(writer, QStringLiteral("gradientstop"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomGradient::setElementGradientStop(const QList<DomGradientStop*>& a)
+{
+ m_children |= GradientStop;
+ m_gradientStop = a;
+}
+
+void DomBrush::clear(bool clear_all)
+{
+ delete m_color;
+ delete m_texture;
+ delete m_gradient;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_brushStyle = false;
+ }
+
+ m_kind = Unknown;
+
+ m_color = 0;
+ m_texture = 0;
+ m_gradient = 0;
+}
+
+DomBrush::DomBrush()
+{
+ m_kind = Unknown;
+
+ m_has_attr_brushStyle = false;
+ m_color = 0;
+ m_texture = 0;
+ m_gradient = 0;
+}
+
+DomBrush::~DomBrush()
+{
+ delete m_color;
+ delete m_texture;
+ delete m_gradient;
+}
+
+void DomBrush::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("brushstyle")) {
+ setAttributeBrushStyle(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("color")) {
+ DomColor *v = new DomColor();
+ v->read(reader);
+ setElementColor(v);
+ continue;
+ }
+ if (tag == QStringLiteral("texture")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ setElementTexture(v);
+ continue;
+ }
+ if (tag == QStringLiteral("gradient")) {
+ DomGradient *v = new DomGradient();
+ v->read(reader);
+ setElementGradient(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomBrush::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("brush") : tagName.toLower());
+
+ if (hasAttributeBrushStyle())
+ writer.writeAttribute(QStringLiteral("brushstyle"), attributeBrushStyle());
+
+ switch (kind()) {
+ case Color: {
+ DomColor* v = elementColor();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("color"));
+ }
+ break;
+ }
+ case Texture: {
+ DomProperty* v = elementTexture();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("texture"));
+ }
+ break;
+ }
+ case Gradient: {
+ DomGradient* v = elementGradient();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("gradient"));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomColor* DomBrush::takeElementColor()
+{
+ DomColor* a = m_color;
+ m_color = 0;
+ return a;
+}
+
+void DomBrush::setElementColor(DomColor* a)
+{
+ clear(false);
+ m_kind = Color;
+ m_color = a;
+}
+
+DomProperty* DomBrush::takeElementTexture()
+{
+ DomProperty* a = m_texture;
+ m_texture = 0;
+ return a;
+}
+
+void DomBrush::setElementTexture(DomProperty* a)
+{
+ clear(false);
+ m_kind = Texture;
+ m_texture = a;
+}
+
+DomGradient* DomBrush::takeElementGradient()
+{
+ DomGradient* a = m_gradient;
+ m_gradient = 0;
+ return a;
+}
+
+void DomBrush::setElementGradient(DomGradient* a)
+{
+ clear(false);
+ m_kind = Gradient;
+ m_gradient = a;
+}
+
+void DomColorRole::clear(bool clear_all)
+{
+ delete m_brush;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_role = false;
+ }
+
+ m_children = 0;
+ m_brush = 0;
+}
+
+DomColorRole::DomColorRole()
+{
+ m_children = 0;
+ m_has_attr_role = false;
+ m_brush = 0;
+}
+
+DomColorRole::~DomColorRole()
+{
+ delete m_brush;
+}
+
+void DomColorRole::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("role")) {
+ setAttributeRole(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("brush")) {
+ DomBrush *v = new DomBrush();
+ v->read(reader);
+ setElementBrush(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomColorRole::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorrole") : tagName.toLower());
+
+ if (hasAttributeRole())
+ writer.writeAttribute(QStringLiteral("role"), attributeRole());
+
+ if (m_children & Brush) {
+ m_brush->write(writer, QStringLiteral("brush"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomBrush* DomColorRole::takeElementBrush()
+{
+ DomBrush* a = m_brush;
+ m_brush = 0;
+ m_children ^= Brush;
+ return a;
+}
+
+void DomColorRole::setElementBrush(DomBrush* a)
+{
+ delete m_brush;
+ m_children |= Brush;
+ m_brush = a;
+}
+
+void DomColorRole::clearElementBrush()
+{
+ delete m_brush;
+ m_brush = 0;
+ m_children &= ~Brush;
+}
+
+void DomColorGroup::clear(bool clear_all)
+{
+ qDeleteAll(m_colorRole);
+ m_colorRole.clear();
+ qDeleteAll(m_color);
+ m_color.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomColorGroup::DomColorGroup()
+{
+ m_children = 0;
+}
+
+DomColorGroup::~DomColorGroup()
+{
+ qDeleteAll(m_colorRole);
+ m_colorRole.clear();
+ qDeleteAll(m_color);
+ m_color.clear();
+}
+
+void DomColorGroup::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("colorrole")) {
+ DomColorRole *v = new DomColorRole();
+ v->read(reader);
+ m_colorRole.append(v);
+ continue;
+ }
+ if (tag == QStringLiteral("color")) {
+ DomColor *v = new DomColor();
+ v->read(reader);
+ m_color.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomColorGroup::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorgroup") : tagName.toLower());
+
+ for (int i = 0; i < m_colorRole.size(); ++i) {
+ DomColorRole* v = m_colorRole[i];
+ v->write(writer, QStringLiteral("colorrole"));
+ }
+ for (int i = 0; i < m_color.size(); ++i) {
+ DomColor* v = m_color[i];
+ v->write(writer, QStringLiteral("color"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomColorGroup::setElementColorRole(const QList<DomColorRole*>& a)
+{
+ m_children |= ColorRole;
+ m_colorRole = a;
+}
+
+void DomColorGroup::setElementColor(const QList<DomColor*>& a)
+{
+ m_children |= Color;
+ m_color = a;
+}
+
+void DomPalette::clear(bool clear_all)
+{
+ delete m_active;
+ delete m_inactive;
+ delete m_disabled;
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_active = 0;
+ m_inactive = 0;
+ m_disabled = 0;
+}
+
+DomPalette::DomPalette()
+{
+ m_children = 0;
+ m_active = 0;
+ m_inactive = 0;
+ m_disabled = 0;
+}
+
+DomPalette::~DomPalette()
+{
+ delete m_active;
+ delete m_inactive;
+ delete m_disabled;
+}
+
+void DomPalette::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("active")) {
+ DomColorGroup *v = new DomColorGroup();
+ v->read(reader);
+ setElementActive(v);
+ continue;
+ }
+ if (tag == QStringLiteral("inactive")) {
+ DomColorGroup *v = new DomColorGroup();
+ v->read(reader);
+ setElementInactive(v);
+ continue;
+ }
+ if (tag == QStringLiteral("disabled")) {
+ DomColorGroup *v = new DomColorGroup();
+ v->read(reader);
+ setElementDisabled(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomPalette::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("palette") : tagName.toLower());
+
+ if (m_children & Active) {
+ m_active->write(writer, QStringLiteral("active"));
+ }
+
+ if (m_children & Inactive) {
+ m_inactive->write(writer, QStringLiteral("inactive"));
+ }
+
+ if (m_children & Disabled) {
+ m_disabled->write(writer, QStringLiteral("disabled"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomColorGroup* DomPalette::takeElementActive()
+{
+ DomColorGroup* a = m_active;
+ m_active = 0;
+ m_children ^= Active;
+ return a;
+}
+
+void DomPalette::setElementActive(DomColorGroup* a)
+{
+ delete m_active;
+ m_children |= Active;
+ m_active = a;
+}
+
+DomColorGroup* DomPalette::takeElementInactive()
+{
+ DomColorGroup* a = m_inactive;
+ m_inactive = 0;
+ m_children ^= Inactive;
+ return a;
+}
+
+void DomPalette::setElementInactive(DomColorGroup* a)
+{
+ delete m_inactive;
+ m_children |= Inactive;
+ m_inactive = a;
+}
+
+DomColorGroup* DomPalette::takeElementDisabled()
+{
+ DomColorGroup* a = m_disabled;
+ m_disabled = 0;
+ m_children ^= Disabled;
+ return a;
+}
+
+void DomPalette::setElementDisabled(DomColorGroup* a)
+{
+ delete m_disabled;
+ m_children |= Disabled;
+ m_disabled = a;
+}
+
+void DomPalette::clearElementActive()
+{
+ delete m_active;
+ m_active = 0;
+ m_children &= ~Active;
+}
+
+void DomPalette::clearElementInactive()
+{
+ delete m_inactive;
+ m_inactive = 0;
+ m_children &= ~Inactive;
+}
+
+void DomPalette::clearElementDisabled()
+{
+ delete m_disabled;
+ m_disabled = 0;
+ m_children &= ~Disabled;
+}
+
+void DomFont::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_pointSize = 0;
+ m_weight = 0;
+ m_italic = false;
+ m_bold = false;
+ m_underline = false;
+ m_strikeOut = false;
+ m_antialiasing = false;
+ m_kerning = false;
+}
+
+DomFont::DomFont()
+{
+ m_children = 0;
+ m_pointSize = 0;
+ m_weight = 0;
+ m_italic = false;
+ m_bold = false;
+ m_underline = false;
+ m_strikeOut = false;
+ m_antialiasing = false;
+ m_kerning = false;
+}
+
+DomFont::~DomFont()
+{
+}
+
+void DomFont::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("family")) {
+ setElementFamily(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("pointsize")) {
+ setElementPointSize(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("weight")) {
+ setElementWeight(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("italic")) {
+ setElementItalic((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ if (tag == QStringLiteral("bold")) {
+ setElementBold((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ if (tag == QStringLiteral("underline")) {
+ setElementUnderline((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ if (tag == QStringLiteral("strikeout")) {
+ setElementStrikeOut((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ if (tag == QStringLiteral("antialiasing")) {
+ setElementAntialiasing((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ if (tag == QStringLiteral("stylestrategy")) {
+ setElementStyleStrategy(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("kerning")) {
+ setElementKerning((reader.readElementText() == QLatin1String("true") ? true : false));
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("font") : tagName.toLower());
+
+ if (m_children & Family) {
+ writer.writeTextElement(QStringLiteral("family"), m_family);
+ }
+
+ if (m_children & PointSize) {
+ writer.writeTextElement(QStringLiteral("pointsize"), QString::number(m_pointSize));
+ }
+
+ if (m_children & Weight) {
+ writer.writeTextElement(QStringLiteral("weight"), QString::number(m_weight));
+ }
+
+ if (m_children & Italic) {
+ writer.writeTextElement(QStringLiteral("italic"), (m_italic ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (m_children & Bold) {
+ writer.writeTextElement(QStringLiteral("bold"), (m_bold ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (m_children & Underline) {
+ writer.writeTextElement(QStringLiteral("underline"), (m_underline ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (m_children & StrikeOut) {
+ writer.writeTextElement(QStringLiteral("strikeout"), (m_strikeOut ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (m_children & Antialiasing) {
+ writer.writeTextElement(QStringLiteral("antialiasing"), (m_antialiasing ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (m_children & StyleStrategy) {
+ writer.writeTextElement(QStringLiteral("stylestrategy"), m_styleStrategy);
+ }
+
+ if (m_children & Kerning) {
+ writer.writeTextElement(QStringLiteral("kerning"), (m_kerning ? QLatin1String("true") : QLatin1String("false")));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomFont::setElementFamily(const QString& a)
+{
+ m_children |= Family;
+ m_family = a;
+}
+
+void DomFont::setElementPointSize(int a)
+{
+ m_children |= PointSize;
+ m_pointSize = a;
+}
+
+void DomFont::setElementWeight(int a)
+{
+ m_children |= Weight;
+ m_weight = a;
+}
+
+void DomFont::setElementItalic(bool a)
+{
+ m_children |= Italic;
+ m_italic = a;
+}
+
+void DomFont::setElementBold(bool a)
+{
+ m_children |= Bold;
+ m_bold = a;
+}
+
+void DomFont::setElementUnderline(bool a)
+{
+ m_children |= Underline;
+ m_underline = a;
+}
+
+void DomFont::setElementStrikeOut(bool a)
+{
+ m_children |= StrikeOut;
+ m_strikeOut = a;
+}
+
+void DomFont::setElementAntialiasing(bool a)
+{
+ m_children |= Antialiasing;
+ m_antialiasing = a;
+}
+
+void DomFont::setElementStyleStrategy(const QString& a)
+{
+ m_children |= StyleStrategy;
+ m_styleStrategy = a;
+}
+
+void DomFont::setElementKerning(bool a)
+{
+ m_children |= Kerning;
+ m_kerning = a;
+}
+
+void DomFont::clearElementFamily()
+{
+ m_children &= ~Family;
+}
+
+void DomFont::clearElementPointSize()
+{
+ m_children &= ~PointSize;
+}
+
+void DomFont::clearElementWeight()
+{
+ m_children &= ~Weight;
+}
+
+void DomFont::clearElementItalic()
+{
+ m_children &= ~Italic;
+}
+
+void DomFont::clearElementBold()
+{
+ m_children &= ~Bold;
+}
+
+void DomFont::clearElementUnderline()
+{
+ m_children &= ~Underline;
+}
+
+void DomFont::clearElementStrikeOut()
+{
+ m_children &= ~StrikeOut;
+}
+
+void DomFont::clearElementAntialiasing()
+{
+ m_children &= ~Antialiasing;
+}
+
+void DomFont::clearElementStyleStrategy()
+{
+ m_children &= ~StyleStrategy;
+}
+
+void DomFont::clearElementKerning()
+{
+ m_children &= ~Kerning;
+}
+
+void DomPoint::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomPoint::DomPoint()
+{
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomPoint::~DomPoint()
+{
+}
+
+void DomPoint::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QString(QLatin1Char('x'))) {
+ setElementX(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QString(QLatin1Char('y'))) {
+ setElementY(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomPoint::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("point") : tagName.toLower());
+
+ if (m_children & X) {
+ writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
+ }
+
+ if (m_children & Y) {
+ writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomPoint::setElementX(int a)
+{
+ m_children |= X;
+ m_x = a;
+}
+
+void DomPoint::setElementY(int a)
+{
+ m_children |= Y;
+ m_y = a;
+}
+
+void DomPoint::clearElementX()
+{
+ m_children &= ~X;
+}
+
+void DomPoint::clearElementY()
+{
+ m_children &= ~Y;
+}
+
+void DomRect::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomRect::DomRect()
+{
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomRect::~DomRect()
+{
+}
+
+void DomRect::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QString(QLatin1Char('x'))) {
+ setElementX(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QString(QLatin1Char('y'))) {
+ setElementY(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("width")) {
+ setElementWidth(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("height")) {
+ setElementHeight(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomRect::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rect") : tagName.toLower());
+
+ if (m_children & X) {
+ writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
+ }
+
+ if (m_children & Y) {
+ writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
+ }
+
+ if (m_children & Width) {
+ writer.writeTextElement(QStringLiteral("width"), QString::number(m_width));
+ }
+
+ if (m_children & Height) {
+ writer.writeTextElement(QStringLiteral("height"), QString::number(m_height));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomRect::setElementX(int a)
+{
+ m_children |= X;
+ m_x = a;
+}
+
+void DomRect::setElementY(int a)
+{
+ m_children |= Y;
+ m_y = a;
+}
+
+void DomRect::setElementWidth(int a)
+{
+ m_children |= Width;
+ m_width = a;
+}
+
+void DomRect::setElementHeight(int a)
+{
+ m_children |= Height;
+ m_height = a;
+}
+
+void DomRect::clearElementX()
+{
+ m_children &= ~X;
+}
+
+void DomRect::clearElementY()
+{
+ m_children &= ~Y;
+}
+
+void DomRect::clearElementWidth()
+{
+ m_children &= ~Width;
+}
+
+void DomRect::clearElementHeight()
+{
+ m_children &= ~Height;
+}
+
+void DomLocale::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_language = false;
+ m_has_attr_country = false;
+ }
+
+ m_children = 0;
+}
+
+DomLocale::DomLocale()
+{
+ m_children = 0;
+ m_has_attr_language = false;
+ m_has_attr_country = false;
+}
+
+DomLocale::~DomLocale()
+{
+}
+
+void DomLocale::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("language")) {
+ setAttributeLanguage(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("country")) {
+ setAttributeCountry(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomLocale::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("locale") : tagName.toLower());
+
+ if (hasAttributeLanguage())
+ writer.writeAttribute(QStringLiteral("language"), attributeLanguage());
+
+ if (hasAttributeCountry())
+ writer.writeAttribute(QStringLiteral("country"), attributeCountry());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSizePolicy::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_hSizeType = false;
+ m_has_attr_vSizeType = false;
+ }
+
+ m_children = 0;
+ m_hSizeType = 0;
+ m_vSizeType = 0;
+ m_horStretch = 0;
+ m_verStretch = 0;
+}
+
+DomSizePolicy::DomSizePolicy()
+{
+ m_children = 0;
+ m_has_attr_hSizeType = false;
+ m_has_attr_vSizeType = false;
+ m_hSizeType = 0;
+ m_vSizeType = 0;
+ m_horStretch = 0;
+ m_verStretch = 0;
+}
+
+DomSizePolicy::~DomSizePolicy()
+{
+}
+
+void DomSizePolicy::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("hsizetype")) {
+ setAttributeHSizeType(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("vsizetype")) {
+ setAttributeVSizeType(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("hsizetype")) {
+ setElementHSizeType(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("vsizetype")) {
+ setElementVSizeType(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("horstretch")) {
+ setElementHorStretch(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("verstretch")) {
+ setElementVerStretch(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSizePolicy::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicy") : tagName.toLower());
+
+ if (hasAttributeHSizeType())
+ writer.writeAttribute(QStringLiteral("hsizetype"), attributeHSizeType());
+
+ if (hasAttributeVSizeType())
+ writer.writeAttribute(QStringLiteral("vsizetype"), attributeVSizeType());
+
+ if (m_children & HSizeType) {
+ writer.writeTextElement(QStringLiteral("hsizetype"), QString::number(m_hSizeType));
+ }
+
+ if (m_children & VSizeType) {
+ writer.writeTextElement(QStringLiteral("vsizetype"), QString::number(m_vSizeType));
+ }
+
+ if (m_children & HorStretch) {
+ writer.writeTextElement(QStringLiteral("horstretch"), QString::number(m_horStretch));
+ }
+
+ if (m_children & VerStretch) {
+ writer.writeTextElement(QStringLiteral("verstretch"), QString::number(m_verStretch));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSizePolicy::setElementHSizeType(int a)
+{
+ m_children |= HSizeType;
+ m_hSizeType = a;
+}
+
+void DomSizePolicy::setElementVSizeType(int a)
+{
+ m_children |= VSizeType;
+ m_vSizeType = a;
+}
+
+void DomSizePolicy::setElementHorStretch(int a)
+{
+ m_children |= HorStretch;
+ m_horStretch = a;
+}
+
+void DomSizePolicy::setElementVerStretch(int a)
+{
+ m_children |= VerStretch;
+ m_verStretch = a;
+}
+
+void DomSizePolicy::clearElementHSizeType()
+{
+ m_children &= ~HSizeType;
+}
+
+void DomSizePolicy::clearElementVSizeType()
+{
+ m_children &= ~VSizeType;
+}
+
+void DomSizePolicy::clearElementHorStretch()
+{
+ m_children &= ~HorStretch;
+}
+
+void DomSizePolicy::clearElementVerStretch()
+{
+ m_children &= ~VerStretch;
+}
+
+void DomSize::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomSize::DomSize()
+{
+ m_children = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomSize::~DomSize()
+{
+}
+
+void DomSize::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("width")) {
+ setElementWidth(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("height")) {
+ setElementHeight(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSize::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("size") : tagName.toLower());
+
+ if (m_children & Width) {
+ writer.writeTextElement(QStringLiteral("width"), QString::number(m_width));
+ }
+
+ if (m_children & Height) {
+ writer.writeTextElement(QStringLiteral("height"), QString::number(m_height));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSize::setElementWidth(int a)
+{
+ m_children |= Width;
+ m_width = a;
+}
+
+void DomSize::setElementHeight(int a)
+{
+ m_children |= Height;
+ m_height = a;
+}
+
+void DomSize::clearElementWidth()
+{
+ m_children &= ~Width;
+}
+
+void DomSize::clearElementHeight()
+{
+ m_children &= ~Height;
+}
+
+void DomDate::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_year = 0;
+ m_month = 0;
+ m_day = 0;
+}
+
+DomDate::DomDate()
+{
+ m_children = 0;
+ m_year = 0;
+ m_month = 0;
+ m_day = 0;
+}
+
+DomDate::~DomDate()
+{
+}
+
+void DomDate::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("year")) {
+ setElementYear(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("month")) {
+ setElementMonth(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("day")) {
+ setElementDay(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomDate::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("date") : tagName.toLower());
+
+ if (m_children & Year) {
+ writer.writeTextElement(QStringLiteral("year"), QString::number(m_year));
+ }
+
+ if (m_children & Month) {
+ writer.writeTextElement(QStringLiteral("month"), QString::number(m_month));
+ }
+
+ if (m_children & Day) {
+ writer.writeTextElement(QStringLiteral("day"), QString::number(m_day));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomDate::setElementYear(int a)
+{
+ m_children |= Year;
+ m_year = a;
+}
+
+void DomDate::setElementMonth(int a)
+{
+ m_children |= Month;
+ m_month = a;
+}
+
+void DomDate::setElementDay(int a)
+{
+ m_children |= Day;
+ m_day = a;
+}
+
+void DomDate::clearElementYear()
+{
+ m_children &= ~Year;
+}
+
+void DomDate::clearElementMonth()
+{
+ m_children &= ~Month;
+}
+
+void DomDate::clearElementDay()
+{
+ m_children &= ~Day;
+}
+
+void DomTime::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_hour = 0;
+ m_minute = 0;
+ m_second = 0;
+}
+
+DomTime::DomTime()
+{
+ m_children = 0;
+ m_hour = 0;
+ m_minute = 0;
+ m_second = 0;
+}
+
+DomTime::~DomTime()
+{
+}
+
+void DomTime::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("hour")) {
+ setElementHour(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("minute")) {
+ setElementMinute(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("second")) {
+ setElementSecond(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomTime::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("time") : tagName.toLower());
+
+ if (m_children & Hour) {
+ writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour));
+ }
+
+ if (m_children & Minute) {
+ writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute));
+ }
+
+ if (m_children & Second) {
+ writer.writeTextElement(QStringLiteral("second"), QString::number(m_second));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomTime::setElementHour(int a)
+{
+ m_children |= Hour;
+ m_hour = a;
+}
+
+void DomTime::setElementMinute(int a)
+{
+ m_children |= Minute;
+ m_minute = a;
+}
+
+void DomTime::setElementSecond(int a)
+{
+ m_children |= Second;
+ m_second = a;
+}
+
+void DomTime::clearElementHour()
+{
+ m_children &= ~Hour;
+}
+
+void DomTime::clearElementMinute()
+{
+ m_children &= ~Minute;
+}
+
+void DomTime::clearElementSecond()
+{
+ m_children &= ~Second;
+}
+
+void DomDateTime::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_hour = 0;
+ m_minute = 0;
+ m_second = 0;
+ m_year = 0;
+ m_month = 0;
+ m_day = 0;
+}
+
+DomDateTime::DomDateTime()
+{
+ m_children = 0;
+ m_hour = 0;
+ m_minute = 0;
+ m_second = 0;
+ m_year = 0;
+ m_month = 0;
+ m_day = 0;
+}
+
+DomDateTime::~DomDateTime()
+{
+}
+
+void DomDateTime::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("hour")) {
+ setElementHour(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("minute")) {
+ setElementMinute(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("second")) {
+ setElementSecond(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("year")) {
+ setElementYear(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("month")) {
+ setElementMonth(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("day")) {
+ setElementDay(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomDateTime::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("datetime") : tagName.toLower());
+
+ if (m_children & Hour) {
+ writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour));
+ }
+
+ if (m_children & Minute) {
+ writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute));
+ }
+
+ if (m_children & Second) {
+ writer.writeTextElement(QStringLiteral("second"), QString::number(m_second));
+ }
+
+ if (m_children & Year) {
+ writer.writeTextElement(QStringLiteral("year"), QString::number(m_year));
+ }
+
+ if (m_children & Month) {
+ writer.writeTextElement(QStringLiteral("month"), QString::number(m_month));
+ }
+
+ if (m_children & Day) {
+ writer.writeTextElement(QStringLiteral("day"), QString::number(m_day));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomDateTime::setElementHour(int a)
+{
+ m_children |= Hour;
+ m_hour = a;
+}
+
+void DomDateTime::setElementMinute(int a)
+{
+ m_children |= Minute;
+ m_minute = a;
+}
+
+void DomDateTime::setElementSecond(int a)
+{
+ m_children |= Second;
+ m_second = a;
+}
+
+void DomDateTime::setElementYear(int a)
+{
+ m_children |= Year;
+ m_year = a;
+}
+
+void DomDateTime::setElementMonth(int a)
+{
+ m_children |= Month;
+ m_month = a;
+}
+
+void DomDateTime::setElementDay(int a)
+{
+ m_children |= Day;
+ m_day = a;
+}
+
+void DomDateTime::clearElementHour()
+{
+ m_children &= ~Hour;
+}
+
+void DomDateTime::clearElementMinute()
+{
+ m_children &= ~Minute;
+}
+
+void DomDateTime::clearElementSecond()
+{
+ m_children &= ~Second;
+}
+
+void DomDateTime::clearElementYear()
+{
+ m_children &= ~Year;
+}
+
+void DomDateTime::clearElementMonth()
+{
+ m_children &= ~Month;
+}
+
+void DomDateTime::clearElementDay()
+{
+ m_children &= ~Day;
+}
+
+void DomStringList::clear(bool clear_all)
+{
+ m_string.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomStringList::DomStringList()
+{
+ m_children = 0;
+}
+
+DomStringList::~DomStringList()
+{
+ m_string.clear();
+}
+
+void DomStringList::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("string")) {
+ m_string.append(reader.readElementText());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomStringList::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringlist") : tagName.toLower());
+
+ for (int i = 0; i < m_string.size(); ++i) {
+ QString v = m_string[i];
+ writer.writeTextElement(QStringLiteral("string"), v);
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomStringList::setElementString(const QStringList& a)
+{
+ m_children |= String;
+ m_string = a;
+}
+
+void DomResourcePixmap::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_resource = false;
+ m_has_attr_alias = false;
+ }
+
+ m_children = 0;
+}
+
+DomResourcePixmap::DomResourcePixmap()
+{
+ m_children = 0;
+ m_has_attr_resource = false;
+ m_has_attr_alias = false;
+ m_text.clear();
+}
+
+DomResourcePixmap::~DomResourcePixmap()
+{
+}
+
+void DomResourcePixmap::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("resource")) {
+ setAttributeResource(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("alias")) {
+ setAttributeAlias(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomResourcePixmap::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourcepixmap") : tagName.toLower());
+
+ if (hasAttributeResource())
+ writer.writeAttribute(QStringLiteral("resource"), attributeResource());
+
+ if (hasAttributeAlias())
+ writer.writeAttribute(QStringLiteral("alias"), attributeAlias());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomResourceIcon::clear(bool clear_all)
+{
+ delete m_normalOff;
+ delete m_normalOn;
+ delete m_disabledOff;
+ delete m_disabledOn;
+ delete m_activeOff;
+ delete m_activeOn;
+ delete m_selectedOff;
+ delete m_selectedOn;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_theme = false;
+ m_has_attr_resource = false;
+ }
+
+ m_children = 0;
+ m_normalOff = 0;
+ m_normalOn = 0;
+ m_disabledOff = 0;
+ m_disabledOn = 0;
+ m_activeOff = 0;
+ m_activeOn = 0;
+ m_selectedOff = 0;
+ m_selectedOn = 0;
+}
+
+DomResourceIcon::DomResourceIcon()
+{
+ m_children = 0;
+ m_has_attr_theme = false;
+ m_has_attr_resource = false;
+ m_text.clear();
+ m_normalOff = 0;
+ m_normalOn = 0;
+ m_disabledOff = 0;
+ m_disabledOn = 0;
+ m_activeOff = 0;
+ m_activeOn = 0;
+ m_selectedOff = 0;
+ m_selectedOn = 0;
+}
+
+DomResourceIcon::~DomResourceIcon()
+{
+ delete m_normalOff;
+ delete m_normalOn;
+ delete m_disabledOff;
+ delete m_disabledOn;
+ delete m_activeOff;
+ delete m_activeOn;
+ delete m_selectedOff;
+ delete m_selectedOn;
+}
+
+void DomResourceIcon::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("theme")) {
+ setAttributeTheme(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("resource")) {
+ setAttributeResource(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("normaloff")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementNormalOff(v);
+ continue;
+ }
+ if (tag == QStringLiteral("normalon")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementNormalOn(v);
+ continue;
+ }
+ if (tag == QStringLiteral("disabledoff")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementDisabledOff(v);
+ continue;
+ }
+ if (tag == QStringLiteral("disabledon")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementDisabledOn(v);
+ continue;
+ }
+ if (tag == QStringLiteral("activeoff")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementActiveOff(v);
+ continue;
+ }
+ if (tag == QStringLiteral("activeon")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementActiveOn(v);
+ continue;
+ }
+ if (tag == QStringLiteral("selectedoff")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementSelectedOff(v);
+ continue;
+ }
+ if (tag == QStringLiteral("selectedon")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementSelectedOn(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourceicon") : tagName.toLower());
+
+ if (hasAttributeTheme())
+ writer.writeAttribute(QStringLiteral("theme"), attributeTheme());
+
+ if (hasAttributeResource())
+ writer.writeAttribute(QStringLiteral("resource"), attributeResource());
+
+ if (m_children & NormalOff) {
+ m_normalOff->write(writer, QStringLiteral("normaloff"));
+ }
+
+ if (m_children & NormalOn) {
+ m_normalOn->write(writer, QStringLiteral("normalon"));
+ }
+
+ if (m_children & DisabledOff) {
+ m_disabledOff->write(writer, QStringLiteral("disabledoff"));
+ }
+
+ if (m_children & DisabledOn) {
+ m_disabledOn->write(writer, QStringLiteral("disabledon"));
+ }
+
+ if (m_children & ActiveOff) {
+ m_activeOff->write(writer, QStringLiteral("activeoff"));
+ }
+
+ if (m_children & ActiveOn) {
+ m_activeOn->write(writer, QStringLiteral("activeon"));
+ }
+
+ if (m_children & SelectedOff) {
+ m_selectedOff->write(writer, QStringLiteral("selectedoff"));
+ }
+
+ if (m_children & SelectedOn) {
+ m_selectedOn->write(writer, QStringLiteral("selectedon"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementNormalOff()
+{
+ DomResourcePixmap* a = m_normalOff;
+ m_normalOff = 0;
+ m_children ^= NormalOff;
+ return a;
+}
+
+void DomResourceIcon::setElementNormalOff(DomResourcePixmap* a)
+{
+ delete m_normalOff;
+ m_children |= NormalOff;
+ m_normalOff = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementNormalOn()
+{
+ DomResourcePixmap* a = m_normalOn;
+ m_normalOn = 0;
+ m_children ^= NormalOn;
+ return a;
+}
+
+void DomResourceIcon::setElementNormalOn(DomResourcePixmap* a)
+{
+ delete m_normalOn;
+ m_children |= NormalOn;
+ m_normalOn = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementDisabledOff()
+{
+ DomResourcePixmap* a = m_disabledOff;
+ m_disabledOff = 0;
+ m_children ^= DisabledOff;
+ return a;
+}
+
+void DomResourceIcon::setElementDisabledOff(DomResourcePixmap* a)
+{
+ delete m_disabledOff;
+ m_children |= DisabledOff;
+ m_disabledOff = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementDisabledOn()
+{
+ DomResourcePixmap* a = m_disabledOn;
+ m_disabledOn = 0;
+ m_children ^= DisabledOn;
+ return a;
+}
+
+void DomResourceIcon::setElementDisabledOn(DomResourcePixmap* a)
+{
+ delete m_disabledOn;
+ m_children |= DisabledOn;
+ m_disabledOn = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementActiveOff()
+{
+ DomResourcePixmap* a = m_activeOff;
+ m_activeOff = 0;
+ m_children ^= ActiveOff;
+ return a;
+}
+
+void DomResourceIcon::setElementActiveOff(DomResourcePixmap* a)
+{
+ delete m_activeOff;
+ m_children |= ActiveOff;
+ m_activeOff = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementActiveOn()
+{
+ DomResourcePixmap* a = m_activeOn;
+ m_activeOn = 0;
+ m_children ^= ActiveOn;
+ return a;
+}
+
+void DomResourceIcon::setElementActiveOn(DomResourcePixmap* a)
+{
+ delete m_activeOn;
+ m_children |= ActiveOn;
+ m_activeOn = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementSelectedOff()
+{
+ DomResourcePixmap* a = m_selectedOff;
+ m_selectedOff = 0;
+ m_children ^= SelectedOff;
+ return a;
+}
+
+void DomResourceIcon::setElementSelectedOff(DomResourcePixmap* a)
+{
+ delete m_selectedOff;
+ m_children |= SelectedOff;
+ m_selectedOff = a;
+}
+
+DomResourcePixmap* DomResourceIcon::takeElementSelectedOn()
+{
+ DomResourcePixmap* a = m_selectedOn;
+ m_selectedOn = 0;
+ m_children ^= SelectedOn;
+ return a;
+}
+
+void DomResourceIcon::setElementSelectedOn(DomResourcePixmap* a)
+{
+ delete m_selectedOn;
+ m_children |= SelectedOn;
+ m_selectedOn = a;
+}
+
+void DomResourceIcon::clearElementNormalOff()
+{
+ delete m_normalOff;
+ m_normalOff = 0;
+ m_children &= ~NormalOff;
+}
+
+void DomResourceIcon::clearElementNormalOn()
+{
+ delete m_normalOn;
+ m_normalOn = 0;
+ m_children &= ~NormalOn;
+}
+
+void DomResourceIcon::clearElementDisabledOff()
+{
+ delete m_disabledOff;
+ m_disabledOff = 0;
+ m_children &= ~DisabledOff;
+}
+
+void DomResourceIcon::clearElementDisabledOn()
+{
+ delete m_disabledOn;
+ m_disabledOn = 0;
+ m_children &= ~DisabledOn;
+}
+
+void DomResourceIcon::clearElementActiveOff()
+{
+ delete m_activeOff;
+ m_activeOff = 0;
+ m_children &= ~ActiveOff;
+}
+
+void DomResourceIcon::clearElementActiveOn()
+{
+ delete m_activeOn;
+ m_activeOn = 0;
+ m_children &= ~ActiveOn;
+}
+
+void DomResourceIcon::clearElementSelectedOff()
+{
+ delete m_selectedOff;
+ m_selectedOff = 0;
+ m_children &= ~SelectedOff;
+}
+
+void DomResourceIcon::clearElementSelectedOn()
+{
+ delete m_selectedOn;
+ m_selectedOn = 0;
+ m_children &= ~SelectedOn;
+}
+
+void DomString::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_notr = false;
+ m_has_attr_comment = false;
+ m_has_attr_extraComment = false;
+ }
+
+ m_children = 0;
+}
+
+DomString::DomString()
+{
+ m_children = 0;
+ m_has_attr_notr = false;
+ m_has_attr_comment = false;
+ m_has_attr_extraComment = false;
+ m_text.clear();
+}
+
+DomString::~DomString()
+{
+}
+
+void DomString::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("notr")) {
+ setAttributeNotr(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("comment")) {
+ setAttributeComment(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("extracomment")) {
+ setAttributeExtraComment(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomString::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("string") : tagName.toLower());
+
+ if (hasAttributeNotr())
+ writer.writeAttribute(QStringLiteral("notr"), attributeNotr());
+
+ if (hasAttributeComment())
+ writer.writeAttribute(QStringLiteral("comment"), attributeComment());
+
+ if (hasAttributeExtraComment())
+ writer.writeAttribute(QStringLiteral("extracomment"), attributeExtraComment());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomPointF::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomPointF::DomPointF()
+{
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomPointF::~DomPointF()
+{
+}
+
+void DomPointF::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QString(QLatin1Char('x'))) {
+ setElementX(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QString(QLatin1Char('y'))) {
+ setElementY(reader.readElementText().toDouble());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomPointF::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("pointf") : tagName.toLower());
+
+ if (m_children & X) {
+ writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15));
+ }
+
+ if (m_children & Y) {
+ writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomPointF::setElementX(double a)
+{
+ m_children |= X;
+ m_x = a;
+}
+
+void DomPointF::setElementY(double a)
+{
+ m_children |= Y;
+ m_y = a;
+}
+
+void DomPointF::clearElementX()
+{
+ m_children &= ~X;
+}
+
+void DomPointF::clearElementY()
+{
+ m_children &= ~Y;
+}
+
+void DomRectF::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomRectF::DomRectF()
+{
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomRectF::~DomRectF()
+{
+}
+
+void DomRectF::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QString(QLatin1Char('x'))) {
+ setElementX(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QString(QLatin1Char('y'))) {
+ setElementY(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QStringLiteral("width")) {
+ setElementWidth(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QStringLiteral("height")) {
+ setElementHeight(reader.readElementText().toDouble());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomRectF::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rectf") : tagName.toLower());
+
+ if (m_children & X) {
+ writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15));
+ }
+
+ if (m_children & Y) {
+ writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15));
+ }
+
+ if (m_children & Width) {
+ writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15));
+ }
+
+ if (m_children & Height) {
+ writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomRectF::setElementX(double a)
+{
+ m_children |= X;
+ m_x = a;
+}
+
+void DomRectF::setElementY(double a)
+{
+ m_children |= Y;
+ m_y = a;
+}
+
+void DomRectF::setElementWidth(double a)
+{
+ m_children |= Width;
+ m_width = a;
+}
+
+void DomRectF::setElementHeight(double a)
+{
+ m_children |= Height;
+ m_height = a;
+}
+
+void DomRectF::clearElementX()
+{
+ m_children &= ~X;
+}
+
+void DomRectF::clearElementY()
+{
+ m_children &= ~Y;
+}
+
+void DomRectF::clearElementWidth()
+{
+ m_children &= ~Width;
+}
+
+void DomRectF::clearElementHeight()
+{
+ m_children &= ~Height;
+}
+
+void DomSizeF::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomSizeF::DomSizeF()
+{
+ m_children = 0;
+ m_width = 0;
+ m_height = 0;
+}
+
+DomSizeF::~DomSizeF()
+{
+}
+
+void DomSizeF::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("width")) {
+ setElementWidth(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QStringLiteral("height")) {
+ setElementHeight(reader.readElementText().toDouble());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSizeF::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizef") : tagName.toLower());
+
+ if (m_children & Width) {
+ writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15));
+ }
+
+ if (m_children & Height) {
+ writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSizeF::setElementWidth(double a)
+{
+ m_children |= Width;
+ m_width = a;
+}
+
+void DomSizeF::setElementHeight(double a)
+{
+ m_children |= Height;
+ m_height = a;
+}
+
+void DomSizeF::clearElementWidth()
+{
+ m_children &= ~Width;
+}
+
+void DomSizeF::clearElementHeight()
+{
+ m_children &= ~Height;
+}
+
+void DomChar::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_unicode = 0;
+}
+
+DomChar::DomChar()
+{
+ m_children = 0;
+ m_unicode = 0;
+}
+
+DomChar::~DomChar()
+{
+}
+
+void DomChar::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("unicode")) {
+ setElementUnicode(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomChar::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("char") : tagName.toLower());
+
+ if (m_children & Unicode) {
+ writer.writeTextElement(QStringLiteral("unicode"), QString::number(m_unicode));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomChar::setElementUnicode(int a)
+{
+ m_children |= Unicode;
+ m_unicode = a;
+}
+
+void DomChar::clearElementUnicode()
+{
+ m_children &= ~Unicode;
+}
+
+void DomUrl::clear(bool clear_all)
+{
+ delete m_string;
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_string = 0;
+}
+
+DomUrl::DomUrl()
+{
+ m_children = 0;
+ m_string = 0;
+}
+
+DomUrl::~DomUrl()
+{
+ delete m_string;
+}
+
+void DomUrl::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("string")) {
+ DomString *v = new DomString();
+ v->read(reader);
+ setElementString(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomUrl::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("url") : tagName.toLower());
+
+ if (m_children & String) {
+ m_string->write(writer, QStringLiteral("string"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+DomString* DomUrl::takeElementString()
+{
+ DomString* a = m_string;
+ m_string = 0;
+ m_children ^= String;
+ return a;
+}
+
+void DomUrl::setElementString(DomString* a)
+{
+ delete m_string;
+ m_children |= String;
+ m_string = a;
+}
+
+void DomUrl::clearElementString()
+{
+ delete m_string;
+ m_string = 0;
+ m_children &= ~String;
+}
+
+void DomProperty::clear(bool clear_all)
+{
+ delete m_color;
+ delete m_font;
+ delete m_iconSet;
+ delete m_pixmap;
+ delete m_palette;
+ delete m_point;
+ delete m_rect;
+ delete m_locale;
+ delete m_sizePolicy;
+ delete m_size;
+ delete m_string;
+ delete m_stringList;
+ delete m_date;
+ delete m_time;
+ delete m_dateTime;
+ delete m_pointF;
+ delete m_rectF;
+ delete m_sizeF;
+ delete m_char;
+ delete m_url;
+ delete m_brush;
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ m_has_attr_stdset = false;
+ m_attr_stdset = 0;
+ }
+
+ m_kind = Unknown;
+
+ m_color = 0;
+ m_cursor = 0;
+ m_font = 0;
+ m_iconSet = 0;
+ m_pixmap = 0;
+ m_palette = 0;
+ m_point = 0;
+ m_rect = 0;
+ m_locale = 0;
+ m_sizePolicy = 0;
+ m_size = 0;
+ m_string = 0;
+ m_stringList = 0;
+ m_number = 0;
+ m_float = 0.0;
+ m_double = 0;
+ m_date = 0;
+ m_time = 0;
+ m_dateTime = 0;
+ m_pointF = 0;
+ m_rectF = 0;
+ m_sizeF = 0;
+ m_longLong = 0;
+ m_char = 0;
+ m_url = 0;
+ m_UInt = 0;
+ m_uLongLong = 0;
+ m_brush = 0;
+}
+
+DomProperty::DomProperty()
+{
+ m_kind = Unknown;
+
+ m_has_attr_name = false;
+ m_has_attr_stdset = false;
+ m_attr_stdset = 0;
+ m_color = 0;
+ m_cursor = 0;
+ m_font = 0;
+ m_iconSet = 0;
+ m_pixmap = 0;
+ m_palette = 0;
+ m_point = 0;
+ m_rect = 0;
+ m_locale = 0;
+ m_sizePolicy = 0;
+ m_size = 0;
+ m_string = 0;
+ m_stringList = 0;
+ m_number = 0;
+ m_float = 0.0;
+ m_double = 0;
+ m_date = 0;
+ m_time = 0;
+ m_dateTime = 0;
+ m_pointF = 0;
+ m_rectF = 0;
+ m_sizeF = 0;
+ m_longLong = 0;
+ m_char = 0;
+ m_url = 0;
+ m_UInt = 0;
+ m_uLongLong = 0;
+ m_brush = 0;
+}
+
+DomProperty::~DomProperty()
+{
+ delete m_color;
+ delete m_font;
+ delete m_iconSet;
+ delete m_pixmap;
+ delete m_palette;
+ delete m_point;
+ delete m_rect;
+ delete m_locale;
+ delete m_sizePolicy;
+ delete m_size;
+ delete m_string;
+ delete m_stringList;
+ delete m_date;
+ delete m_time;
+ delete m_dateTime;
+ delete m_pointF;
+ delete m_rectF;
+ delete m_sizeF;
+ delete m_char;
+ delete m_url;
+ delete m_brush;
+}
+
+void DomProperty::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("stdset")) {
+ setAttributeStdset(attribute.value().toString().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("bool")) {
+ setElementBool(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("color")) {
+ DomColor *v = new DomColor();
+ v->read(reader);
+ setElementColor(v);
+ continue;
+ }
+ if (tag == QStringLiteral("cstring")) {
+ setElementCstring(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("cursor")) {
+ setElementCursor(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("cursorshape")) {
+ setElementCursorShape(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("enum")) {
+ setElementEnum(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("font")) {
+ DomFont *v = new DomFont();
+ v->read(reader);
+ setElementFont(v);
+ continue;
+ }
+ if (tag == QStringLiteral("iconset")) {
+ DomResourceIcon *v = new DomResourceIcon();
+ v->read(reader);
+ setElementIconSet(v);
+ continue;
+ }
+ if (tag == QStringLiteral("pixmap")) {
+ DomResourcePixmap *v = new DomResourcePixmap();
+ v->read(reader);
+ setElementPixmap(v);
+ continue;
+ }
+ if (tag == QStringLiteral("palette")) {
+ DomPalette *v = new DomPalette();
+ v->read(reader);
+ setElementPalette(v);
+ continue;
+ }
+ if (tag == QStringLiteral("point")) {
+ DomPoint *v = new DomPoint();
+ v->read(reader);
+ setElementPoint(v);
+ continue;
+ }
+ if (tag == QStringLiteral("rect")) {
+ DomRect *v = new DomRect();
+ v->read(reader);
+ setElementRect(v);
+ continue;
+ }
+ if (tag == QStringLiteral("set")) {
+ setElementSet(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("locale")) {
+ DomLocale *v = new DomLocale();
+ v->read(reader);
+ setElementLocale(v);
+ continue;
+ }
+ if (tag == QStringLiteral("sizepolicy")) {
+ DomSizePolicy *v = new DomSizePolicy();
+ v->read(reader);
+ setElementSizePolicy(v);
+ continue;
+ }
+ if (tag == QStringLiteral("size")) {
+ DomSize *v = new DomSize();
+ v->read(reader);
+ setElementSize(v);
+ continue;
+ }
+ if (tag == QStringLiteral("string")) {
+ DomString *v = new DomString();
+ v->read(reader);
+ setElementString(v);
+ continue;
+ }
+ if (tag == QStringLiteral("stringlist")) {
+ DomStringList *v = new DomStringList();
+ v->read(reader);
+ setElementStringList(v);
+ continue;
+ }
+ if (tag == QStringLiteral("number")) {
+ setElementNumber(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QStringLiteral("float")) {
+ setElementFloat(reader.readElementText().toFloat());
+ continue;
+ }
+ if (tag == QStringLiteral("double")) {
+ setElementDouble(reader.readElementText().toDouble());
+ continue;
+ }
+ if (tag == QStringLiteral("date")) {
+ DomDate *v = new DomDate();
+ v->read(reader);
+ setElementDate(v);
+ continue;
+ }
+ if (tag == QStringLiteral("time")) {
+ DomTime *v = new DomTime();
+ v->read(reader);
+ setElementTime(v);
+ continue;
+ }
+ if (tag == QStringLiteral("datetime")) {
+ DomDateTime *v = new DomDateTime();
+ v->read(reader);
+ setElementDateTime(v);
+ continue;
+ }
+ if (tag == QStringLiteral("pointf")) {
+ DomPointF *v = new DomPointF();
+ v->read(reader);
+ setElementPointF(v);
+ continue;
+ }
+ if (tag == QStringLiteral("rectf")) {
+ DomRectF *v = new DomRectF();
+ v->read(reader);
+ setElementRectF(v);
+ continue;
+ }
+ if (tag == QStringLiteral("sizef")) {
+ DomSizeF *v = new DomSizeF();
+ v->read(reader);
+ setElementSizeF(v);
+ continue;
+ }
+ if (tag == QStringLiteral("longlong")) {
+ setElementLongLong(reader.readElementText().toLongLong());
+ continue;
+ }
+ if (tag == QStringLiteral("char")) {
+ DomChar *v = new DomChar();
+ v->read(reader);
+ setElementChar(v);
+ continue;
+ }
+ if (tag == QStringLiteral("url")) {
+ DomUrl *v = new DomUrl();
+ v->read(reader);
+ setElementUrl(v);
+ continue;
+ }
+ if (tag == QStringLiteral("uint")) {
+ setElementUInt(reader.readElementText().toUInt());
+ continue;
+ }
+ if (tag == QStringLiteral("ulonglong")) {
+ setElementULongLong(reader.readElementText().toULongLong());
+ continue;
+ }
+ if (tag == QStringLiteral("brush")) {
+ DomBrush *v = new DomBrush();
+ v->read(reader);
+ setElementBrush(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomProperty::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("property") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (hasAttributeStdset())
+ writer.writeAttribute(QStringLiteral("stdset"), QString::number(attributeStdset()));
+
+ switch (kind()) {
+ case Bool: {
+ writer.writeTextElement(QStringLiteral("bool"), elementBool());
+ break;
+ }
+ case Color: {
+ DomColor* v = elementColor();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("color"));
+ }
+ break;
+ }
+ case Cstring: {
+ writer.writeTextElement(QStringLiteral("cstring"), elementCstring());
+ break;
+ }
+ case Cursor: {
+ writer.writeTextElement(QStringLiteral("cursor"), QString::number(elementCursor()));
+ break;
+ }
+ case CursorShape: {
+ writer.writeTextElement(QStringLiteral("cursorShape"), elementCursorShape());
+ break;
+ }
+ case Enum: {
+ writer.writeTextElement(QStringLiteral("enum"), elementEnum());
+ break;
+ }
+ case Font: {
+ DomFont* v = elementFont();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("font"));
+ }
+ break;
+ }
+ case IconSet: {
+ DomResourceIcon* v = elementIconSet();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("iconset"));
+ }
+ break;
+ }
+ case Pixmap: {
+ DomResourcePixmap* v = elementPixmap();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("pixmap"));
+ }
+ break;
+ }
+ case Palette: {
+ DomPalette* v = elementPalette();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("palette"));
+ }
+ break;
+ }
+ case Point: {
+ DomPoint* v = elementPoint();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("point"));
+ }
+ break;
+ }
+ case Rect: {
+ DomRect* v = elementRect();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("rect"));
+ }
+ break;
+ }
+ case Set: {
+ writer.writeTextElement(QStringLiteral("set"), elementSet());
+ break;
+ }
+ case Locale: {
+ DomLocale* v = elementLocale();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("locale"));
+ }
+ break;
+ }
+ case SizePolicy: {
+ DomSizePolicy* v = elementSizePolicy();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("sizepolicy"));
+ }
+ break;
+ }
+ case Size: {
+ DomSize* v = elementSize();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("size"));
+ }
+ break;
+ }
+ case String: {
+ DomString* v = elementString();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("string"));
+ }
+ break;
+ }
+ case StringList: {
+ DomStringList* v = elementStringList();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("stringlist"));
+ }
+ break;
+ }
+ case Number: {
+ writer.writeTextElement(QStringLiteral("number"), QString::number(elementNumber()));
+ break;
+ }
+ case Float: {
+ writer.writeTextElement(QStringLiteral("float"), QString::number(elementFloat(), 'f', 8));
+ break;
+ }
+ case Double: {
+ writer.writeTextElement(QStringLiteral("double"), QString::number(elementDouble(), 'f', 15));
+ break;
+ }
+ case Date: {
+ DomDate* v = elementDate();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("date"));
+ }
+ break;
+ }
+ case Time: {
+ DomTime* v = elementTime();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("time"));
+ }
+ break;
+ }
+ case DateTime: {
+ DomDateTime* v = elementDateTime();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("datetime"));
+ }
+ break;
+ }
+ case PointF: {
+ DomPointF* v = elementPointF();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("pointf"));
+ }
+ break;
+ }
+ case RectF: {
+ DomRectF* v = elementRectF();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("rectf"));
+ }
+ break;
+ }
+ case SizeF: {
+ DomSizeF* v = elementSizeF();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("sizef"));
+ }
+ break;
+ }
+ case LongLong: {
+ writer.writeTextElement(QStringLiteral("longLong"), QString::number(elementLongLong()));
+ break;
+ }
+ case Char: {
+ DomChar* v = elementChar();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("char"));
+ }
+ break;
+ }
+ case Url: {
+ DomUrl* v = elementUrl();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("url"));
+ }
+ break;
+ }
+ case UInt: {
+ writer.writeTextElement(QStringLiteral("UInt"), QString::number(elementUInt()));
+ break;
+ }
+ case ULongLong: {
+ writer.writeTextElement(QStringLiteral("uLongLong"), QString::number(elementULongLong()));
+ break;
+ }
+ case Brush: {
+ DomBrush* v = elementBrush();
+ if (v != 0) {
+ v->write(writer, QStringLiteral("brush"));
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomProperty::setElementBool(const QString& a)
+{
+ clear(false);
+ m_kind = Bool;
+ m_bool = a;
+}
+
+DomColor* DomProperty::takeElementColor()
+{
+ DomColor* a = m_color;
+ m_color = 0;
+ return a;
+}
+
+void DomProperty::setElementColor(DomColor* a)
+{
+ clear(false);
+ m_kind = Color;
+ m_color = a;
+}
+
+void DomProperty::setElementCstring(const QString& a)
+{
+ clear(false);
+ m_kind = Cstring;
+ m_cstring = a;
+}
+
+void DomProperty::setElementCursor(int a)
+{
+ clear(false);
+ m_kind = Cursor;
+ m_cursor = a;
+}
+
+void DomProperty::setElementCursorShape(const QString& a)
+{
+ clear(false);
+ m_kind = CursorShape;
+ m_cursorShape = a;
+}
+
+void DomProperty::setElementEnum(const QString& a)
+{
+ clear(false);
+ m_kind = Enum;
+ m_enum = a;
+}
+
+DomFont* DomProperty::takeElementFont()
+{
+ DomFont* a = m_font;
+ m_font = 0;
+ return a;
+}
+
+void DomProperty::setElementFont(DomFont* a)
+{
+ clear(false);
+ m_kind = Font;
+ m_font = a;
+}
+
+DomResourceIcon* DomProperty::takeElementIconSet()
+{
+ DomResourceIcon* a = m_iconSet;
+ m_iconSet = 0;
+ return a;
+}
+
+void DomProperty::setElementIconSet(DomResourceIcon* a)
+{
+ clear(false);
+ m_kind = IconSet;
+ m_iconSet = a;
+}
+
+DomResourcePixmap* DomProperty::takeElementPixmap()
+{
+ DomResourcePixmap* a = m_pixmap;
+ m_pixmap = 0;
+ return a;
+}
+
+void DomProperty::setElementPixmap(DomResourcePixmap* a)
+{
+ clear(false);
+ m_kind = Pixmap;
+ m_pixmap = a;
+}
+
+DomPalette* DomProperty::takeElementPalette()
+{
+ DomPalette* a = m_palette;
+ m_palette = 0;
+ return a;
+}
+
+void DomProperty::setElementPalette(DomPalette* a)
+{
+ clear(false);
+ m_kind = Palette;
+ m_palette = a;
+}
+
+DomPoint* DomProperty::takeElementPoint()
+{
+ DomPoint* a = m_point;
+ m_point = 0;
+ return a;
+}
+
+void DomProperty::setElementPoint(DomPoint* a)
+{
+ clear(false);
+ m_kind = Point;
+ m_point = a;
+}
+
+DomRect* DomProperty::takeElementRect()
+{
+ DomRect* a = m_rect;
+ m_rect = 0;
+ return a;
+}
+
+void DomProperty::setElementRect(DomRect* a)
+{
+ clear(false);
+ m_kind = Rect;
+ m_rect = a;
+}
+
+void DomProperty::setElementSet(const QString& a)
+{
+ clear(false);
+ m_kind = Set;
+ m_set = a;
+}
+
+DomLocale* DomProperty::takeElementLocale()
+{
+ DomLocale* a = m_locale;
+ m_locale = 0;
+ return a;
+}
+
+void DomProperty::setElementLocale(DomLocale* a)
+{
+ clear(false);
+ m_kind = Locale;
+ m_locale = a;
+}
+
+DomSizePolicy* DomProperty::takeElementSizePolicy()
+{
+ DomSizePolicy* a = m_sizePolicy;
+ m_sizePolicy = 0;
+ return a;
+}
+
+void DomProperty::setElementSizePolicy(DomSizePolicy* a)
+{
+ clear(false);
+ m_kind = SizePolicy;
+ m_sizePolicy = a;
+}
+
+DomSize* DomProperty::takeElementSize()
+{
+ DomSize* a = m_size;
+ m_size = 0;
+ return a;
+}
+
+void DomProperty::setElementSize(DomSize* a)
+{
+ clear(false);
+ m_kind = Size;
+ m_size = a;
+}
+
+DomString* DomProperty::takeElementString()
+{
+ DomString* a = m_string;
+ m_string = 0;
+ return a;
+}
+
+void DomProperty::setElementString(DomString* a)
+{
+ clear(false);
+ m_kind = String;
+ m_string = a;
+}
+
+DomStringList* DomProperty::takeElementStringList()
+{
+ DomStringList* a = m_stringList;
+ m_stringList = 0;
+ return a;
+}
+
+void DomProperty::setElementStringList(DomStringList* a)
+{
+ clear(false);
+ m_kind = StringList;
+ m_stringList = a;
+}
+
+void DomProperty::setElementNumber(int a)
+{
+ clear(false);
+ m_kind = Number;
+ m_number = a;
+}
+
+void DomProperty::setElementFloat(float a)
+{
+ clear(false);
+ m_kind = Float;
+ m_float = a;
+}
+
+void DomProperty::setElementDouble(double a)
+{
+ clear(false);
+ m_kind = Double;
+ m_double = a;
+}
+
+DomDate* DomProperty::takeElementDate()
+{
+ DomDate* a = m_date;
+ m_date = 0;
+ return a;
+}
+
+void DomProperty::setElementDate(DomDate* a)
+{
+ clear(false);
+ m_kind = Date;
+ m_date = a;
+}
+
+DomTime* DomProperty::takeElementTime()
+{
+ DomTime* a = m_time;
+ m_time = 0;
+ return a;
+}
+
+void DomProperty::setElementTime(DomTime* a)
+{
+ clear(false);
+ m_kind = Time;
+ m_time = a;
+}
+
+DomDateTime* DomProperty::takeElementDateTime()
+{
+ DomDateTime* a = m_dateTime;
+ m_dateTime = 0;
+ return a;
+}
+
+void DomProperty::setElementDateTime(DomDateTime* a)
+{
+ clear(false);
+ m_kind = DateTime;
+ m_dateTime = a;
+}
+
+DomPointF* DomProperty::takeElementPointF()
+{
+ DomPointF* a = m_pointF;
+ m_pointF = 0;
+ return a;
+}
+
+void DomProperty::setElementPointF(DomPointF* a)
+{
+ clear(false);
+ m_kind = PointF;
+ m_pointF = a;
+}
+
+DomRectF* DomProperty::takeElementRectF()
+{
+ DomRectF* a = m_rectF;
+ m_rectF = 0;
+ return a;
+}
+
+void DomProperty::setElementRectF(DomRectF* a)
+{
+ clear(false);
+ m_kind = RectF;
+ m_rectF = a;
+}
+
+DomSizeF* DomProperty::takeElementSizeF()
+{
+ DomSizeF* a = m_sizeF;
+ m_sizeF = 0;
+ return a;
+}
+
+void DomProperty::setElementSizeF(DomSizeF* a)
+{
+ clear(false);
+ m_kind = SizeF;
+ m_sizeF = a;
+}
+
+void DomProperty::setElementLongLong(qlonglong a)
+{
+ clear(false);
+ m_kind = LongLong;
+ m_longLong = a;
+}
+
+DomChar* DomProperty::takeElementChar()
+{
+ DomChar* a = m_char;
+ m_char = 0;
+ return a;
+}
+
+void DomProperty::setElementChar(DomChar* a)
+{
+ clear(false);
+ m_kind = Char;
+ m_char = a;
+}
+
+DomUrl* DomProperty::takeElementUrl()
+{
+ DomUrl* a = m_url;
+ m_url = 0;
+ return a;
+}
+
+void DomProperty::setElementUrl(DomUrl* a)
+{
+ clear(false);
+ m_kind = Url;
+ m_url = a;
+}
+
+void DomProperty::setElementUInt(uint a)
+{
+ clear(false);
+ m_kind = UInt;
+ m_UInt = a;
+}
+
+void DomProperty::setElementULongLong(qulonglong a)
+{
+ clear(false);
+ m_kind = ULongLong;
+ m_uLongLong = a;
+}
+
+DomBrush* DomProperty::takeElementBrush()
+{
+ DomBrush* a = m_brush;
+ m_brush = 0;
+ return a;
+}
+
+void DomProperty::setElementBrush(DomBrush* a)
+{
+ clear(false);
+ m_kind = Brush;
+ m_brush = a;
+}
+
+void DomConnections::clear(bool clear_all)
+{
+ qDeleteAll(m_connection);
+ m_connection.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomConnections::DomConnections()
+{
+ m_children = 0;
+}
+
+DomConnections::~DomConnections()
+{
+ qDeleteAll(m_connection);
+ m_connection.clear();
+}
+
+void DomConnections::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("connection")) {
+ DomConnection *v = new DomConnection();
+ v->read(reader);
+ m_connection.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomConnections::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connections") : tagName.toLower());
+
+ for (int i = 0; i < m_connection.size(); ++i) {
+ DomConnection* v = m_connection[i];
+ v->write(writer, QStringLiteral("connection"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomConnections::setElementConnection(const QList<DomConnection*>& a)
+{
+ m_children |= Connection;
+ m_connection = a;
+}
+
+void DomConnection::clear(bool clear_all)
+{
+ delete m_hints;
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+ m_hints = 0;
+}
+
+DomConnection::DomConnection()
+{
+ m_children = 0;
+ m_hints = 0;
+}
+
+DomConnection::~DomConnection()
+{
+ delete m_hints;
+}
+
+void DomConnection::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("sender")) {
+ setElementSender(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("signal")) {
+ setElementSignal(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("receiver")) {
+ setElementReceiver(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("slot")) {
+ setElementSlot(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("hints")) {
+ DomConnectionHints *v = new DomConnectionHints();
+ v->read(reader);
+ setElementHints(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomConnection::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connection") : tagName.toLower());
+
+ if (m_children & Sender) {
+ writer.writeTextElement(QStringLiteral("sender"), m_sender);
+ }
+
+ if (m_children & Signal) {
+ writer.writeTextElement(QStringLiteral("signal"), m_signal);
+ }
+
+ if (m_children & Receiver) {
+ writer.writeTextElement(QStringLiteral("receiver"), m_receiver);
+ }
+
+ if (m_children & Slot) {
+ writer.writeTextElement(QStringLiteral("slot"), m_slot);
+ }
+
+ if (m_children & Hints) {
+ m_hints->write(writer, QStringLiteral("hints"));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomConnection::setElementSender(const QString& a)
+{
+ m_children |= Sender;
+ m_sender = a;
+}
+
+void DomConnection::setElementSignal(const QString& a)
+{
+ m_children |= Signal;
+ m_signal = a;
+}
+
+void DomConnection::setElementReceiver(const QString& a)
+{
+ m_children |= Receiver;
+ m_receiver = a;
+}
+
+void DomConnection::setElementSlot(const QString& a)
+{
+ m_children |= Slot;
+ m_slot = a;
+}
+
+DomConnectionHints* DomConnection::takeElementHints()
+{
+ DomConnectionHints* a = m_hints;
+ m_hints = 0;
+ m_children ^= Hints;
+ return a;
+}
+
+void DomConnection::setElementHints(DomConnectionHints* a)
+{
+ delete m_hints;
+ m_children |= Hints;
+ m_hints = a;
+}
+
+void DomConnection::clearElementSender()
+{
+ m_children &= ~Sender;
+}
+
+void DomConnection::clearElementSignal()
+{
+ m_children &= ~Signal;
+}
+
+void DomConnection::clearElementReceiver()
+{
+ m_children &= ~Receiver;
+}
+
+void DomConnection::clearElementSlot()
+{
+ m_children &= ~Slot;
+}
+
+void DomConnection::clearElementHints()
+{
+ delete m_hints;
+ m_hints = 0;
+ m_children &= ~Hints;
+}
+
+void DomConnectionHints::clear(bool clear_all)
+{
+ qDeleteAll(m_hint);
+ m_hint.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomConnectionHints::DomConnectionHints()
+{
+ m_children = 0;
+}
+
+DomConnectionHints::~DomConnectionHints()
+{
+ qDeleteAll(m_hint);
+ m_hint.clear();
+}
+
+void DomConnectionHints::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("hint")) {
+ DomConnectionHint *v = new DomConnectionHint();
+ v->read(reader);
+ m_hint.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomConnectionHints::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhints") : tagName.toLower());
+
+ for (int i = 0; i < m_hint.size(); ++i) {
+ DomConnectionHint* v = m_hint[i];
+ v->write(writer, QStringLiteral("hint"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomConnectionHints::setElementHint(const QList<DomConnectionHint*>& a)
+{
+ m_children |= Hint;
+ m_hint = a;
+}
+
+void DomConnectionHint::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_type = false;
+ }
+
+ m_children = 0;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomConnectionHint::DomConnectionHint()
+{
+ m_children = 0;
+ m_has_attr_type = false;
+ m_x = 0;
+ m_y = 0;
+}
+
+DomConnectionHint::~DomConnectionHint()
+{
+}
+
+void DomConnectionHint::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("type")) {
+ setAttributeType(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QString(QLatin1Char('x'))) {
+ setElementX(reader.readElementText().toInt());
+ continue;
+ }
+ if (tag == QString(QLatin1Char('y'))) {
+ setElementY(reader.readElementText().toInt());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomConnectionHint::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhint") : tagName.toLower());
+
+ if (hasAttributeType())
+ writer.writeAttribute(QStringLiteral("type"), attributeType());
+
+ if (m_children & X) {
+ writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x));
+ }
+
+ if (m_children & Y) {
+ writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y));
+ }
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomConnectionHint::setElementX(int a)
+{
+ m_children |= X;
+ m_x = a;
+}
+
+void DomConnectionHint::setElementY(int a)
+{
+ m_children |= Y;
+ m_y = a;
+}
+
+void DomConnectionHint::clearElementX()
+{
+ m_children &= ~X;
+}
+
+void DomConnectionHint::clearElementY()
+{
+ m_children &= ~Y;
+}
+
+void DomScript::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_source = false;
+ m_has_attr_language = false;
+ }
+
+ m_children = 0;
+}
+
+DomScript::DomScript()
+{
+ m_children = 0;
+ m_has_attr_source = false;
+ m_has_attr_language = false;
+}
+
+DomScript::~DomScript()
+{
+}
+
+void DomScript::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("source")) {
+ setAttributeSource(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("language")) {
+ setAttributeLanguage(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomScript::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("script") : tagName.toLower());
+
+ if (hasAttributeSource())
+ writer.writeAttribute(QStringLiteral("source"), attributeSource());
+
+ if (hasAttributeLanguage())
+ writer.writeAttribute(QStringLiteral("language"), attributeLanguage());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomWidgetData::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomWidgetData::DomWidgetData()
+{
+ m_children = 0;
+}
+
+DomWidgetData::~DomWidgetData()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomWidgetData::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomWidgetData::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widgetdata") : tagName.toLower());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomWidgetData::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomDesignerData::clear(bool clear_all)
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomDesignerData::DomDesignerData()
+{
+ m_children = 0;
+}
+
+DomDesignerData::~DomDesignerData()
+{
+ qDeleteAll(m_property);
+ m_property.clear();
+}
+
+void DomDesignerData::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("property")) {
+ DomProperty *v = new DomProperty();
+ v->read(reader);
+ m_property.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomDesignerData::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("designerdata") : tagName.toLower());
+
+ for (int i = 0; i < m_property.size(); ++i) {
+ DomProperty* v = m_property[i];
+ v->write(writer, QStringLiteral("property"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomDesignerData::setElementProperty(const QList<DomProperty*>& a)
+{
+ m_children |= Property;
+ m_property = a;
+}
+
+void DomSlots::clear(bool clear_all)
+{
+ m_signal.clear();
+ m_slot.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomSlots::DomSlots()
+{
+ m_children = 0;
+}
+
+DomSlots::~DomSlots()
+{
+ m_signal.clear();
+ m_slot.clear();
+}
+
+void DomSlots::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("signal")) {
+ m_signal.append(reader.readElementText());
+ continue;
+ }
+ if (tag == QStringLiteral("slot")) {
+ m_slot.append(reader.readElementText());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomSlots::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("slots") : tagName.toLower());
+
+ for (int i = 0; i < m_signal.size(); ++i) {
+ QString v = m_signal[i];
+ writer.writeTextElement(QStringLiteral("signal"), v);
+ }
+ for (int i = 0; i < m_slot.size(); ++i) {
+ QString v = m_slot[i];
+ writer.writeTextElement(QStringLiteral("slot"), v);
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomSlots::setElementSignal(const QStringList& a)
+{
+ m_children |= Signal;
+ m_signal = a;
+}
+
+void DomSlots::setElementSlot(const QStringList& a)
+{
+ m_children |= Slot;
+ m_slot = a;
+}
+
+void DomPropertySpecifications::clear(bool clear_all)
+{
+ qDeleteAll(m_stringpropertyspecification);
+ m_stringpropertyspecification.clear();
+
+ if (clear_all) {
+ m_text.clear();
+ }
+
+ m_children = 0;
+}
+
+DomPropertySpecifications::DomPropertySpecifications()
+{
+ m_children = 0;
+}
+
+DomPropertySpecifications::~DomPropertySpecifications()
+{
+ qDeleteAll(m_stringpropertyspecification);
+ m_stringpropertyspecification.clear();
+}
+
+void DomPropertySpecifications::read(QXmlStreamReader &reader)
+{
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ if (tag == QStringLiteral("stringpropertyspecification")) {
+ DomStringPropertySpecification *v = new DomStringPropertySpecification();
+ v->read(reader);
+ m_stringpropertyspecification.append(v);
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertyspecifications") : tagName.toLower());
+
+ for (int i = 0; i < m_stringpropertyspecification.size(); ++i) {
+ DomStringPropertySpecification* v = m_stringpropertyspecification[i];
+ v->write(writer, QStringLiteral("stringpropertyspecification"));
+ }
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+void DomPropertySpecifications::setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a)
+{
+ m_children |= Stringpropertyspecification;
+ m_stringpropertyspecification = a;
+}
+
+void DomStringPropertySpecification::clear(bool clear_all)
+{
+
+ if (clear_all) {
+ m_text.clear();
+ m_has_attr_name = false;
+ m_has_attr_type = false;
+ m_has_attr_notr = false;
+ }
+
+ m_children = 0;
+}
+
+DomStringPropertySpecification::DomStringPropertySpecification()
+{
+ m_children = 0;
+ m_has_attr_name = false;
+ m_has_attr_type = false;
+ m_has_attr_notr = false;
+}
+
+DomStringPropertySpecification::~DomStringPropertySpecification()
+{
+}
+
+void DomStringPropertySpecification::read(QXmlStreamReader &reader)
+{
+
+ foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
+ QStringRef name = attribute.name();
+ if (name == QStringLiteral("name")) {
+ setAttributeName(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("type")) {
+ setAttributeType(attribute.value().toString());
+ continue;
+ }
+ if (name == QStringLiteral("notr")) {
+ setAttributeNotr(attribute.value().toString());
+ continue;
+ }
+ reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
+ }
+
+ for (bool finished = false; !finished && !reader.hasError();) {
+ switch (reader.readNext()) {
+ case QXmlStreamReader::StartElement : {
+ const QString tag = reader.name().toString().toLower();
+ reader.raiseError(QStringLiteral("Unexpected element ") + tag);
+ }
+ break;
+ case QXmlStreamReader::EndElement :
+ finished = true;
+ break;
+ case QXmlStreamReader::Characters :
+ if (!reader.isWhitespace())
+ m_text.append(reader.text().toString());
+ break;
+ default :
+ break;
+ }
+ }
+}
+
+void DomStringPropertySpecification::write(QXmlStreamWriter &writer, const QString &tagName) const
+{
+ writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringpropertyspecification") : tagName.toLower());
+
+ if (hasAttributeName())
+ writer.writeAttribute(QStringLiteral("name"), attributeName());
+
+ if (hasAttributeType())
+ writer.writeAttribute(QStringLiteral("type"), attributeType());
+
+ if (hasAttributeNotr())
+ writer.writeAttribute(QStringLiteral("notr"), attributeNotr());
+
+ if (!m_text.isEmpty())
+ writer.writeCharacters(m_text);
+
+ writer.writeEndElement();
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/designer/src/lib/uilib/ui4_p.h b/src/designer/src/lib/uilib/ui4_p.h
new file mode 100644
index 000000000..6a56c9ead
--- /dev/null
+++ b/src/designer/src/lib/uilib/ui4_p.h
@@ -0,0 +1,3603 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of Qt Designer. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+
+#ifndef UI4_H
+#define UI4_H
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QXmlStreamReader>
+#include <QtCore/QXmlStreamWriter>
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+#define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT
+#define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT
+
+#if defined(QT_DESIGNER_STATIC) || defined(QT_UIC) || defined(QT_UIC3)
+# define QDESIGNER_UILIB_EXPORT
+#elif defined(QDESIGNER_UILIB_LIBRARY)
+# define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_EXTERN
+#else
+# define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_IMPORT
+#endif
+
+#ifndef QDESIGNER_UILIB_EXPORT
+# define QDESIGNER_UILIB_EXPORT
+#endif
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+
+/*******************************************************************************
+** Forward declarations
+*/
+
+class DomUI;
+class DomIncludes;
+class DomInclude;
+class DomResources;
+class DomResource;
+class DomActionGroup;
+class DomAction;
+class DomActionRef;
+class DomButtonGroup;
+class DomButtonGroups;
+class DomImages;
+class DomImage;
+class DomImageData;
+class DomCustomWidgets;
+class DomHeader;
+class DomCustomWidget;
+class DomProperties;
+class DomPropertyData;
+class DomSizePolicyData;
+class DomLayoutDefault;
+class DomLayoutFunction;
+class DomTabStops;
+class DomLayout;
+class DomLayoutItem;
+class DomRow;
+class DomColumn;
+class DomItem;
+class DomWidget;
+class DomSpacer;
+class DomColor;
+class DomGradientStop;
+class DomGradient;
+class DomBrush;
+class DomColorRole;
+class DomColorGroup;
+class DomPalette;
+class DomFont;
+class DomPoint;
+class DomRect;
+class DomLocale;
+class DomSizePolicy;
+class DomSize;
+class DomDate;
+class DomTime;
+class DomDateTime;
+class DomStringList;
+class DomResourcePixmap;
+class DomResourceIcon;
+class DomString;
+class DomPointF;
+class DomRectF;
+class DomSizeF;
+class DomChar;
+class DomUrl;
+class DomProperty;
+class DomConnections;
+class DomConnection;
+class DomConnectionHints;
+class DomConnectionHint;
+class DomScript;
+class DomWidgetData;
+class DomDesignerData;
+class DomSlots;
+class DomPropertySpecifications;
+class DomStringPropertySpecification;
+
+/*******************************************************************************
+** Declarations
+*/
+
+class QDESIGNER_UILIB_EXPORT DomUI {
+public:
+ DomUI();
+ ~DomUI();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeVersion() const { return m_has_attr_version; }
+ inline QString attributeVersion() const { return m_attr_version; }
+ inline void setAttributeVersion(const QString& a) { m_attr_version = a; m_has_attr_version = true; }
+ inline void clearAttributeVersion() { m_has_attr_version = false; }
+
+ inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+ inline QString attributeLanguage() const { return m_attr_language; }
+ inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+ inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+ inline bool hasAttributeDisplayname() const { return m_has_attr_displayname; }
+ inline QString attributeDisplayname() const { return m_attr_displayname; }
+ inline void setAttributeDisplayname(const QString& a) { m_attr_displayname = a; m_has_attr_displayname = true; }
+ inline void clearAttributeDisplayname() { m_has_attr_displayname = false; }
+
+ inline bool hasAttributeStdsetdef() const { return m_has_attr_stdsetdef; }
+ inline int attributeStdsetdef() const { return m_attr_stdsetdef; }
+ inline void setAttributeStdsetdef(int a) { m_attr_stdsetdef = a; m_has_attr_stdsetdef = true; }
+ inline void clearAttributeStdsetdef() { m_has_attr_stdsetdef = false; }
+
+ inline bool hasAttributeStdSetDef() const { return m_has_attr_stdSetDef; }
+ inline int attributeStdSetDef() const { return m_attr_stdSetDef; }
+ inline void setAttributeStdSetDef(int a) { m_attr_stdSetDef = a; m_has_attr_stdSetDef = true; }
+ inline void clearAttributeStdSetDef() { m_has_attr_stdSetDef = false; }
+
+ // child element accessors
+ inline QString elementAuthor() const { return m_author; }
+ void setElementAuthor(const QString& a);
+ inline bool hasElementAuthor() const { return m_children & Author; }
+ void clearElementAuthor();
+
+ inline QString elementComment() const { return m_comment; }
+ void setElementComment(const QString& a);
+ inline bool hasElementComment() const { return m_children & Comment; }
+ void clearElementComment();
+
+ inline QString elementExportMacro() const { return m_exportMacro; }
+ void setElementExportMacro(const QString& a);
+ inline bool hasElementExportMacro() const { return m_children & ExportMacro; }
+ void clearElementExportMacro();
+
+ inline QString elementClass() const { return m_class; }
+ void setElementClass(const QString& a);
+ inline bool hasElementClass() const { return m_children & Class; }
+ void clearElementClass();
+
+ inline DomWidget* elementWidget() const { return m_widget; }
+ DomWidget* takeElementWidget();
+ void setElementWidget(DomWidget* a);
+ inline bool hasElementWidget() const { return m_children & Widget; }
+ void clearElementWidget();
+
+ inline DomLayoutDefault* elementLayoutDefault() const { return m_layoutDefault; }
+ DomLayoutDefault* takeElementLayoutDefault();
+ void setElementLayoutDefault(DomLayoutDefault* a);
+ inline bool hasElementLayoutDefault() const { return m_children & LayoutDefault; }
+ void clearElementLayoutDefault();
+
+ inline DomLayoutFunction* elementLayoutFunction() const { return m_layoutFunction; }
+ DomLayoutFunction* takeElementLayoutFunction();
+ void setElementLayoutFunction(DomLayoutFunction* a);
+ inline bool hasElementLayoutFunction() const { return m_children & LayoutFunction; }
+ void clearElementLayoutFunction();
+
+ inline QString elementPixmapFunction() const { return m_pixmapFunction; }
+ void setElementPixmapFunction(const QString& a);
+ inline bool hasElementPixmapFunction() const { return m_children & PixmapFunction; }
+ void clearElementPixmapFunction();
+
+ inline DomCustomWidgets* elementCustomWidgets() const { return m_customWidgets; }
+ DomCustomWidgets* takeElementCustomWidgets();
+ void setElementCustomWidgets(DomCustomWidgets* a);
+ inline bool hasElementCustomWidgets() const { return m_children & CustomWidgets; }
+ void clearElementCustomWidgets();
+
+ inline DomTabStops* elementTabStops() const { return m_tabStops; }
+ DomTabStops* takeElementTabStops();
+ void setElementTabStops(DomTabStops* a);
+ inline bool hasElementTabStops() const { return m_children & TabStops; }
+ void clearElementTabStops();
+
+ inline DomImages* elementImages() const { return m_images; }
+ DomImages* takeElementImages();
+ void setElementImages(DomImages* a);
+ inline bool hasElementImages() const { return m_children & Images; }
+ void clearElementImages();
+
+ inline DomIncludes* elementIncludes() const { return m_includes; }
+ DomIncludes* takeElementIncludes();
+ void setElementIncludes(DomIncludes* a);
+ inline bool hasElementIncludes() const { return m_children & Includes; }
+ void clearElementIncludes();
+
+ inline DomResources* elementResources() const { return m_resources; }
+ DomResources* takeElementResources();
+ void setElementResources(DomResources* a);
+ inline bool hasElementResources() const { return m_children & Resources; }
+ void clearElementResources();
+
+ inline DomConnections* elementConnections() const { return m_connections; }
+ DomConnections* takeElementConnections();
+ void setElementConnections(DomConnections* a);
+ inline bool hasElementConnections() const { return m_children & Connections; }
+ void clearElementConnections();
+
+ inline DomDesignerData* elementDesignerdata() const { return m_designerdata; }
+ DomDesignerData* takeElementDesignerdata();
+ void setElementDesignerdata(DomDesignerData* a);
+ inline bool hasElementDesignerdata() const { return m_children & Designerdata; }
+ void clearElementDesignerdata();
+
+ inline DomSlots* elementSlots() const { return m_slots; }
+ DomSlots* takeElementSlots();
+ void setElementSlots(DomSlots* a);
+ inline bool hasElementSlots() const { return m_children & Slots; }
+ void clearElementSlots();
+
+ inline DomButtonGroups* elementButtonGroups() const { return m_buttonGroups; }
+ DomButtonGroups* takeElementButtonGroups();
+ void setElementButtonGroups(DomButtonGroups* a);
+ inline bool hasElementButtonGroups() const { return m_children & ButtonGroups; }
+ void clearElementButtonGroups();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_version;
+ bool m_has_attr_version;
+
+ QString m_attr_language;
+ bool m_has_attr_language;
+
+ QString m_attr_displayname;
+ bool m_has_attr_displayname;
+
+ int m_attr_stdsetdef;
+ bool m_has_attr_stdsetdef;
+
+ int m_attr_stdSetDef;
+ bool m_has_attr_stdSetDef;
+
+ // child element data
+ uint m_children;
+ QString m_author;
+ QString m_comment;
+ QString m_exportMacro;
+ QString m_class;
+ DomWidget* m_widget;
+ DomLayoutDefault* m_layoutDefault;
+ DomLayoutFunction* m_layoutFunction;
+ QString m_pixmapFunction;
+ DomCustomWidgets* m_customWidgets;
+ DomTabStops* m_tabStops;
+ DomImages* m_images;
+ DomIncludes* m_includes;
+ DomResources* m_resources;
+ DomConnections* m_connections;
+ DomDesignerData* m_designerdata;
+ DomSlots* m_slots;
+ DomButtonGroups* m_buttonGroups;
+ enum Child {
+ Author = 1,
+ Comment = 2,
+ ExportMacro = 4,
+ Class = 8,
+ Widget = 16,
+ LayoutDefault = 32,
+ LayoutFunction = 64,
+ PixmapFunction = 128,
+ CustomWidgets = 256,
+ TabStops = 512,
+ Images = 1024,
+ Includes = 2048,
+ Resources = 4096,
+ Connections = 8192,
+ Designerdata = 16384,
+ Slots = 32768,
+ ButtonGroups = 65536
+ };
+
+ DomUI(const DomUI &other);
+ void operator = (const DomUI&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomIncludes {
+public:
+ DomIncludes();
+ ~DomIncludes();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomInclude*> elementInclude() const { return m_include; }
+ void setElementInclude(const QList<DomInclude*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomInclude*> m_include;
+ enum Child {
+ Include = 1
+ };
+
+ DomIncludes(const DomIncludes &other);
+ void operator = (const DomIncludes&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomInclude {
+public:
+ DomInclude();
+ ~DomInclude();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeLocation() const { return m_has_attr_location; }
+ inline QString attributeLocation() const { return m_attr_location; }
+ inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+ inline bool hasAttributeImpldecl() const { return m_has_attr_impldecl; }
+ inline QString attributeImpldecl() const { return m_attr_impldecl; }
+ inline void setAttributeImpldecl(const QString& a) { m_attr_impldecl = a; m_has_attr_impldecl = true; }
+ inline void clearAttributeImpldecl() { m_has_attr_impldecl = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_location;
+ bool m_has_attr_location;
+
+ QString m_attr_impldecl;
+ bool m_has_attr_impldecl;
+
+ // child element data
+ uint m_children;
+
+ DomInclude(const DomInclude &other);
+ void operator = (const DomInclude&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResources {
+public:
+ DomResources();
+ ~DomResources();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+ inline QList<DomResource*> elementInclude() const { return m_include; }
+ void setElementInclude(const QList<DomResource*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+ QList<DomResource*> m_include;
+ enum Child {
+ Include = 1
+ };
+
+ DomResources(const DomResources &other);
+ void operator = (const DomResources&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResource {
+public:
+ DomResource();
+ ~DomResource();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeLocation() const { return m_has_attr_location; }
+ inline QString attributeLocation() const { return m_attr_location; }
+ inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_location;
+ bool m_has_attr_location;
+
+ // child element data
+ uint m_children;
+
+ DomResource(const DomResource &other);
+ void operator = (const DomResource&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomActionGroup {
+public:
+ DomActionGroup();
+ ~DomActionGroup();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+ inline QList<DomAction*> elementAction() const { return m_action; }
+ void setElementAction(const QList<DomAction*>& a);
+
+ inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
+ void setElementActionGroup(const QList<DomActionGroup*>& a);
+
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+ void setElementAttribute(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+ QList<DomAction*> m_action;
+ QList<DomActionGroup*> m_actionGroup;
+ QList<DomProperty*> m_property;
+ QList<DomProperty*> m_attribute;
+ enum Child {
+ Action = 1,
+ ActionGroup = 2,
+ Property = 4,
+ Attribute = 8
+ };
+
+ DomActionGroup(const DomActionGroup &other);
+ void operator = (const DomActionGroup&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomAction {
+public:
+ DomAction();
+ ~DomAction();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ inline bool hasAttributeMenu() const { return m_has_attr_menu; }
+ inline QString attributeMenu() const { return m_attr_menu; }
+ inline void setAttributeMenu(const QString& a) { m_attr_menu = a; m_has_attr_menu = true; }
+ inline void clearAttributeMenu() { m_has_attr_menu = false; }
+
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+ void setElementAttribute(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ QString m_attr_menu;
+ bool m_has_attr_menu;
+
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ QList<DomProperty*> m_attribute;
+ enum Child {
+ Property = 1,
+ Attribute = 2
+ };
+
+ DomAction(const DomAction &other);
+ void operator = (const DomAction&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomActionRef {
+public:
+ DomActionRef();
+ ~DomActionRef();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+
+ DomActionRef(const DomActionRef &other);
+ void operator = (const DomActionRef&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomButtonGroup {
+public:
+ DomButtonGroup();
+ ~DomButtonGroup();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+ void setElementAttribute(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ QList<DomProperty*> m_attribute;
+ enum Child {
+ Property = 1,
+ Attribute = 2
+ };
+
+ DomButtonGroup(const DomButtonGroup &other);
+ void operator = (const DomButtonGroup&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomButtonGroups {
+public:
+ DomButtonGroups();
+ ~DomButtonGroups();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomButtonGroup*> elementButtonGroup() const { return m_buttonGroup; }
+ void setElementButtonGroup(const QList<DomButtonGroup*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomButtonGroup*> m_buttonGroup;
+ enum Child {
+ ButtonGroup = 1
+ };
+
+ DomButtonGroups(const DomButtonGroups &other);
+ void operator = (const DomButtonGroups&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImages {
+public:
+ DomImages();
+ ~DomImages();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomImage*> elementImage() const { return m_image; }
+ void setElementImage(const QList<DomImage*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomImage*> m_image;
+ enum Child {
+ Image = 1
+ };
+
+ DomImages(const DomImages &other);
+ void operator = (const DomImages&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImage {
+public:
+ DomImage();
+ ~DomImage();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+ inline DomImageData* elementData() const { return m_data; }
+ DomImageData* takeElementData();
+ void setElementData(DomImageData* a);
+ inline bool hasElementData() const { return m_children & Data; }
+ void clearElementData();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+ DomImageData* m_data;
+ enum Child {
+ Data = 1
+ };
+
+ DomImage(const DomImage &other);
+ void operator = (const DomImage&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomImageData {
+public:
+ DomImageData();
+ ~DomImageData();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeFormat() const { return m_has_attr_format; }
+ inline QString attributeFormat() const { return m_attr_format; }
+ inline void setAttributeFormat(const QString& a) { m_attr_format = a; m_has_attr_format = true; }
+ inline void clearAttributeFormat() { m_has_attr_format = false; }
+
+ inline bool hasAttributeLength() const { return m_has_attr_length; }
+ inline int attributeLength() const { return m_attr_length; }
+ inline void setAttributeLength(int a) { m_attr_length = a; m_has_attr_length = true; }
+ inline void clearAttributeLength() { m_has_attr_length = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_format;
+ bool m_has_attr_format;
+
+ int m_attr_length;
+ bool m_has_attr_length;
+
+ // child element data
+ uint m_children;
+
+ DomImageData(const DomImageData &other);
+ void operator = (const DomImageData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomCustomWidgets {
+public:
+ DomCustomWidgets();
+ ~DomCustomWidgets();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomCustomWidget*> elementCustomWidget() const { return m_customWidget; }
+ void setElementCustomWidget(const QList<DomCustomWidget*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomCustomWidget*> m_customWidget;
+ enum Child {
+ CustomWidget = 1
+ };
+
+ DomCustomWidgets(const DomCustomWidgets &other);
+ void operator = (const DomCustomWidgets&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomHeader {
+public:
+ DomHeader();
+ ~DomHeader();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeLocation() const { return m_has_attr_location; }
+ inline QString attributeLocation() const { return m_attr_location; }
+ inline void setAttributeLocation(const QString& a) { m_attr_location = a; m_has_attr_location = true; }
+ inline void clearAttributeLocation() { m_has_attr_location = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_location;
+ bool m_has_attr_location;
+
+ // child element data
+ uint m_children;
+
+ DomHeader(const DomHeader &other);
+ void operator = (const DomHeader&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomCustomWidget {
+public:
+ DomCustomWidget();
+ ~DomCustomWidget();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QString elementClass() const { return m_class; }
+ void setElementClass(const QString& a);
+ inline bool hasElementClass() const { return m_children & Class; }
+ void clearElementClass();
+
+ inline QString elementExtends() const { return m_extends; }
+ void setElementExtends(const QString& a);
+ inline bool hasElementExtends() const { return m_children & Extends; }
+ void clearElementExtends();
+
+ inline DomHeader* elementHeader() const { return m_header; }
+ DomHeader* takeElementHeader();
+ void setElementHeader(DomHeader* a);
+ inline bool hasElementHeader() const { return m_children & Header; }
+ void clearElementHeader();
+
+ inline DomSize* elementSizeHint() const { return m_sizeHint; }
+ DomSize* takeElementSizeHint();
+ void setElementSizeHint(DomSize* a);
+ inline bool hasElementSizeHint() const { return m_children & SizeHint; }
+ void clearElementSizeHint();
+
+ inline QString elementAddPageMethod() const { return m_addPageMethod; }
+ void setElementAddPageMethod(const QString& a);
+ inline bool hasElementAddPageMethod() const { return m_children & AddPageMethod; }
+ void clearElementAddPageMethod();
+
+ inline int elementContainer() const { return m_container; }
+ void setElementContainer(int a);
+ inline bool hasElementContainer() const { return m_children & Container; }
+ void clearElementContainer();
+
+ inline DomSizePolicyData* elementSizePolicy() const { return m_sizePolicy; }
+ DomSizePolicyData* takeElementSizePolicy();
+ void setElementSizePolicy(DomSizePolicyData* a);
+ inline bool hasElementSizePolicy() const { return m_children & SizePolicy; }
+ void clearElementSizePolicy();
+
+ inline QString elementPixmap() const { return m_pixmap; }
+ void setElementPixmap(const QString& a);
+ inline bool hasElementPixmap() const { return m_children & Pixmap; }
+ void clearElementPixmap();
+
+ inline DomScript* elementScript() const { return m_script; }
+ DomScript* takeElementScript();
+ void setElementScript(DomScript* a);
+ inline bool hasElementScript() const { return m_children & Script; }
+ void clearElementScript();
+
+ inline DomProperties* elementProperties() const { return m_properties; }
+ DomProperties* takeElementProperties();
+ void setElementProperties(DomProperties* a);
+ inline bool hasElementProperties() const { return m_children & Properties; }
+ void clearElementProperties();
+
+ inline DomSlots* elementSlots() const { return m_slots; }
+ DomSlots* takeElementSlots();
+ void setElementSlots(DomSlots* a);
+ inline bool hasElementSlots() const { return m_children & Slots; }
+ void clearElementSlots();
+
+ inline DomPropertySpecifications* elementPropertyspecifications() const { return m_propertyspecifications; }
+ DomPropertySpecifications* takeElementPropertyspecifications();
+ void setElementPropertyspecifications(DomPropertySpecifications* a);
+ inline bool hasElementPropertyspecifications() const { return m_children & Propertyspecifications; }
+ void clearElementPropertyspecifications();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QString m_class;
+ QString m_extends;
+ DomHeader* m_header;
+ DomSize* m_sizeHint;
+ QString m_addPageMethod;
+ int m_container;
+ DomSizePolicyData* m_sizePolicy;
+ QString m_pixmap;
+ DomScript* m_script;
+ DomProperties* m_properties;
+ DomSlots* m_slots;
+ DomPropertySpecifications* m_propertyspecifications;
+ enum Child {
+ Class = 1,
+ Extends = 2,
+ Header = 4,
+ SizeHint = 8,
+ AddPageMethod = 16,
+ Container = 32,
+ SizePolicy = 64,
+ Pixmap = 128,
+ Script = 256,
+ Properties = 512,
+ Slots = 1024,
+ Propertyspecifications = 2048
+ };
+
+ DomCustomWidget(const DomCustomWidget &other);
+ void operator = (const DomCustomWidget&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomProperties {
+public:
+ DomProperties();
+ ~DomProperties();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomPropertyData*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomPropertyData*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomPropertyData*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomProperties(const DomProperties &other);
+ void operator = (const DomProperties&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPropertyData {
+public:
+ DomPropertyData();
+ ~DomPropertyData();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeType() const { return m_has_attr_type; }
+ inline QString attributeType() const { return m_attr_type; }
+ inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void clearAttributeType() { m_has_attr_type = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_type;
+ bool m_has_attr_type;
+
+ // child element data
+ uint m_children;
+
+ DomPropertyData(const DomPropertyData &other);
+ void operator = (const DomPropertyData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizePolicyData {
+public:
+ DomSizePolicyData();
+ ~DomSizePolicyData();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementHorData() const { return m_horData; }
+ void setElementHorData(int a);
+ inline bool hasElementHorData() const { return m_children & HorData; }
+ void clearElementHorData();
+
+ inline int elementVerData() const { return m_verData; }
+ void setElementVerData(int a);
+ inline bool hasElementVerData() const { return m_children & VerData; }
+ void clearElementVerData();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_horData;
+ int m_verData;
+ enum Child {
+ HorData = 1,
+ VerData = 2
+ };
+
+ DomSizePolicyData(const DomSizePolicyData &other);
+ void operator = (const DomSizePolicyData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutDefault {
+public:
+ DomLayoutDefault();
+ ~DomLayoutDefault();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
+ inline int attributeSpacing() const { return m_attr_spacing; }
+ inline void setAttributeSpacing(int a) { m_attr_spacing = a; m_has_attr_spacing = true; }
+ inline void clearAttributeSpacing() { m_has_attr_spacing = false; }
+
+ inline bool hasAttributeMargin() const { return m_has_attr_margin; }
+ inline int attributeMargin() const { return m_attr_margin; }
+ inline void setAttributeMargin(int a) { m_attr_margin = a; m_has_attr_margin = true; }
+ inline void clearAttributeMargin() { m_has_attr_margin = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ int m_attr_spacing;
+ bool m_has_attr_spacing;
+
+ int m_attr_margin;
+ bool m_has_attr_margin;
+
+ // child element data
+ uint m_children;
+
+ DomLayoutDefault(const DomLayoutDefault &other);
+ void operator = (const DomLayoutDefault&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutFunction {
+public:
+ DomLayoutFunction();
+ ~DomLayoutFunction();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeSpacing() const { return m_has_attr_spacing; }
+ inline QString attributeSpacing() const { return m_attr_spacing; }
+ inline void setAttributeSpacing(const QString& a) { m_attr_spacing = a; m_has_attr_spacing = true; }
+ inline void clearAttributeSpacing() { m_has_attr_spacing = false; }
+
+ inline bool hasAttributeMargin() const { return m_has_attr_margin; }
+ inline QString attributeMargin() const { return m_attr_margin; }
+ inline void setAttributeMargin(const QString& a) { m_attr_margin = a; m_has_attr_margin = true; }
+ inline void clearAttributeMargin() { m_has_attr_margin = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_spacing;
+ bool m_has_attr_spacing;
+
+ QString m_attr_margin;
+ bool m_has_attr_margin;
+
+ // child element data
+ uint m_children;
+
+ DomLayoutFunction(const DomLayoutFunction &other);
+ void operator = (const DomLayoutFunction&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomTabStops {
+public:
+ DomTabStops();
+ ~DomTabStops();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QStringList elementTabStop() const { return m_tabStop; }
+ void setElementTabStop(const QStringList& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QStringList m_tabStop;
+ enum Child {
+ TabStop = 1
+ };
+
+ DomTabStops(const DomTabStops &other);
+ void operator = (const DomTabStops&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayout {
+public:
+ DomLayout();
+ ~DomLayout();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeClass() const { return m_has_attr_class; }
+ inline QString attributeClass() const { return m_attr_class; }
+ inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+ inline void clearAttributeClass() { m_has_attr_class = false; }
+
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ inline bool hasAttributeStretch() const { return m_has_attr_stretch; }
+ inline QString attributeStretch() const { return m_attr_stretch; }
+ inline void setAttributeStretch(const QString& a) { m_attr_stretch = a; m_has_attr_stretch = true; }
+ inline void clearAttributeStretch() { m_has_attr_stretch = false; }
+
+ inline bool hasAttributeRowStretch() const { return m_has_attr_rowStretch; }
+ inline QString attributeRowStretch() const { return m_attr_rowStretch; }
+ inline void setAttributeRowStretch(const QString& a) { m_attr_rowStretch = a; m_has_attr_rowStretch = true; }
+ inline void clearAttributeRowStretch() { m_has_attr_rowStretch = false; }
+
+ inline bool hasAttributeColumnStretch() const { return m_has_attr_columnStretch; }
+ inline QString attributeColumnStretch() const { return m_attr_columnStretch; }
+ inline void setAttributeColumnStretch(const QString& a) { m_attr_columnStretch = a; m_has_attr_columnStretch = true; }
+ inline void clearAttributeColumnStretch() { m_has_attr_columnStretch = false; }
+
+ inline bool hasAttributeRowMinimumHeight() const { return m_has_attr_rowMinimumHeight; }
+ inline QString attributeRowMinimumHeight() const { return m_attr_rowMinimumHeight; }
+ inline void setAttributeRowMinimumHeight(const QString& a) { m_attr_rowMinimumHeight = a; m_has_attr_rowMinimumHeight = true; }
+ inline void clearAttributeRowMinimumHeight() { m_has_attr_rowMinimumHeight = false; }
+
+ inline bool hasAttributeColumnMinimumWidth() const { return m_has_attr_columnMinimumWidth; }
+ inline QString attributeColumnMinimumWidth() const { return m_attr_columnMinimumWidth; }
+ inline void setAttributeColumnMinimumWidth(const QString& a) { m_attr_columnMinimumWidth = a; m_has_attr_columnMinimumWidth = true; }
+ inline void clearAttributeColumnMinimumWidth() { m_has_attr_columnMinimumWidth = false; }
+
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+ void setElementAttribute(const QList<DomProperty*>& a);
+
+ inline QList<DomLayoutItem*> elementItem() const { return m_item; }
+ void setElementItem(const QList<DomLayoutItem*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_class;
+ bool m_has_attr_class;
+
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ QString m_attr_stretch;
+ bool m_has_attr_stretch;
+
+ QString m_attr_rowStretch;
+ bool m_has_attr_rowStretch;
+
+ QString m_attr_columnStretch;
+ bool m_has_attr_columnStretch;
+
+ QString m_attr_rowMinimumHeight;
+ bool m_has_attr_rowMinimumHeight;
+
+ QString m_attr_columnMinimumWidth;
+ bool m_has_attr_columnMinimumWidth;
+
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ QList<DomProperty*> m_attribute;
+ QList<DomLayoutItem*> m_item;
+ enum Child {
+ Property = 1,
+ Attribute = 2,
+ Item = 4
+ };
+
+ DomLayout(const DomLayout &other);
+ void operator = (const DomLayout&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLayoutItem {
+public:
+ DomLayoutItem();
+ ~DomLayoutItem();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeRow() const { return m_has_attr_row; }
+ inline int attributeRow() const { return m_attr_row; }
+ inline void setAttributeRow(int a) { m_attr_row = a; m_has_attr_row = true; }
+ inline void clearAttributeRow() { m_has_attr_row = false; }
+
+ inline bool hasAttributeColumn() const { return m_has_attr_column; }
+ inline int attributeColumn() const { return m_attr_column; }
+ inline void setAttributeColumn(int a) { m_attr_column = a; m_has_attr_column = true; }
+ inline void clearAttributeColumn() { m_has_attr_column = false; }
+
+ inline bool hasAttributeRowSpan() const { return m_has_attr_rowSpan; }
+ inline int attributeRowSpan() const { return m_attr_rowSpan; }
+ inline void setAttributeRowSpan(int a) { m_attr_rowSpan = a; m_has_attr_rowSpan = true; }
+ inline void clearAttributeRowSpan() { m_has_attr_rowSpan = false; }
+
+ inline bool hasAttributeColSpan() const { return m_has_attr_colSpan; }
+ inline int attributeColSpan() const { return m_attr_colSpan; }
+ inline void setAttributeColSpan(int a) { m_attr_colSpan = a; m_has_attr_colSpan = true; }
+ inline void clearAttributeColSpan() { m_has_attr_colSpan = false; }
+
+ inline bool hasAttributeAlignment() const { return m_has_attr_alignment; }
+ inline QString attributeAlignment() const { return m_attr_alignment; }
+ inline void setAttributeAlignment(const QString& a) { m_attr_alignment = a; m_has_attr_alignment = true; }
+ inline void clearAttributeAlignment() { m_has_attr_alignment = false; }
+
+ // child element accessors
+ enum Kind { Unknown = 0, Widget, Layout, Spacer };
+ inline Kind kind() const { return m_kind; }
+
+ inline DomWidget* elementWidget() const { return m_widget; }
+ DomWidget* takeElementWidget();
+ void setElementWidget(DomWidget* a);
+
+ inline DomLayout* elementLayout() const { return m_layout; }
+ DomLayout* takeElementLayout();
+ void setElementLayout(DomLayout* a);
+
+ inline DomSpacer* elementSpacer() const { return m_spacer; }
+ DomSpacer* takeElementSpacer();
+ void setElementSpacer(DomSpacer* a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ int m_attr_row;
+ bool m_has_attr_row;
+
+ int m_attr_column;
+ bool m_has_attr_column;
+
+ int m_attr_rowSpan;
+ bool m_has_attr_rowSpan;
+
+ int m_attr_colSpan;
+ bool m_has_attr_colSpan;
+
+ QString m_attr_alignment;
+ bool m_has_attr_alignment;
+
+ // child element data
+ Kind m_kind;
+ DomWidget* m_widget;
+ DomLayout* m_layout;
+ DomSpacer* m_spacer;
+
+ DomLayoutItem(const DomLayoutItem &other);
+ void operator = (const DomLayoutItem&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRow {
+public:
+ DomRow();
+ ~DomRow();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomRow(const DomRow &other);
+ void operator = (const DomRow&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColumn {
+public:
+ DomColumn();
+ ~DomColumn();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomColumn(const DomColumn &other);
+ void operator = (const DomColumn&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomItem {
+public:
+ DomItem();
+ ~DomItem();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeRow() const { return m_has_attr_row; }
+ inline int attributeRow() const { return m_attr_row; }
+ inline void setAttributeRow(int a) { m_attr_row = a; m_has_attr_row = true; }
+ inline void clearAttributeRow() { m_has_attr_row = false; }
+
+ inline bool hasAttributeColumn() const { return m_has_attr_column; }
+ inline int attributeColumn() const { return m_attr_column; }
+ inline void setAttributeColumn(int a) { m_attr_column = a; m_has_attr_column = true; }
+ inline void clearAttributeColumn() { m_has_attr_column = false; }
+
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomItem*> elementItem() const { return m_item; }
+ void setElementItem(const QList<DomItem*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ int m_attr_row;
+ bool m_has_attr_row;
+
+ int m_attr_column;
+ bool m_has_attr_column;
+
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ QList<DomItem*> m_item;
+ enum Child {
+ Property = 1,
+ Item = 2
+ };
+
+ DomItem(const DomItem &other);
+ void operator = (const DomItem&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomWidget {
+public:
+ DomWidget();
+ ~DomWidget();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeClass() const { return m_has_attr_class; }
+ inline QString attributeClass() const { return m_attr_class; }
+ inline void setAttributeClass(const QString& a) { m_attr_class = a; m_has_attr_class = true; }
+ inline void clearAttributeClass() { m_has_attr_class = false; }
+
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ inline bool hasAttributeNative() const { return m_has_attr_native; }
+ inline bool attributeNative() const { return m_attr_native; }
+ inline void setAttributeNative(bool a) { m_attr_native = a; m_has_attr_native = true; }
+ inline void clearAttributeNative() { m_has_attr_native = false; }
+
+ // child element accessors
+ inline QStringList elementClass() const { return m_class; }
+ void setElementClass(const QStringList& a);
+
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+ inline QList<DomScript*> elementScript() const { return m_script; }
+ void setElementScript(const QList<DomScript*>& a);
+
+ inline QList<DomWidgetData*> elementWidgetData() const { return m_widgetData; }
+ void setElementWidgetData(const QList<DomWidgetData*>& a);
+
+ inline QList<DomProperty*> elementAttribute() const { return m_attribute; }
+ void setElementAttribute(const QList<DomProperty*>& a);
+
+ inline QList<DomRow*> elementRow() const { return m_row; }
+ void setElementRow(const QList<DomRow*>& a);
+
+ inline QList<DomColumn*> elementColumn() const { return m_column; }
+ void setElementColumn(const QList<DomColumn*>& a);
+
+ inline QList<DomItem*> elementItem() const { return m_item; }
+ void setElementItem(const QList<DomItem*>& a);
+
+ inline QList<DomLayout*> elementLayout() const { return m_layout; }
+ void setElementLayout(const QList<DomLayout*>& a);
+
+ inline QList<DomWidget*> elementWidget() const { return m_widget; }
+ void setElementWidget(const QList<DomWidget*>& a);
+
+ inline QList<DomAction*> elementAction() const { return m_action; }
+ void setElementAction(const QList<DomAction*>& a);
+
+ inline QList<DomActionGroup*> elementActionGroup() const { return m_actionGroup; }
+ void setElementActionGroup(const QList<DomActionGroup*>& a);
+
+ inline QList<DomActionRef*> elementAddAction() const { return m_addAction; }
+ void setElementAddAction(const QList<DomActionRef*>& a);
+
+ inline QStringList elementZOrder() const { return m_zOrder; }
+ void setElementZOrder(const QStringList& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_class;
+ bool m_has_attr_class;
+
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ bool m_attr_native;
+ bool m_has_attr_native;
+
+ // child element data
+ uint m_children;
+ QStringList m_class;
+ QList<DomProperty*> m_property;
+ QList<DomScript*> m_script;
+ QList<DomWidgetData*> m_widgetData;
+ QList<DomProperty*> m_attribute;
+ QList<DomRow*> m_row;
+ QList<DomColumn*> m_column;
+ QList<DomItem*> m_item;
+ QList<DomLayout*> m_layout;
+ QList<DomWidget*> m_widget;
+ QList<DomAction*> m_action;
+ QList<DomActionGroup*> m_actionGroup;
+ QList<DomActionRef*> m_addAction;
+ QStringList m_zOrder;
+ enum Child {
+ Class = 1,
+ Property = 2,
+ Script = 4,
+ WidgetData = 8,
+ Attribute = 16,
+ Row = 32,
+ Column = 64,
+ Item = 128,
+ Layout = 256,
+ Widget = 512,
+ Action = 1024,
+ ActionGroup = 2048,
+ AddAction = 4096,
+ ZOrder = 8192
+ };
+
+ DomWidget(const DomWidget &other);
+ void operator = (const DomWidget&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSpacer {
+public:
+ DomSpacer();
+ ~DomSpacer();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomSpacer(const DomSpacer &other);
+ void operator = (const DomSpacer&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColor {
+public:
+ DomColor();
+ ~DomColor();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeAlpha() const { return m_has_attr_alpha; }
+ inline int attributeAlpha() const { return m_attr_alpha; }
+ inline void setAttributeAlpha(int a) { m_attr_alpha = a; m_has_attr_alpha = true; }
+ inline void clearAttributeAlpha() { m_has_attr_alpha = false; }
+
+ // child element accessors
+ inline int elementRed() const { return m_red; }
+ void setElementRed(int a);
+ inline bool hasElementRed() const { return m_children & Red; }
+ void clearElementRed();
+
+ inline int elementGreen() const { return m_green; }
+ void setElementGreen(int a);
+ inline bool hasElementGreen() const { return m_children & Green; }
+ void clearElementGreen();
+
+ inline int elementBlue() const { return m_blue; }
+ void setElementBlue(int a);
+ inline bool hasElementBlue() const { return m_children & Blue; }
+ void clearElementBlue();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ int m_attr_alpha;
+ bool m_has_attr_alpha;
+
+ // child element data
+ uint m_children;
+ int m_red;
+ int m_green;
+ int m_blue;
+ enum Child {
+ Red = 1,
+ Green = 2,
+ Blue = 4
+ };
+
+ DomColor(const DomColor &other);
+ void operator = (const DomColor&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomGradientStop {
+public:
+ DomGradientStop();
+ ~DomGradientStop();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributePosition() const { return m_has_attr_position; }
+ inline double attributePosition() const { return m_attr_position; }
+ inline void setAttributePosition(double a) { m_attr_position = a; m_has_attr_position = true; }
+ inline void clearAttributePosition() { m_has_attr_position = false; }
+
+ // child element accessors
+ inline DomColor* elementColor() const { return m_color; }
+ DomColor* takeElementColor();
+ void setElementColor(DomColor* a);
+ inline bool hasElementColor() const { return m_children & Color; }
+ void clearElementColor();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ double m_attr_position;
+ bool m_has_attr_position;
+
+ // child element data
+ uint m_children;
+ DomColor* m_color;
+ enum Child {
+ Color = 1
+ };
+
+ DomGradientStop(const DomGradientStop &other);
+ void operator = (const DomGradientStop&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomGradient {
+public:
+ DomGradient();
+ ~DomGradient();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeStartX() const { return m_has_attr_startX; }
+ inline double attributeStartX() const { return m_attr_startX; }
+ inline void setAttributeStartX(double a) { m_attr_startX = a; m_has_attr_startX = true; }
+ inline void clearAttributeStartX() { m_has_attr_startX = false; }
+
+ inline bool hasAttributeStartY() const { return m_has_attr_startY; }
+ inline double attributeStartY() const { return m_attr_startY; }
+ inline void setAttributeStartY(double a) { m_attr_startY = a; m_has_attr_startY = true; }
+ inline void clearAttributeStartY() { m_has_attr_startY = false; }
+
+ inline bool hasAttributeEndX() const { return m_has_attr_endX; }
+ inline double attributeEndX() const { return m_attr_endX; }
+ inline void setAttributeEndX(double a) { m_attr_endX = a; m_has_attr_endX = true; }
+ inline void clearAttributeEndX() { m_has_attr_endX = false; }
+
+ inline bool hasAttributeEndY() const { return m_has_attr_endY; }
+ inline double attributeEndY() const { return m_attr_endY; }
+ inline void setAttributeEndY(double a) { m_attr_endY = a; m_has_attr_endY = true; }
+ inline void clearAttributeEndY() { m_has_attr_endY = false; }
+
+ inline bool hasAttributeCentralX() const { return m_has_attr_centralX; }
+ inline double attributeCentralX() const { return m_attr_centralX; }
+ inline void setAttributeCentralX(double a) { m_attr_centralX = a; m_has_attr_centralX = true; }
+ inline void clearAttributeCentralX() { m_has_attr_centralX = false; }
+
+ inline bool hasAttributeCentralY() const { return m_has_attr_centralY; }
+ inline double attributeCentralY() const { return m_attr_centralY; }
+ inline void setAttributeCentralY(double a) { m_attr_centralY = a; m_has_attr_centralY = true; }
+ inline void clearAttributeCentralY() { m_has_attr_centralY = false; }
+
+ inline bool hasAttributeFocalX() const { return m_has_attr_focalX; }
+ inline double attributeFocalX() const { return m_attr_focalX; }
+ inline void setAttributeFocalX(double a) { m_attr_focalX = a; m_has_attr_focalX = true; }
+ inline void clearAttributeFocalX() { m_has_attr_focalX = false; }
+
+ inline bool hasAttributeFocalY() const { return m_has_attr_focalY; }
+ inline double attributeFocalY() const { return m_attr_focalY; }
+ inline void setAttributeFocalY(double a) { m_attr_focalY = a; m_has_attr_focalY = true; }
+ inline void clearAttributeFocalY() { m_has_attr_focalY = false; }
+
+ inline bool hasAttributeRadius() const { return m_has_attr_radius; }
+ inline double attributeRadius() const { return m_attr_radius; }
+ inline void setAttributeRadius(double a) { m_attr_radius = a; m_has_attr_radius = true; }
+ inline void clearAttributeRadius() { m_has_attr_radius = false; }
+
+ inline bool hasAttributeAngle() const { return m_has_attr_angle; }
+ inline double attributeAngle() const { return m_attr_angle; }
+ inline void setAttributeAngle(double a) { m_attr_angle = a; m_has_attr_angle = true; }
+ inline void clearAttributeAngle() { m_has_attr_angle = false; }
+
+ inline bool hasAttributeType() const { return m_has_attr_type; }
+ inline QString attributeType() const { return m_attr_type; }
+ inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void clearAttributeType() { m_has_attr_type = false; }
+
+ inline bool hasAttributeSpread() const { return m_has_attr_spread; }
+ inline QString attributeSpread() const { return m_attr_spread; }
+ inline void setAttributeSpread(const QString& a) { m_attr_spread = a; m_has_attr_spread = true; }
+ inline void clearAttributeSpread() { m_has_attr_spread = false; }
+
+ inline bool hasAttributeCoordinateMode() const { return m_has_attr_coordinateMode; }
+ inline QString attributeCoordinateMode() const { return m_attr_coordinateMode; }
+ inline void setAttributeCoordinateMode(const QString& a) { m_attr_coordinateMode = a; m_has_attr_coordinateMode = true; }
+ inline void clearAttributeCoordinateMode() { m_has_attr_coordinateMode = false; }
+
+ // child element accessors
+ inline QList<DomGradientStop*> elementGradientStop() const { return m_gradientStop; }
+ void setElementGradientStop(const QList<DomGradientStop*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ double m_attr_startX;
+ bool m_has_attr_startX;
+
+ double m_attr_startY;
+ bool m_has_attr_startY;
+
+ double m_attr_endX;
+ bool m_has_attr_endX;
+
+ double m_attr_endY;
+ bool m_has_attr_endY;
+
+ double m_attr_centralX;
+ bool m_has_attr_centralX;
+
+ double m_attr_centralY;
+ bool m_has_attr_centralY;
+
+ double m_attr_focalX;
+ bool m_has_attr_focalX;
+
+ double m_attr_focalY;
+ bool m_has_attr_focalY;
+
+ double m_attr_radius;
+ bool m_has_attr_radius;
+
+ double m_attr_angle;
+ bool m_has_attr_angle;
+
+ QString m_attr_type;
+ bool m_has_attr_type;
+
+ QString m_attr_spread;
+ bool m_has_attr_spread;
+
+ QString m_attr_coordinateMode;
+ bool m_has_attr_coordinateMode;
+
+ // child element data
+ uint m_children;
+ QList<DomGradientStop*> m_gradientStop;
+ enum Child {
+ GradientStop = 1
+ };
+
+ DomGradient(const DomGradient &other);
+ void operator = (const DomGradient&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomBrush {
+public:
+ DomBrush();
+ ~DomBrush();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeBrushStyle() const { return m_has_attr_brushStyle; }
+ inline QString attributeBrushStyle() const { return m_attr_brushStyle; }
+ inline void setAttributeBrushStyle(const QString& a) { m_attr_brushStyle = a; m_has_attr_brushStyle = true; }
+ inline void clearAttributeBrushStyle() { m_has_attr_brushStyle = false; }
+
+ // child element accessors
+ enum Kind { Unknown = 0, Color, Texture, Gradient };
+ inline Kind kind() const { return m_kind; }
+
+ inline DomColor* elementColor() const { return m_color; }
+ DomColor* takeElementColor();
+ void setElementColor(DomColor* a);
+
+ inline DomProperty* elementTexture() const { return m_texture; }
+ DomProperty* takeElementTexture();
+ void setElementTexture(DomProperty* a);
+
+ inline DomGradient* elementGradient() const { return m_gradient; }
+ DomGradient* takeElementGradient();
+ void setElementGradient(DomGradient* a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_brushStyle;
+ bool m_has_attr_brushStyle;
+
+ // child element data
+ Kind m_kind;
+ DomColor* m_color;
+ DomProperty* m_texture;
+ DomGradient* m_gradient;
+
+ DomBrush(const DomBrush &other);
+ void operator = (const DomBrush&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColorRole {
+public:
+ DomColorRole();
+ ~DomColorRole();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeRole() const { return m_has_attr_role; }
+ inline QString attributeRole() const { return m_attr_role; }
+ inline void setAttributeRole(const QString& a) { m_attr_role = a; m_has_attr_role = true; }
+ inline void clearAttributeRole() { m_has_attr_role = false; }
+
+ // child element accessors
+ inline DomBrush* elementBrush() const { return m_brush; }
+ DomBrush* takeElementBrush();
+ void setElementBrush(DomBrush* a);
+ inline bool hasElementBrush() const { return m_children & Brush; }
+ void clearElementBrush();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_role;
+ bool m_has_attr_role;
+
+ // child element data
+ uint m_children;
+ DomBrush* m_brush;
+ enum Child {
+ Brush = 1
+ };
+
+ DomColorRole(const DomColorRole &other);
+ void operator = (const DomColorRole&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomColorGroup {
+public:
+ DomColorGroup();
+ ~DomColorGroup();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomColorRole*> elementColorRole() const { return m_colorRole; }
+ void setElementColorRole(const QList<DomColorRole*>& a);
+
+ inline QList<DomColor*> elementColor() const { return m_color; }
+ void setElementColor(const QList<DomColor*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomColorRole*> m_colorRole;
+ QList<DomColor*> m_color;
+ enum Child {
+ ColorRole = 1,
+ Color = 2
+ };
+
+ DomColorGroup(const DomColorGroup &other);
+ void operator = (const DomColorGroup&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPalette {
+public:
+ DomPalette();
+ ~DomPalette();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline DomColorGroup* elementActive() const { return m_active; }
+ DomColorGroup* takeElementActive();
+ void setElementActive(DomColorGroup* a);
+ inline bool hasElementActive() const { return m_children & Active; }
+ void clearElementActive();
+
+ inline DomColorGroup* elementInactive() const { return m_inactive; }
+ DomColorGroup* takeElementInactive();
+ void setElementInactive(DomColorGroup* a);
+ inline bool hasElementInactive() const { return m_children & Inactive; }
+ void clearElementInactive();
+
+ inline DomColorGroup* elementDisabled() const { return m_disabled; }
+ DomColorGroup* takeElementDisabled();
+ void setElementDisabled(DomColorGroup* a);
+ inline bool hasElementDisabled() const { return m_children & Disabled; }
+ void clearElementDisabled();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ DomColorGroup* m_active;
+ DomColorGroup* m_inactive;
+ DomColorGroup* m_disabled;
+ enum Child {
+ Active = 1,
+ Inactive = 2,
+ Disabled = 4
+ };
+
+ DomPalette(const DomPalette &other);
+ void operator = (const DomPalette&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomFont {
+public:
+ DomFont();
+ ~DomFont();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QString elementFamily() const { return m_family; }
+ void setElementFamily(const QString& a);
+ inline bool hasElementFamily() const { return m_children & Family; }
+ void clearElementFamily();
+
+ inline int elementPointSize() const { return m_pointSize; }
+ void setElementPointSize(int a);
+ inline bool hasElementPointSize() const { return m_children & PointSize; }
+ void clearElementPointSize();
+
+ inline int elementWeight() const { return m_weight; }
+ void setElementWeight(int a);
+ inline bool hasElementWeight() const { return m_children & Weight; }
+ void clearElementWeight();
+
+ inline bool elementItalic() const { return m_italic; }
+ void setElementItalic(bool a);
+ inline bool hasElementItalic() const { return m_children & Italic; }
+ void clearElementItalic();
+
+ inline bool elementBold() const { return m_bold; }
+ void setElementBold(bool a);
+ inline bool hasElementBold() const { return m_children & Bold; }
+ void clearElementBold();
+
+ inline bool elementUnderline() const { return m_underline; }
+ void setElementUnderline(bool a);
+ inline bool hasElementUnderline() const { return m_children & Underline; }
+ void clearElementUnderline();
+
+ inline bool elementStrikeOut() const { return m_strikeOut; }
+ void setElementStrikeOut(bool a);
+ inline bool hasElementStrikeOut() const { return m_children & StrikeOut; }
+ void clearElementStrikeOut();
+
+ inline bool elementAntialiasing() const { return m_antialiasing; }
+ void setElementAntialiasing(bool a);
+ inline bool hasElementAntialiasing() const { return m_children & Antialiasing; }
+ void clearElementAntialiasing();
+
+ inline QString elementStyleStrategy() const { return m_styleStrategy; }
+ void setElementStyleStrategy(const QString& a);
+ inline bool hasElementStyleStrategy() const { return m_children & StyleStrategy; }
+ void clearElementStyleStrategy();
+
+ inline bool elementKerning() const { return m_kerning; }
+ void setElementKerning(bool a);
+ inline bool hasElementKerning() const { return m_children & Kerning; }
+ void clearElementKerning();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QString m_family;
+ int m_pointSize;
+ int m_weight;
+ bool m_italic;
+ bool m_bold;
+ bool m_underline;
+ bool m_strikeOut;
+ bool m_antialiasing;
+ QString m_styleStrategy;
+ bool m_kerning;
+ enum Child {
+ Family = 1,
+ PointSize = 2,
+ Weight = 4,
+ Italic = 8,
+ Bold = 16,
+ Underline = 32,
+ StrikeOut = 64,
+ Antialiasing = 128,
+ StyleStrategy = 256,
+ Kerning = 512
+ };
+
+ DomFont(const DomFont &other);
+ void operator = (const DomFont&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPoint {
+public:
+ DomPoint();
+ ~DomPoint();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementX() const { return m_x; }
+ void setElementX(int a);
+ inline bool hasElementX() const { return m_children & X; }
+ void clearElementX();
+
+ inline int elementY() const { return m_y; }
+ void setElementY(int a);
+ inline bool hasElementY() const { return m_children & Y; }
+ void clearElementY();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_x;
+ int m_y;
+ enum Child {
+ X = 1,
+ Y = 2
+ };
+
+ DomPoint(const DomPoint &other);
+ void operator = (const DomPoint&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRect {
+public:
+ DomRect();
+ ~DomRect();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementX() const { return m_x; }
+ void setElementX(int a);
+ inline bool hasElementX() const { return m_children & X; }
+ void clearElementX();
+
+ inline int elementY() const { return m_y; }
+ void setElementY(int a);
+ inline bool hasElementY() const { return m_children & Y; }
+ void clearElementY();
+
+ inline int elementWidth() const { return m_width; }
+ void setElementWidth(int a);
+ inline bool hasElementWidth() const { return m_children & Width; }
+ void clearElementWidth();
+
+ inline int elementHeight() const { return m_height; }
+ void setElementHeight(int a);
+ inline bool hasElementHeight() const { return m_children & Height; }
+ void clearElementHeight();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_x;
+ int m_y;
+ int m_width;
+ int m_height;
+ enum Child {
+ X = 1,
+ Y = 2,
+ Width = 4,
+ Height = 8
+ };
+
+ DomRect(const DomRect &other);
+ void operator = (const DomRect&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomLocale {
+public:
+ DomLocale();
+ ~DomLocale();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+ inline QString attributeLanguage() const { return m_attr_language; }
+ inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+ inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+ inline bool hasAttributeCountry() const { return m_has_attr_country; }
+ inline QString attributeCountry() const { return m_attr_country; }
+ inline void setAttributeCountry(const QString& a) { m_attr_country = a; m_has_attr_country = true; }
+ inline void clearAttributeCountry() { m_has_attr_country = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_language;
+ bool m_has_attr_language;
+
+ QString m_attr_country;
+ bool m_has_attr_country;
+
+ // child element data
+ uint m_children;
+
+ DomLocale(const DomLocale &other);
+ void operator = (const DomLocale&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizePolicy {
+public:
+ DomSizePolicy();
+ ~DomSizePolicy();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeHSizeType() const { return m_has_attr_hSizeType; }
+ inline QString attributeHSizeType() const { return m_attr_hSizeType; }
+ inline void setAttributeHSizeType(const QString& a) { m_attr_hSizeType = a; m_has_attr_hSizeType = true; }
+ inline void clearAttributeHSizeType() { m_has_attr_hSizeType = false; }
+
+ inline bool hasAttributeVSizeType() const { return m_has_attr_vSizeType; }
+ inline QString attributeVSizeType() const { return m_attr_vSizeType; }
+ inline void setAttributeVSizeType(const QString& a) { m_attr_vSizeType = a; m_has_attr_vSizeType = true; }
+ inline void clearAttributeVSizeType() { m_has_attr_vSizeType = false; }
+
+ // child element accessors
+ inline int elementHSizeType() const { return m_hSizeType; }
+ void setElementHSizeType(int a);
+ inline bool hasElementHSizeType() const { return m_children & HSizeType; }
+ void clearElementHSizeType();
+
+ inline int elementVSizeType() const { return m_vSizeType; }
+ void setElementVSizeType(int a);
+ inline bool hasElementVSizeType() const { return m_children & VSizeType; }
+ void clearElementVSizeType();
+
+ inline int elementHorStretch() const { return m_horStretch; }
+ void setElementHorStretch(int a);
+ inline bool hasElementHorStretch() const { return m_children & HorStretch; }
+ void clearElementHorStretch();
+
+ inline int elementVerStretch() const { return m_verStretch; }
+ void setElementVerStretch(int a);
+ inline bool hasElementVerStretch() const { return m_children & VerStretch; }
+ void clearElementVerStretch();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_hSizeType;
+ bool m_has_attr_hSizeType;
+
+ QString m_attr_vSizeType;
+ bool m_has_attr_vSizeType;
+
+ // child element data
+ uint m_children;
+ int m_hSizeType;
+ int m_vSizeType;
+ int m_horStretch;
+ int m_verStretch;
+ enum Child {
+ HSizeType = 1,
+ VSizeType = 2,
+ HorStretch = 4,
+ VerStretch = 8
+ };
+
+ DomSizePolicy(const DomSizePolicy &other);
+ void operator = (const DomSizePolicy&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSize {
+public:
+ DomSize();
+ ~DomSize();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementWidth() const { return m_width; }
+ void setElementWidth(int a);
+ inline bool hasElementWidth() const { return m_children & Width; }
+ void clearElementWidth();
+
+ inline int elementHeight() const { return m_height; }
+ void setElementHeight(int a);
+ inline bool hasElementHeight() const { return m_children & Height; }
+ void clearElementHeight();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_width;
+ int m_height;
+ enum Child {
+ Width = 1,
+ Height = 2
+ };
+
+ DomSize(const DomSize &other);
+ void operator = (const DomSize&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDate {
+public:
+ DomDate();
+ ~DomDate();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementYear() const { return m_year; }
+ void setElementYear(int a);
+ inline bool hasElementYear() const { return m_children & Year; }
+ void clearElementYear();
+
+ inline int elementMonth() const { return m_month; }
+ void setElementMonth(int a);
+ inline bool hasElementMonth() const { return m_children & Month; }
+ void clearElementMonth();
+
+ inline int elementDay() const { return m_day; }
+ void setElementDay(int a);
+ inline bool hasElementDay() const { return m_children & Day; }
+ void clearElementDay();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_year;
+ int m_month;
+ int m_day;
+ enum Child {
+ Year = 1,
+ Month = 2,
+ Day = 4
+ };
+
+ DomDate(const DomDate &other);
+ void operator = (const DomDate&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomTime {
+public:
+ DomTime();
+ ~DomTime();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementHour() const { return m_hour; }
+ void setElementHour(int a);
+ inline bool hasElementHour() const { return m_children & Hour; }
+ void clearElementHour();
+
+ inline int elementMinute() const { return m_minute; }
+ void setElementMinute(int a);
+ inline bool hasElementMinute() const { return m_children & Minute; }
+ void clearElementMinute();
+
+ inline int elementSecond() const { return m_second; }
+ void setElementSecond(int a);
+ inline bool hasElementSecond() const { return m_children & Second; }
+ void clearElementSecond();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_hour;
+ int m_minute;
+ int m_second;
+ enum Child {
+ Hour = 1,
+ Minute = 2,
+ Second = 4
+ };
+
+ DomTime(const DomTime &other);
+ void operator = (const DomTime&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDateTime {
+public:
+ DomDateTime();
+ ~DomDateTime();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementHour() const { return m_hour; }
+ void setElementHour(int a);
+ inline bool hasElementHour() const { return m_children & Hour; }
+ void clearElementHour();
+
+ inline int elementMinute() const { return m_minute; }
+ void setElementMinute(int a);
+ inline bool hasElementMinute() const { return m_children & Minute; }
+ void clearElementMinute();
+
+ inline int elementSecond() const { return m_second; }
+ void setElementSecond(int a);
+ inline bool hasElementSecond() const { return m_children & Second; }
+ void clearElementSecond();
+
+ inline int elementYear() const { return m_year; }
+ void setElementYear(int a);
+ inline bool hasElementYear() const { return m_children & Year; }
+ void clearElementYear();
+
+ inline int elementMonth() const { return m_month; }
+ void setElementMonth(int a);
+ inline bool hasElementMonth() const { return m_children & Month; }
+ void clearElementMonth();
+
+ inline int elementDay() const { return m_day; }
+ void setElementDay(int a);
+ inline bool hasElementDay() const { return m_children & Day; }
+ void clearElementDay();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_hour;
+ int m_minute;
+ int m_second;
+ int m_year;
+ int m_month;
+ int m_day;
+ enum Child {
+ Hour = 1,
+ Minute = 2,
+ Second = 4,
+ Year = 8,
+ Month = 16,
+ Day = 32
+ };
+
+ DomDateTime(const DomDateTime &other);
+ void operator = (const DomDateTime&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomStringList {
+public:
+ DomStringList();
+ ~DomStringList();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QStringList elementString() const { return m_string; }
+ void setElementString(const QStringList& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QStringList m_string;
+ enum Child {
+ String = 1
+ };
+
+ DomStringList(const DomStringList &other);
+ void operator = (const DomStringList&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResourcePixmap {
+public:
+ DomResourcePixmap();
+ ~DomResourcePixmap();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeResource() const { return m_has_attr_resource; }
+ inline QString attributeResource() const { return m_attr_resource; }
+ inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+ inline void clearAttributeResource() { m_has_attr_resource = false; }
+
+ inline bool hasAttributeAlias() const { return m_has_attr_alias; }
+ inline QString attributeAlias() const { return m_attr_alias; }
+ inline void setAttributeAlias(const QString& a) { m_attr_alias = a; m_has_attr_alias = true; }
+ inline void clearAttributeAlias() { m_has_attr_alias = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_resource;
+ bool m_has_attr_resource;
+
+ QString m_attr_alias;
+ bool m_has_attr_alias;
+
+ // child element data
+ uint m_children;
+
+ DomResourcePixmap(const DomResourcePixmap &other);
+ void operator = (const DomResourcePixmap&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomResourceIcon {
+public:
+ DomResourceIcon();
+ ~DomResourceIcon();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeTheme() const { return m_has_attr_theme; }
+ inline QString attributeTheme() const { return m_attr_theme; }
+ inline void setAttributeTheme(const QString& a) { m_attr_theme = a; m_has_attr_theme = true; }
+ inline void clearAttributeTheme() { m_has_attr_theme = false; }
+
+ inline bool hasAttributeResource() const { return m_has_attr_resource; }
+ inline QString attributeResource() const { return m_attr_resource; }
+ inline void setAttributeResource(const QString& a) { m_attr_resource = a; m_has_attr_resource = true; }
+ inline void clearAttributeResource() { m_has_attr_resource = false; }
+
+ // child element accessors
+ inline DomResourcePixmap* elementNormalOff() const { return m_normalOff; }
+ DomResourcePixmap* takeElementNormalOff();
+ void setElementNormalOff(DomResourcePixmap* a);
+ inline bool hasElementNormalOff() const { return m_children & NormalOff; }
+ void clearElementNormalOff();
+
+ inline DomResourcePixmap* elementNormalOn() const { return m_normalOn; }
+ DomResourcePixmap* takeElementNormalOn();
+ void setElementNormalOn(DomResourcePixmap* a);
+ inline bool hasElementNormalOn() const { return m_children & NormalOn; }
+ void clearElementNormalOn();
+
+ inline DomResourcePixmap* elementDisabledOff() const { return m_disabledOff; }
+ DomResourcePixmap* takeElementDisabledOff();
+ void setElementDisabledOff(DomResourcePixmap* a);
+ inline bool hasElementDisabledOff() const { return m_children & DisabledOff; }
+ void clearElementDisabledOff();
+
+ inline DomResourcePixmap* elementDisabledOn() const { return m_disabledOn; }
+ DomResourcePixmap* takeElementDisabledOn();
+ void setElementDisabledOn(DomResourcePixmap* a);
+ inline bool hasElementDisabledOn() const { return m_children & DisabledOn; }
+ void clearElementDisabledOn();
+
+ inline DomResourcePixmap* elementActiveOff() const { return m_activeOff; }
+ DomResourcePixmap* takeElementActiveOff();
+ void setElementActiveOff(DomResourcePixmap* a);
+ inline bool hasElementActiveOff() const { return m_children & ActiveOff; }
+ void clearElementActiveOff();
+
+ inline DomResourcePixmap* elementActiveOn() const { return m_activeOn; }
+ DomResourcePixmap* takeElementActiveOn();
+ void setElementActiveOn(DomResourcePixmap* a);
+ inline bool hasElementActiveOn() const { return m_children & ActiveOn; }
+ void clearElementActiveOn();
+
+ inline DomResourcePixmap* elementSelectedOff() const { return m_selectedOff; }
+ DomResourcePixmap* takeElementSelectedOff();
+ void setElementSelectedOff(DomResourcePixmap* a);
+ inline bool hasElementSelectedOff() const { return m_children & SelectedOff; }
+ void clearElementSelectedOff();
+
+ inline DomResourcePixmap* elementSelectedOn() const { return m_selectedOn; }
+ DomResourcePixmap* takeElementSelectedOn();
+ void setElementSelectedOn(DomResourcePixmap* a);
+ inline bool hasElementSelectedOn() const { return m_children & SelectedOn; }
+ void clearElementSelectedOn();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_theme;
+ bool m_has_attr_theme;
+
+ QString m_attr_resource;
+ bool m_has_attr_resource;
+
+ // child element data
+ uint m_children;
+ DomResourcePixmap* m_normalOff;
+ DomResourcePixmap* m_normalOn;
+ DomResourcePixmap* m_disabledOff;
+ DomResourcePixmap* m_disabledOn;
+ DomResourcePixmap* m_activeOff;
+ DomResourcePixmap* m_activeOn;
+ DomResourcePixmap* m_selectedOff;
+ DomResourcePixmap* m_selectedOn;
+ enum Child {
+ NormalOff = 1,
+ NormalOn = 2,
+ DisabledOff = 4,
+ DisabledOn = 8,
+ ActiveOff = 16,
+ ActiveOn = 32,
+ SelectedOff = 64,
+ SelectedOn = 128
+ };
+
+ DomResourceIcon(const DomResourceIcon &other);
+ void operator = (const DomResourceIcon&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomString {
+public:
+ DomString();
+ ~DomString();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeNotr() const { return m_has_attr_notr; }
+ inline QString attributeNotr() const { return m_attr_notr; }
+ inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+ inline void clearAttributeNotr() { m_has_attr_notr = false; }
+
+ inline bool hasAttributeComment() const { return m_has_attr_comment; }
+ inline QString attributeComment() const { return m_attr_comment; }
+ inline void setAttributeComment(const QString& a) { m_attr_comment = a; m_has_attr_comment = true; }
+ inline void clearAttributeComment() { m_has_attr_comment = false; }
+
+ inline bool hasAttributeExtraComment() const { return m_has_attr_extraComment; }
+ inline QString attributeExtraComment() const { return m_attr_extraComment; }
+ inline void setAttributeExtraComment(const QString& a) { m_attr_extraComment = a; m_has_attr_extraComment = true; }
+ inline void clearAttributeExtraComment() { m_has_attr_extraComment = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_notr;
+ bool m_has_attr_notr;
+
+ QString m_attr_comment;
+ bool m_has_attr_comment;
+
+ QString m_attr_extraComment;
+ bool m_has_attr_extraComment;
+
+ // child element data
+ uint m_children;
+
+ DomString(const DomString &other);
+ void operator = (const DomString&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPointF {
+public:
+ DomPointF();
+ ~DomPointF();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline double elementX() const { return m_x; }
+ void setElementX(double a);
+ inline bool hasElementX() const { return m_children & X; }
+ void clearElementX();
+
+ inline double elementY() const { return m_y; }
+ void setElementY(double a);
+ inline bool hasElementY() const { return m_children & Y; }
+ void clearElementY();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ double m_x;
+ double m_y;
+ enum Child {
+ X = 1,
+ Y = 2
+ };
+
+ DomPointF(const DomPointF &other);
+ void operator = (const DomPointF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomRectF {
+public:
+ DomRectF();
+ ~DomRectF();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline double elementX() const { return m_x; }
+ void setElementX(double a);
+ inline bool hasElementX() const { return m_children & X; }
+ void clearElementX();
+
+ inline double elementY() const { return m_y; }
+ void setElementY(double a);
+ inline bool hasElementY() const { return m_children & Y; }
+ void clearElementY();
+
+ inline double elementWidth() const { return m_width; }
+ void setElementWidth(double a);
+ inline bool hasElementWidth() const { return m_children & Width; }
+ void clearElementWidth();
+
+ inline double elementHeight() const { return m_height; }
+ void setElementHeight(double a);
+ inline bool hasElementHeight() const { return m_children & Height; }
+ void clearElementHeight();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ double m_x;
+ double m_y;
+ double m_width;
+ double m_height;
+ enum Child {
+ X = 1,
+ Y = 2,
+ Width = 4,
+ Height = 8
+ };
+
+ DomRectF(const DomRectF &other);
+ void operator = (const DomRectF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSizeF {
+public:
+ DomSizeF();
+ ~DomSizeF();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline double elementWidth() const { return m_width; }
+ void setElementWidth(double a);
+ inline bool hasElementWidth() const { return m_children & Width; }
+ void clearElementWidth();
+
+ inline double elementHeight() const { return m_height; }
+ void setElementHeight(double a);
+ inline bool hasElementHeight() const { return m_children & Height; }
+ void clearElementHeight();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ double m_width;
+ double m_height;
+ enum Child {
+ Width = 1,
+ Height = 2
+ };
+
+ DomSizeF(const DomSizeF &other);
+ void operator = (const DomSizeF&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomChar {
+public:
+ DomChar();
+ ~DomChar();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline int elementUnicode() const { return m_unicode; }
+ void setElementUnicode(int a);
+ inline bool hasElementUnicode() const { return m_children & Unicode; }
+ void clearElementUnicode();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ int m_unicode;
+ enum Child {
+ Unicode = 1
+ };
+
+ DomChar(const DomChar &other);
+ void operator = (const DomChar&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomUrl {
+public:
+ DomUrl();
+ ~DomUrl();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline DomString* elementString() const { return m_string; }
+ DomString* takeElementString();
+ void setElementString(DomString* a);
+ inline bool hasElementString() const { return m_children & String; }
+ void clearElementString();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ DomString* m_string;
+ enum Child {
+ String = 1
+ };
+
+ DomUrl(const DomUrl &other);
+ void operator = (const DomUrl&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomProperty {
+public:
+ DomProperty();
+ ~DomProperty();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ inline bool hasAttributeStdset() const { return m_has_attr_stdset; }
+ inline int attributeStdset() const { return m_attr_stdset; }
+ inline void setAttributeStdset(int a) { m_attr_stdset = a; m_has_attr_stdset = true; }
+ inline void clearAttributeStdset() { m_has_attr_stdset = false; }
+
+ // child element accessors
+ enum Kind { Unknown = 0, Bool, Color, Cstring, Cursor, CursorShape, Enum, Font, IconSet, Pixmap, Palette, Point, Rect, Set, Locale, SizePolicy, Size, String, StringList, Number, Float, Double, Date, Time, DateTime, PointF, RectF, SizeF, LongLong, Char, Url, UInt, ULongLong, Brush };
+ inline Kind kind() const { return m_kind; }
+
+ inline QString elementBool() const { return m_bool; }
+ void setElementBool(const QString& a);
+
+ inline DomColor* elementColor() const { return m_color; }
+ DomColor* takeElementColor();
+ void setElementColor(DomColor* a);
+
+ inline QString elementCstring() const { return m_cstring; }
+ void setElementCstring(const QString& a);
+
+ inline int elementCursor() const { return m_cursor; }
+ void setElementCursor(int a);
+
+ inline QString elementCursorShape() const { return m_cursorShape; }
+ void setElementCursorShape(const QString& a);
+
+ inline QString elementEnum() const { return m_enum; }
+ void setElementEnum(const QString& a);
+
+ inline DomFont* elementFont() const { return m_font; }
+ DomFont* takeElementFont();
+ void setElementFont(DomFont* a);
+
+ inline DomResourceIcon* elementIconSet() const { return m_iconSet; }
+ DomResourceIcon* takeElementIconSet();
+ void setElementIconSet(DomResourceIcon* a);
+
+ inline DomResourcePixmap* elementPixmap() const { return m_pixmap; }
+ DomResourcePixmap* takeElementPixmap();
+ void setElementPixmap(DomResourcePixmap* a);
+
+ inline DomPalette* elementPalette() const { return m_palette; }
+ DomPalette* takeElementPalette();
+ void setElementPalette(DomPalette* a);
+
+ inline DomPoint* elementPoint() const { return m_point; }
+ DomPoint* takeElementPoint();
+ void setElementPoint(DomPoint* a);
+
+ inline DomRect* elementRect() const { return m_rect; }
+ DomRect* takeElementRect();
+ void setElementRect(DomRect* a);
+
+ inline QString elementSet() const { return m_set; }
+ void setElementSet(const QString& a);
+
+ inline DomLocale* elementLocale() const { return m_locale; }
+ DomLocale* takeElementLocale();
+ void setElementLocale(DomLocale* a);
+
+ inline DomSizePolicy* elementSizePolicy() const { return m_sizePolicy; }
+ DomSizePolicy* takeElementSizePolicy();
+ void setElementSizePolicy(DomSizePolicy* a);
+
+ inline DomSize* elementSize() const { return m_size; }
+ DomSize* takeElementSize();
+ void setElementSize(DomSize* a);
+
+ inline DomString* elementString() const { return m_string; }
+ DomString* takeElementString();
+ void setElementString(DomString* a);
+
+ inline DomStringList* elementStringList() const { return m_stringList; }
+ DomStringList* takeElementStringList();
+ void setElementStringList(DomStringList* a);
+
+ inline int elementNumber() const { return m_number; }
+ void setElementNumber(int a);
+
+ inline float elementFloat() const { return m_float; }
+ void setElementFloat(float a);
+
+ inline double elementDouble() const { return m_double; }
+ void setElementDouble(double a);
+
+ inline DomDate* elementDate() const { return m_date; }
+ DomDate* takeElementDate();
+ void setElementDate(DomDate* a);
+
+ inline DomTime* elementTime() const { return m_time; }
+ DomTime* takeElementTime();
+ void setElementTime(DomTime* a);
+
+ inline DomDateTime* elementDateTime() const { return m_dateTime; }
+ DomDateTime* takeElementDateTime();
+ void setElementDateTime(DomDateTime* a);
+
+ inline DomPointF* elementPointF() const { return m_pointF; }
+ DomPointF* takeElementPointF();
+ void setElementPointF(DomPointF* a);
+
+ inline DomRectF* elementRectF() const { return m_rectF; }
+ DomRectF* takeElementRectF();
+ void setElementRectF(DomRectF* a);
+
+ inline DomSizeF* elementSizeF() const { return m_sizeF; }
+ DomSizeF* takeElementSizeF();
+ void setElementSizeF(DomSizeF* a);
+
+ inline qlonglong elementLongLong() const { return m_longLong; }
+ void setElementLongLong(qlonglong a);
+
+ inline DomChar* elementChar() const { return m_char; }
+ DomChar* takeElementChar();
+ void setElementChar(DomChar* a);
+
+ inline DomUrl* elementUrl() const { return m_url; }
+ DomUrl* takeElementUrl();
+ void setElementUrl(DomUrl* a);
+
+ inline uint elementUInt() const { return m_UInt; }
+ void setElementUInt(uint a);
+
+ inline qulonglong elementULongLong() const { return m_uLongLong; }
+ void setElementULongLong(qulonglong a);
+
+ inline DomBrush* elementBrush() const { return m_brush; }
+ DomBrush* takeElementBrush();
+ void setElementBrush(DomBrush* a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ int m_attr_stdset;
+ bool m_has_attr_stdset;
+
+ // child element data
+ Kind m_kind;
+ QString m_bool;
+ DomColor* m_color;
+ QString m_cstring;
+ int m_cursor;
+ QString m_cursorShape;
+ QString m_enum;
+ DomFont* m_font;
+ DomResourceIcon* m_iconSet;
+ DomResourcePixmap* m_pixmap;
+ DomPalette* m_palette;
+ DomPoint* m_point;
+ DomRect* m_rect;
+ QString m_set;
+ DomLocale* m_locale;
+ DomSizePolicy* m_sizePolicy;
+ DomSize* m_size;
+ DomString* m_string;
+ DomStringList* m_stringList;
+ int m_number;
+ float m_float;
+ double m_double;
+ DomDate* m_date;
+ DomTime* m_time;
+ DomDateTime* m_dateTime;
+ DomPointF* m_pointF;
+ DomRectF* m_rectF;
+ DomSizeF* m_sizeF;
+ qlonglong m_longLong;
+ DomChar* m_char;
+ DomUrl* m_url;
+ uint m_UInt;
+ qulonglong m_uLongLong;
+ DomBrush* m_brush;
+
+ DomProperty(const DomProperty &other);
+ void operator = (const DomProperty&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnections {
+public:
+ DomConnections();
+ ~DomConnections();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomConnection*> elementConnection() const { return m_connection; }
+ void setElementConnection(const QList<DomConnection*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomConnection*> m_connection;
+ enum Child {
+ Connection = 1
+ };
+
+ DomConnections(const DomConnections &other);
+ void operator = (const DomConnections&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnection {
+public:
+ DomConnection();
+ ~DomConnection();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QString elementSender() const { return m_sender; }
+ void setElementSender(const QString& a);
+ inline bool hasElementSender() const { return m_children & Sender; }
+ void clearElementSender();
+
+ inline QString elementSignal() const { return m_signal; }
+ void setElementSignal(const QString& a);
+ inline bool hasElementSignal() const { return m_children & Signal; }
+ void clearElementSignal();
+
+ inline QString elementReceiver() const { return m_receiver; }
+ void setElementReceiver(const QString& a);
+ inline bool hasElementReceiver() const { return m_children & Receiver; }
+ void clearElementReceiver();
+
+ inline QString elementSlot() const { return m_slot; }
+ void setElementSlot(const QString& a);
+ inline bool hasElementSlot() const { return m_children & Slot; }
+ void clearElementSlot();
+
+ inline DomConnectionHints* elementHints() const { return m_hints; }
+ DomConnectionHints* takeElementHints();
+ void setElementHints(DomConnectionHints* a);
+ inline bool hasElementHints() const { return m_children & Hints; }
+ void clearElementHints();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QString m_sender;
+ QString m_signal;
+ QString m_receiver;
+ QString m_slot;
+ DomConnectionHints* m_hints;
+ enum Child {
+ Sender = 1,
+ Signal = 2,
+ Receiver = 4,
+ Slot = 8,
+ Hints = 16
+ };
+
+ DomConnection(const DomConnection &other);
+ void operator = (const DomConnection&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnectionHints {
+public:
+ DomConnectionHints();
+ ~DomConnectionHints();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomConnectionHint*> elementHint() const { return m_hint; }
+ void setElementHint(const QList<DomConnectionHint*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomConnectionHint*> m_hint;
+ enum Child {
+ Hint = 1
+ };
+
+ DomConnectionHints(const DomConnectionHints &other);
+ void operator = (const DomConnectionHints&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomConnectionHint {
+public:
+ DomConnectionHint();
+ ~DomConnectionHint();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeType() const { return m_has_attr_type; }
+ inline QString attributeType() const { return m_attr_type; }
+ inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void clearAttributeType() { m_has_attr_type = false; }
+
+ // child element accessors
+ inline int elementX() const { return m_x; }
+ void setElementX(int a);
+ inline bool hasElementX() const { return m_children & X; }
+ void clearElementX();
+
+ inline int elementY() const { return m_y; }
+ void setElementY(int a);
+ inline bool hasElementY() const { return m_children & Y; }
+ void clearElementY();
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_type;
+ bool m_has_attr_type;
+
+ // child element data
+ uint m_children;
+ int m_x;
+ int m_y;
+ enum Child {
+ X = 1,
+ Y = 2
+ };
+
+ DomConnectionHint(const DomConnectionHint &other);
+ void operator = (const DomConnectionHint&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomScript {
+public:
+ DomScript();
+ ~DomScript();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeSource() const { return m_has_attr_source; }
+ inline QString attributeSource() const { return m_attr_source; }
+ inline void setAttributeSource(const QString& a) { m_attr_source = a; m_has_attr_source = true; }
+ inline void clearAttributeSource() { m_has_attr_source = false; }
+
+ inline bool hasAttributeLanguage() const { return m_has_attr_language; }
+ inline QString attributeLanguage() const { return m_attr_language; }
+ inline void setAttributeLanguage(const QString& a) { m_attr_language = a; m_has_attr_language = true; }
+ inline void clearAttributeLanguage() { m_has_attr_language = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_source;
+ bool m_has_attr_source;
+
+ QString m_attr_language;
+ bool m_has_attr_language;
+
+ // child element data
+ uint m_children;
+
+ DomScript(const DomScript &other);
+ void operator = (const DomScript&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomWidgetData {
+public:
+ DomWidgetData();
+ ~DomWidgetData();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomWidgetData(const DomWidgetData &other);
+ void operator = (const DomWidgetData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomDesignerData {
+public:
+ DomDesignerData();
+ ~DomDesignerData();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomProperty*> elementProperty() const { return m_property; }
+ void setElementProperty(const QList<DomProperty*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomProperty*> m_property;
+ enum Child {
+ Property = 1
+ };
+
+ DomDesignerData(const DomDesignerData &other);
+ void operator = (const DomDesignerData&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomSlots {
+public:
+ DomSlots();
+ ~DomSlots();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QStringList elementSignal() const { return m_signal; }
+ void setElementSignal(const QStringList& a);
+
+ inline QStringList elementSlot() const { return m_slot; }
+ void setElementSlot(const QStringList& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QStringList m_signal;
+ QStringList m_slot;
+ enum Child {
+ Signal = 1,
+ Slot = 2
+ };
+
+ DomSlots(const DomSlots &other);
+ void operator = (const DomSlots&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomPropertySpecifications {
+public:
+ DomPropertySpecifications();
+ ~DomPropertySpecifications();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ // child element accessors
+ inline QList<DomStringPropertySpecification*> elementStringpropertyspecification() const { return m_stringpropertyspecification; }
+ void setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a);
+
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ // child element data
+ uint m_children;
+ QList<DomStringPropertySpecification*> m_stringpropertyspecification;
+ enum Child {
+ Stringpropertyspecification = 1
+ };
+
+ DomPropertySpecifications(const DomPropertySpecifications &other);
+ void operator = (const DomPropertySpecifications&other);
+};
+
+class QDESIGNER_UILIB_EXPORT DomStringPropertySpecification {
+public:
+ DomStringPropertySpecification();
+ ~DomStringPropertySpecification();
+
+ void read(QXmlStreamReader &reader);
+ void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
+ inline QString text() const { return m_text; }
+ inline void setText(const QString &s) { m_text = s; }
+
+ // attribute accessors
+ inline bool hasAttributeName() const { return m_has_attr_name; }
+ inline QString attributeName() const { return m_attr_name; }
+ inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
+ inline void clearAttributeName() { m_has_attr_name = false; }
+
+ inline bool hasAttributeType() const { return m_has_attr_type; }
+ inline QString attributeType() const { return m_attr_type; }
+ inline void setAttributeType(const QString& a) { m_attr_type = a; m_has_attr_type = true; }
+ inline void clearAttributeType() { m_has_attr_type = false; }
+
+ inline bool hasAttributeNotr() const { return m_has_attr_notr; }
+ inline QString attributeNotr() const { return m_attr_notr; }
+ inline void setAttributeNotr(const QString& a) { m_attr_notr = a; m_has_attr_notr = true; }
+ inline void clearAttributeNotr() { m_has_attr_notr = false; }
+
+ // child element accessors
+private:
+ QString m_text;
+ void clear(bool clear_all = true);
+
+ // attribute data
+ QString m_attr_name;
+ bool m_has_attr_name;
+
+ QString m_attr_type;
+ bool m_has_attr_type;
+
+ QString m_attr_notr;
+ bool m_has_attr_notr;
+
+ // child element data
+ uint m_children;
+
+ DomStringPropertySpecification(const DomStringPropertySpecification &other);
+ void operator = (const DomStringPropertySpecification&other);
+};
+
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+#endif // UI4_H
diff --git a/src/designer/src/lib/uilib/uilib.pri b/src/designer/src/lib/uilib/uilib.pri
new file mode 100644
index 000000000..75904c2f6
--- /dev/null
+++ b/src/designer/src/lib/uilib/uilib.pri
@@ -0,0 +1,34 @@
+
+INCLUDEPATH += $$PWD
+
+DEFINES += QT_DESIGNER
+!contains(QT_CONFIG, script): DEFINES += QT_FORMBUILDER_NO_SCRIPT
+
+QT += gui widgets
+
+# Input
+HEADERS += \
+ $$PWD/ui4_p.h \
+ $$PWD/abstractformbuilder.h \
+ $$PWD/formbuilder.h \
+ $$PWD/container.h \
+ $$PWD/customwidget.h \
+ $$PWD/properties_p.h \
+ $$PWD/formbuilderextra_p.h \
+ $$PWD/resourcebuilder_p.h \
+ $$PWD/textbuilder_p.h
+
+SOURCES += \
+ $$PWD/abstractformbuilder.cpp \
+ $$PWD/formbuilder.cpp \
+ $$PWD/ui4.cpp \
+ $$PWD/properties.cpp \
+ $$PWD/formbuilderextra.cpp \
+ $$PWD/resourcebuilder.cpp \
+ $$PWD/textbuilder.cpp
+
+!contains(DEFINES, QT_FORMBUILDER_NO_SCRIPT) {
+ QT += script
+ HEADERS += $$PWD/formscriptrunner_p.h
+ SOURCES += $$PWD/formscriptrunner.cpp
+}
diff --git a/src/designer/src/lib/uilib/uilib_global.h b/src/designer/src/lib/uilib/uilib_global.h
new file mode 100644
index 000000000..b27a9bd3f
--- /dev/null
+++ b/src/designer/src/lib/uilib/uilib_global.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UILIB_GLOBAL_H
+#define UILIB_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+#define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT
+#define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT
+
+#ifdef QT_DESIGNER_STATIC
+# define QDESIGNER_UILIB_EXPORT
+#elif defined(QDESIGNER_UILIB_LIBRARY)
+# define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_EXTERN
+#else
+# define QDESIGNER_UILIB_EXPORT QDESIGNER_UILIB_IMPORT
+#endif
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // UILIB_GLOBAL_H
diff --git a/src/designer/src/lib/uilib/widgets.table b/src/designer/src/lib/uilib/widgets.table
new file mode 100644
index 000000000..9b8727849
--- /dev/null
+++ b/src/designer/src/lib/uilib/widgets.table
@@ -0,0 +1,148 @@
+
+#ifndef DECLARE_WIDGET_1
+# define DECLARE_WIDGET_1(a,b) DECLARE_WIDGET(a,b)
+#endif
+
+// widgets
+#ifndef QT_NO_CHECKBOX
+DECLARE_WIDGET(QCheckBox, "text")
+#endif
+#ifndef QT_NO_COMBOBOX
+DECLARE_WIDGET(QComboBox, "")
+#endif
+#ifndef QT_NO_DATETIMEEDIT
+DECLARE_WIDGET(QDateTimeEdit, "")
+#endif
+#ifndef QT_NO_DATEEDIT
+DECLARE_WIDGET(QDateEdit, "")
+#endif
+#ifndef QT_NO_TIMEEDIT
+DECLARE_WIDGET(QTimeEdit, "")
+#endif
+#ifndef QT_NO_DIAL
+DECLARE_WIDGET(QDial, "")
+#endif
+DECLARE_WIDGET(QDialog, "")
+#ifndef QT_NO_DOCKWIDGET
+DECLARE_WIDGET(QDockWidget, "")
+#endif
+DECLARE_WIDGET(QFrame, "")
+#ifndef QT_NO_GROUPBOX
+DECLARE_WIDGET(QGroupBox, "")
+#endif
+#ifndef QT_NO_SCROLLAREA
+DECLARE_WIDGET(QScrollArea, "")
+#endif
+#ifndef QT_NO_LCDNUMBER
+DECLARE_WIDGET(QLCDNumber, "")
+#endif
+DECLARE_WIDGET(QLabel, "")
+#ifndef QT_NO_LINEEDIT
+DECLARE_WIDGET(QLineEdit, "")
+#endif
+#ifndef QT_NO_LISTVIEW
+DECLARE_WIDGET(QListView, "")
+#endif
+#ifndef QT_NO_LISTWIDGET
+DECLARE_WIDGET(QListWidget, "")
+#endif
+#ifndef QT_NO_MAINWINDOW
+DECLARE_WIDGET(QMainWindow, "")
+#endif
+#ifndef QT_NO_MDIAREA
+DECLARE_WIDGET(QMdiArea, "")
+#endif
+#ifndef QT_NO_MENU
+DECLARE_WIDGET(QMenu, "")
+#endif
+#ifndef QT_NO_MENUBAR
+DECLARE_WIDGET(QMenuBar, "")
+#endif
+#ifndef QT_NO_PROGRESSBAR
+DECLARE_WIDGET(QProgressBar, "")
+#endif
+DECLARE_WIDGET(QPushButton, "text")
+DECLARE_WIDGET(QRadioButton, "text")
+DECLARE_WIDGET(QCommandLinkButton, "text")
+#ifndef QT_NO_SCROLLBAR
+DECLARE_WIDGET(QScrollBar, "")
+#endif
+#ifndef QT_NO_SLIDER
+DECLARE_WIDGET(QSlider, "")
+#endif
+#ifndef QT_NO_SPINBOX
+DECLARE_WIDGET(QSpinBox, "")
+DECLARE_WIDGET(QDoubleSpinBox, "")
+#endif
+#ifndef QT_NO_TABWIDGET
+DECLARE_WIDGET(QTabWidget, "")
+#endif
+#ifndef QT_NO_TABLEVIEW
+DECLARE_WIDGET(QTableView, "")
+#endif
+#ifndef QT_NO_TABLEWIDGET
+DECLARE_WIDGET(QTableWidget, "")
+#endif
+#ifndef QT_NO_TEXTBROWSER
+DECLARE_WIDGET(QTextBrowser, "")
+#endif
+#ifndef QT_NO_TEXTEDIT
+DECLARE_WIDGET(QTextEdit, "")
+DECLARE_WIDGET(QPlainTextEdit, "")
+#endif
+#ifndef QT_NO_TOOLBAR
+DECLARE_WIDGET(QToolBar, "")
+#endif
+#ifndef QT_NO_TOOLBOX
+DECLARE_WIDGET(QToolBox, "")
+#endif
+#ifndef QT_NO_TOOLBUTTON
+DECLARE_WIDGET(QToolButton, "text")
+#endif
+#ifndef QT_NO_TREEVIEW
+DECLARE_WIDGET(QTreeView, "")
+#endif
+#ifndef QT_NO_TREEWIDGET
+DECLARE_WIDGET(QTreeWidget, "")
+#endif
+DECLARE_WIDGET(QWidget, "")
+#ifndef QT_NO_WORKSPACE
+DECLARE_WIDGET(QWorkspace, "")
+#endif
+#ifndef QT_NO_SPLITTER
+DECLARE_WIDGET(QSplitter, "")
+#endif
+#ifndef QT_NO_STACKEDWIDGET
+DECLARE_WIDGET(QStackedWidget, "")
+#endif
+#ifndef QT_NO_STATUSBAR
+DECLARE_WIDGET(QStatusBar, "")
+#endif
+DECLARE_WIDGET(QDialogButtonBox, "")
+#ifndef QT_NO_FONTCOMBOBOX
+DECLARE_WIDGET(QFontComboBox, "")
+#endif
+#ifndef QT_NO_CALENDARWIDGET
+DECLARE_WIDGET(QCalendarWidget, "")
+#endif
+#ifndef QT_NO_COLUMNVIEW
+DECLARE_WIDGET(QColumnView, "")
+#endif
+
+#ifndef QT_NO_WIZARD
+DECLARE_WIDGET(QWizard, "")
+DECLARE_WIDGET(QWizardPage, "")
+#endif
+
+#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
+DECLARE_WIDGET_1(QGraphicsView, "")
+#endif
+
+// layouts
+DECLARE_LAYOUT(QGridLayout, "")
+DECLARE_LAYOUT(QHBoxLayout, "")
+DECLARE_LAYOUT(QStackedLayout, "")
+DECLARE_LAYOUT(QVBoxLayout, "")
+#ifndef QT_NO_FORMLAYOUT
+DECLARE_LAYOUT(QFormLayout, "")
+#endif
diff --git a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp
index fb901560e..4c7c1a7b3 100644
--- a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp
+++ b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp
@@ -49,7 +49,7 @@
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtCore/qplugin.h>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
#include <ActiveQt/QAxWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp b/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp
index 0830fe27f..95d6f7342 100644
--- a/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp
+++ b/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp
@@ -48,9 +48,9 @@
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QExtensionManager>
-#include <QtGui/QUndoCommand>
-#include <QtGui/QMessageBox>
-#include <QtGui/QUndoStack>
+#include <QtWidgets/QUndoCommand>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QUndoStack>
#include <QtCore/QUuid>
#include <ActiveQt/qaxselect.h>
diff --git a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp
index 93d6bfa3a..c640fcf18 100644
--- a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp
+++ b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp
@@ -43,9 +43,9 @@
#include <QtCore/QMetaProperty>
#include <QtCore/QDebug>
-#include <QtGui/QIcon>
+#include <QtWidgets/QIcon>
#include <QtGui/QPainter>
-#include <QtGui/QResizeEvent>
+#include <QtWidgets/QResizeEvent>
#include <ActiveQt/QAxWidget>
diff --git a/src/designer/src/plugins/activeqt/qdesigneraxwidget.h b/src/designer/src/plugins/activeqt/qdesigneraxwidget.h
index 2d0830469..cfbfc3605 100644
--- a/src/designer/src/plugins/activeqt/qdesigneraxwidget.h
+++ b/src/designer/src/plugins/activeqt/qdesigneraxwidget.h
@@ -44,7 +44,7 @@
#include <QtCore/QPointer>
#include <QtCore/QMap>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
#include <QtGui/QPixmap>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/plugins/phononwidgets/phononwidgets.pro b/src/designer/src/plugins/phononwidgets/phononwidgets.pro
index 9cabfd761..1da3f5bf8 100644
--- a/src/designer/src/plugins/phononwidgets/phononwidgets.pro
+++ b/src/designer/src/plugins/phononwidgets/phononwidgets.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
TARGET = phononwidgets
CONFIG += qt warn_on plugin
-QT += phonon designer-private
+QT += widgets phonon designer-private
include(../plugins.pri)
build_all:!build_pass {
diff --git a/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp b/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp
index 203509a83..4932aeeaa 100644
--- a/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp
+++ b/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp
@@ -49,12 +49,12 @@
#include <phonon/videoplayer.h>
#include <phonon/mediaobject.h>
-#include <QtGui/QPlainTextEdit>
-#include <QtGui/QDialogButtonBox>
-#include <QtGui/QAction>
-#include <QtGui/QVBoxLayout>
-#include <QtGui/QFileDialog>
-#include <QtGui/QMessageBox>
+#include <QtWidgets/QPlainTextEdit>
+#include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QMessageBox>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/plugins/qwebview/qwebview.pro b/src/designer/src/plugins/qwebview/qwebview.pro
index b1f6371d1..cbbc37d2d 100644
--- a/src/designer/src/plugins/qwebview/qwebview.pro
+++ b/src/designer/src/plugins/qwebview/qwebview.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
TARGET = qwebview
CONFIG += qt warn_on plugin
-QT += webkit
+QT += widgets webkit
include(../plugins.pri)
build_all:!build_pass {
diff --git a/src/designer/src/plugins/tools/view3d/view3d.h b/src/designer/src/plugins/tools/view3d/view3d.h
index 7acae6d54..8eeb3645d 100644
--- a/src/designer/src/plugins/tools/view3d/view3d.h
+++ b/src/designer/src/plugins/tools/view3d/view3d.h
@@ -43,7 +43,7 @@
#define VIEW3D_H
#include "view3d_global.h"
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp b/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp
index 6ff261560..11967e733 100644
--- a/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp
+++ b/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp
@@ -41,7 +41,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qplugin.h>
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include "view3d_plugin.h"
#include "view3d_tool.h"
diff --git a/src/designer/src/plugins/tools/view3d/view3d_tool.cpp b/src/designer/src/plugins/tools/view3d/view3d_tool.cpp
index 801528543..3ba767dc6 100644
--- a/src/designer/src/plugins/tools/view3d/view3d_tool.cpp
+++ b/src/designer/src/plugins/tools/view3d/view3d_tool.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QAction>
+#include <QtWidgets/QAction>
#include "view3d_tool.h"
QView3DTool::QView3DTool(QDesignerFormWindowInterface *formWindow, QObject *parent)
diff --git a/src/designer/src/src.pro b/src/designer/src/src.pro
index 40da11ffc..9802c653d 100644
--- a/src/designer/src/src.pro
+++ b/src/designer/src/src.pro
@@ -2,6 +2,7 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = \
+ uitools \
lib \
components \
designer
diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp
new file mode 100644
index 000000000..19d4277ae
--- /dev/null
+++ b/src/designer/src/uitools/quiloader.cpp
@@ -0,0 +1,954 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "quiloader.h"
+#include "quiloader_p.h"
+#include "customwidget.h"
+
+#include <formbuilder.h>
+#include <formbuilderextra_p.h>
+#include <textbuilder_p.h>
+#include <ui4_p.h>
+
+#include <QtCore/qdebug.h>
+#include <QtWidgets/QAction>
+#include <QtWidgets/QActionGroup>
+#include <QtWidgets/QApplication>
+#include <QtCore/QDir>
+#include <QtCore/QLibraryInfo>
+#include <QtWidgets/QLayout>
+#include <QtWidgets/QWidget>
+#include <QtCore/QMap>
+#include <QtWidgets/QTabWidget>
+#include <QtWidgets/QTreeWidget>
+#include <QtWidgets/QListWidget>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QToolBox>
+#include <QtWidgets/QComboBox>
+#include <QtWidgets/QFontComboBox>
+
+QT_BEGIN_NAMESPACE
+
+typedef QMap<QString, bool> widget_map;
+Q_GLOBAL_STATIC(widget_map, g_widgets)
+
+class QUiLoader;
+class QUiLoaderPrivate;
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+class TranslatingTextBuilder : public QTextBuilder
+{
+public:
+ TranslatingTextBuilder(bool trEnabled, const QByteArray &className) :
+ m_trEnabled(trEnabled), m_className(className) {}
+
+ virtual QVariant loadText(const DomProperty *icon) const;
+
+ virtual QVariant toNativeValue(const QVariant &value) const;
+
+private:
+ bool m_trEnabled;
+ QByteArray m_className;
+};
+
+QVariant TranslatingTextBuilder::loadText(const DomProperty *text) const
+{
+ const DomString *str = text->elementString();
+ if (!str)
+ return QVariant();
+ if (str->hasAttributeNotr()) {
+ const QString notr = str->attributeNotr();
+ if (notr == QLatin1String("true") || notr == QLatin1String("yes"))
+ return QVariant::fromValue(str->text());
+ }
+ QUiTranslatableStringValue strVal;
+ strVal.setValue(str->text().toUtf8());
+ if (str->hasAttributeComment())
+ strVal.setComment(str->attributeComment().toUtf8());
+ return QVariant::fromValue(strVal);
+}
+
+QVariant TranslatingTextBuilder::toNativeValue(const QVariant &value) const
+{
+ if (value.canConvert<QUiTranslatableStringValue>()) {
+ QUiTranslatableStringValue tsv = qvariant_cast<QUiTranslatableStringValue>(value);
+ if (!m_trEnabled)
+ return QString::fromUtf8(tsv.value().data());
+ return QVariant::fromValue(
+ QApplication::translate(m_className, tsv.value(), tsv.comment(),
+ QCoreApplication::UnicodeUTF8));
+ }
+ if (value.canConvert<QString>())
+ return QVariant::fromValue(qvariant_cast<QString>(value));
+ return value;
+}
+
+// This is "exported" to linguist
+const QUiItemRolePair qUiItemRoles[] = {
+ { Qt::DisplayRole, Qt::DisplayPropertyRole },
+#ifndef QT_NO_TOOLTIP
+ { Qt::ToolTipRole, Qt::ToolTipPropertyRole },
+#endif
+#ifndef QT_NO_STATUSTIP
+ { Qt::StatusTipRole, Qt::StatusTipPropertyRole },
+#endif
+#ifndef QT_NO_WHATSTHIS
+ { Qt::WhatsThisRole, Qt::WhatsThisPropertyRole },
+#endif
+ { -1 , -1 }
+};
+
+static void recursiveReTranslate(QTreeWidgetItem *item, const QByteArray &class_name)
+{
+ const QUiItemRolePair *irs = qUiItemRoles;
+
+ int cnt = item->columnCount();
+ for (int i = 0; i < cnt; ++i) {
+ for (unsigned j = 0; irs[j].shadowRole >= 0; j++) {
+ QVariant v = item->data(i, irs[j].shadowRole);
+ if (v.isValid()) {
+ QUiTranslatableStringValue tsv = qvariant_cast<QUiTranslatableStringValue>(v);
+ const QString text = QApplication::translate(class_name,
+ tsv.value(), tsv.comment(),
+ QCoreApplication::UnicodeUTF8);
+ item->setData(i, irs[j].realRole, text);
+ }
+ }
+ }
+
+ cnt = item->childCount();
+ for (int i = 0; i < cnt; ++i)
+ recursiveReTranslate(item->child(i), class_name);
+}
+
+template<typename T>
+static void reTranslateWidgetItem(T *item, const QByteArray &class_name)
+{
+ const QUiItemRolePair *irs = qUiItemRoles;
+
+ for (unsigned j = 0; irs[j].shadowRole >= 0; j++) {
+ QVariant v = item->data(irs[j].shadowRole);
+ if (v.isValid()) {
+ QUiTranslatableStringValue tsv = qvariant_cast<QUiTranslatableStringValue>(v);
+ const QString text = QApplication::translate(class_name,
+ tsv.value(), tsv.comment(),
+ QCoreApplication::UnicodeUTF8);
+ item->setData(irs[j].realRole, text);
+ }
+ }
+}
+
+static void reTranslateTableItem(QTableWidgetItem *item, const QByteArray &class_name)
+{
+ if (item)
+ reTranslateWidgetItem(item, class_name);
+}
+
+#define RETRANSLATE_SUBWIDGET_PROP(mainWidget, setter, propName) \
+ do { \
+ QVariant v = mainWidget->widget(i)->property(propName); \
+ if (v.isValid()) { \
+ QUiTranslatableStringValue tsv = qvariant_cast<QUiTranslatableStringValue>(v); \
+ const QString text = QApplication::translate(m_className, \
+ tsv.value(), tsv.comment(), \
+ QCoreApplication::UnicodeUTF8); \
+ mainWidget->setter(i, text); \
+ } \
+ } while (0)
+
+class TranslationWatcher: public QObject
+{
+ Q_OBJECT
+
+public:
+ TranslationWatcher(QObject *parent, const QByteArray &className):
+ QObject(parent),
+ m_className(className)
+ {
+ }
+
+ virtual bool eventFilter(QObject *o, QEvent *event)
+ {
+ if (event->type() == QEvent::LanguageChange) {
+ foreach (const QByteArray &prop, o->dynamicPropertyNames()) {
+ if (prop.startsWith(PROP_GENERIC_PREFIX)) {
+ const QByteArray propName = prop.mid(sizeof(PROP_GENERIC_PREFIX) - 1);
+ const QUiTranslatableStringValue tsv =
+ qvariant_cast<QUiTranslatableStringValue>(o->property(prop));
+ const QString text = QApplication::translate(m_className,
+ tsv.value(), tsv.comment(),
+ QCoreApplication::UnicodeUTF8);
+ o->setProperty(propName, text);
+ }
+ }
+ if (0) {
+#ifndef QT_NO_TABWIDGET
+ } else if (QTabWidget *tabw = qobject_cast<QTabWidget*>(o)) {
+ const int cnt = tabw->count();
+ for (int i = 0; i < cnt; ++i) {
+ RETRANSLATE_SUBWIDGET_PROP(tabw, setTabText, PROP_TABPAGETEXT);
+# ifndef QT_NO_TOOLTIP
+ RETRANSLATE_SUBWIDGET_PROP(tabw, setTabToolTip, PROP_TABPAGETOOLTIP);
+# endif
+# ifndef QT_NO_WHATSTHIS
+ RETRANSLATE_SUBWIDGET_PROP(tabw, setTabWhatsThis, PROP_TABPAGEWHATSTHIS);
+# endif
+ }
+#endif
+#ifndef QT_NO_LISTWIDGET
+ } else if (QListWidget *listw = qobject_cast<QListWidget*>(o)) {
+ const int cnt = listw->count();
+ for (int i = 0; i < cnt; ++i)
+ reTranslateWidgetItem(listw->item(i), m_className);
+#endif
+#ifndef QT_NO_TREEWIDGET
+ } else if (QTreeWidget *treew = qobject_cast<QTreeWidget*>(o)) {
+ if (QTreeWidgetItem *item = treew->headerItem())
+ recursiveReTranslate(item, m_className);
+ const int cnt = treew->topLevelItemCount();
+ for (int i = 0; i < cnt; ++i) {
+ QTreeWidgetItem *item = treew->topLevelItem(i);
+ recursiveReTranslate(item, m_className);
+ }
+#endif
+#ifndef QT_NO_TABLEWIDGET
+ } else if (QTableWidget *tablew = qobject_cast<QTableWidget*>(o)) {
+ const int row_cnt = tablew->rowCount();
+ const int col_cnt = tablew->columnCount();
+ for (int j = 0; j < col_cnt; ++j)
+ reTranslateTableItem(tablew->horizontalHeaderItem(j), m_className);
+ for (int i = 0; i < row_cnt; ++i) {
+ reTranslateTableItem(tablew->verticalHeaderItem(i), m_className);
+ for (int j = 0; j < col_cnt; ++j)
+ reTranslateTableItem(tablew->item(i, j), m_className);
+ }
+#endif
+#ifndef QT_NO_COMBOBOX
+ } else if (QComboBox *combow = qobject_cast<QComboBox*>(o)) {
+ if (!qobject_cast<QFontComboBox*>(o)) {
+ const int cnt = combow->count();
+ for (int i = 0; i < cnt; ++i) {
+ const QVariant v = combow->itemData(i, Qt::DisplayPropertyRole);
+ if (v.isValid()) {
+ QUiTranslatableStringValue tsv = qvariant_cast<QUiTranslatableStringValue>(v);
+ const QString text = QApplication::translate(m_className,
+ tsv.value(), tsv.comment(),
+ QCoreApplication::UnicodeUTF8);
+ combow->setItemText(i, text);
+ }
+ }
+ }
+#endif
+#ifndef QT_NO_TOOLBOX
+ } else if (QToolBox *toolw = qobject_cast<QToolBox*>(o)) {
+ const int cnt = toolw->count();
+ for (int i = 0; i < cnt; ++i) {
+ RETRANSLATE_SUBWIDGET_PROP(toolw, setItemText, PROP_TOOLITEMTEXT);
+# ifndef QT_NO_TOOLTIP
+ RETRANSLATE_SUBWIDGET_PROP(toolw, setItemToolTip, PROP_TOOLITEMTOOLTIP);
+# endif
+ }
+#endif
+ }
+ }
+ return false;
+ }
+
+private:
+ QByteArray m_className;
+};
+
+class FormBuilderPrivate: public QFormBuilder
+{
+ friend class QT_PREPEND_NAMESPACE(QUiLoader);
+ friend class QT_PREPEND_NAMESPACE(QUiLoaderPrivate);
+ typedef QFormBuilder ParentClass;
+
+public:
+ QUiLoader *loader;
+
+ bool dynamicTr;
+ bool trEnabled;
+
+ FormBuilderPrivate(): loader(0), dynamicTr(false), trEnabled(true), m_trwatch(0) {}
+
+ QWidget *defaultCreateWidget(const QString &className, QWidget *parent, const QString &name)
+ {
+ return ParentClass::createWidget(className, parent, name);
+ }
+
+ QLayout *defaultCreateLayout(const QString &className, QObject *parent, const QString &name)
+ {
+ return ParentClass::createLayout(className, parent, name);
+ }
+
+ QAction *defaultCreateAction(QObject *parent, const QString &name)
+ {
+ return ParentClass::createAction(parent, name);
+ }
+
+ QActionGroup *defaultCreateActionGroup(QObject *parent, const QString &name)
+ {
+ return ParentClass::createActionGroup(parent, name);
+ }
+
+ virtual QWidget *createWidget(const QString &className, QWidget *parent, const QString &name)
+ {
+ if (QWidget *widget = loader->createWidget(className, parent, name)) {
+ widget->setObjectName(name);
+ return widget;
+ }
+
+ return 0;
+ }
+
+ virtual QLayout *createLayout(const QString &className, QObject *parent, const QString &name)
+ {
+ if (QLayout *layout = loader->createLayout(className, parent, name)) {
+ layout->setObjectName(name);
+ return layout;
+ }
+
+ return 0;
+ }
+
+ virtual QActionGroup *createActionGroup(QObject *parent, const QString &name)
+ {
+ if (QActionGroup *actionGroup = loader->createActionGroup(parent, name)) {
+ actionGroup->setObjectName(name);
+ return actionGroup;
+ }
+
+ return 0;
+ }
+
+ virtual QAction *createAction(QObject *parent, const QString &name)
+ {
+ if (QAction *action = loader->createAction(parent, name)) {
+ action->setObjectName(name);
+ return action;
+ }
+
+ return 0;
+ }
+
+ virtual void applyProperties(QObject *o, const QList<DomProperty*> &properties);
+ virtual QWidget *create(DomUI *ui, QWidget *parentWidget);
+ virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget);
+ virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
+
+private:
+ QByteArray m_class;
+ TranslationWatcher *m_trwatch;
+};
+
+static QString convertTranslatable(const DomProperty *p, const QByteArray &className,
+ QUiTranslatableStringValue *strVal)
+{
+ if (p->kind() != DomProperty::String)
+ return QString();
+ const DomString *dom_str = p->elementString();
+ if (!dom_str)
+ return QString();
+ if (dom_str->hasAttributeNotr()) {
+ const QString notr = dom_str->attributeNotr();
+ if (notr == QLatin1String("yes") || notr == QLatin1String("true"))
+ return QString();
+ }
+ strVal->setValue(dom_str->text().toUtf8());
+ strVal->setComment(dom_str->attributeComment().toUtf8());
+ if (strVal->value().isEmpty() && strVal->comment().isEmpty())
+ return QString();
+ return QApplication::translate(className,
+ strVal->value(), strVal->comment(),
+ QCoreApplication::UnicodeUTF8);
+}
+
+void FormBuilderPrivate::applyProperties(QObject *o, const QList<DomProperty*> &properties)
+{
+ typedef QList<DomProperty*> DomPropertyList;
+
+ QFormBuilder::applyProperties(o, properties);
+
+ if (!m_trwatch)
+ m_trwatch = new TranslationWatcher(o, m_class);
+
+ if (properties.empty())
+ return;
+
+ // Unlike string item roles, string properties are not loaded via the textBuilder
+ // (as they are "shadowed" by the property sheets in designer). So do the initial
+ // translation here.
+ bool anyTrs = false;
+ foreach (const DomProperty *p, properties) {
+ QUiTranslatableStringValue strVal;
+ const QString text = convertTranslatable(p, m_class, &strVal);
+ if (text.isEmpty())
+ continue;
+ const QByteArray name = p->attributeName().toUtf8();
+ if (dynamicTr) {
+ o->setProperty(PROP_GENERIC_PREFIX + name, QVariant::fromValue(strVal));
+ anyTrs = trEnabled;
+ }
+ o->setProperty(name, text);
+ }
+ if (anyTrs)
+ o->installEventFilter(m_trwatch);
+}
+
+QWidget *FormBuilderPrivate::create(DomUI *ui, QWidget *parentWidget)
+{
+ m_class = ui->elementClass().toUtf8();
+ m_trwatch = 0;
+ setTextBuilder(new TranslatingTextBuilder(trEnabled, m_class));
+ return QFormBuilder::create(ui, parentWidget);
+}
+
+QWidget *FormBuilderPrivate::create(DomWidget *ui_widget, QWidget *parentWidget)
+{
+ QWidget *w = QFormBuilder::create(ui_widget, parentWidget);
+ if (w == 0)
+ return 0;
+
+ if (0) {
+#ifndef QT_NO_TABWIDGET
+ } else if (qobject_cast<QTabWidget*>(w)) {
+#endif
+#ifndef QT_NO_LISTWIDGET
+ } else if (qobject_cast<QListWidget*>(w)) {
+#endif
+#ifndef QT_NO_TREEWIDGET
+ } else if (qobject_cast<QTreeWidget*>(w)) {
+#endif
+#ifndef QT_NO_TABLEWIDGET
+ } else if (qobject_cast<QTableWidget*>(w)) {
+#endif
+#ifndef QT_NO_COMBOBOX
+ } else if (qobject_cast<QComboBox*>(w)) {
+ if (qobject_cast<QFontComboBox*>(w))
+ return w;
+#endif
+#ifndef QT_NO_TOOLBOX
+ } else if (qobject_cast<QToolBox*>(w)) {
+#endif
+ } else {
+ return w;
+ }
+ if (dynamicTr && trEnabled)
+ w->installEventFilter(m_trwatch);
+ return w;
+}
+
+#define TRANSLATE_SUBWIDGET_PROP(mainWidget, attribute, setter, propName) \
+ do { \
+ if (const DomProperty *p##attribute = attributes.value(strings.attribute)) { \
+ QUiTranslatableStringValue strVal; \
+ const QString text = convertTranslatable(p##attribute, m_class, &strVal); \
+ if (!text.isEmpty()) { \
+ if (dynamicTr) \
+ mainWidget->widget(i)->setProperty(propName, QVariant::fromValue(strVal)); \
+ mainWidget->setter(i, text); \
+ } \
+ } \
+ } while (0)
+
+bool FormBuilderPrivate::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget)
+{
+ if (parentWidget == 0)
+ return true;
+
+ if (!ParentClass::addItem(ui_widget, widget, parentWidget))
+ return false;
+
+ // Check special cases. First: Custom container
+ const QString className = QLatin1String(parentWidget->metaObject()->className());
+ if (!d->customWidgetAddPageMethod(className).isEmpty())
+ return true;
+
+ const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
+
+ if (0) {
+#ifndef QT_NO_TABWIDGET
+ } else if (QTabWidget *tabWidget = qobject_cast<QTabWidget*>(parentWidget)) {
+ const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute());
+ const int i = tabWidget->count() - 1;
+ TRANSLATE_SUBWIDGET_PROP(tabWidget, titleAttribute, setTabText, PROP_TABPAGETEXT);
+# ifndef QT_NO_TOOLTIP
+ TRANSLATE_SUBWIDGET_PROP(tabWidget, toolTipAttribute, setTabToolTip, PROP_TABPAGETOOLTIP);
+# endif
+# ifndef QT_NO_WHATSTHIS
+ TRANSLATE_SUBWIDGET_PROP(tabWidget, whatsThisAttribute, setTabWhatsThis, PROP_TABPAGEWHATSTHIS);
+# endif
+#endif
+#ifndef QT_NO_TOOLBOX
+ } else if (QToolBox *toolBox = qobject_cast<QToolBox*>(parentWidget)) {
+ const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute());
+ const int i = toolBox->count() - 1;
+ TRANSLATE_SUBWIDGET_PROP(toolBox, labelAttribute, setItemText, PROP_TOOLITEMTEXT);
+# ifndef QT_NO_TOOLTIP
+ TRANSLATE_SUBWIDGET_PROP(toolBox, toolTipAttribute, setItemToolTip, PROP_TOOLITEMTOOLTIP);
+# endif
+#endif
+ }
+
+ return true;
+}
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+class QUiLoaderPrivate
+{
+public:
+#ifdef QFORMINTERNAL_NAMESPACE
+ QFormInternal::FormBuilderPrivate builder;
+#else
+ FormBuilderPrivate builder;
+#endif
+
+ void setupWidgetMap() const;
+};
+
+void QUiLoaderPrivate::setupWidgetMap() const
+{
+ if (!g_widgets()->isEmpty())
+ return;
+
+#define DECLARE_WIDGET(a, b) g_widgets()->insert(QLatin1String(#a), true);
+#define DECLARE_LAYOUT(a, b)
+
+#include "widgets.table"
+
+#undef DECLARE_WIDGET
+#undef DECLARE_WIDGET_1
+#undef DECLARE_LAYOUT
+}
+
+/*!
+ \class QUiLoader
+ \inmodule QtUiTools
+
+ \brief The QUiLoader class enables standalone applications to
+ dynamically create user interfaces at run-time using the
+ information stored in UI files or specified in plugin paths.
+
+ In addition, you can customize or create your own user interface by
+ deriving your own loader class.
+
+ If you have a custom component or an application that embeds \QD, you can
+ also use the QFormBuilder class provided by the QtDesigner module to create
+ user interfaces from UI files.
+
+ The QUiLoader class provides a collection of functions allowing you to
+ create widgets based on the information stored in UI files (created
+ with \QD) or available in the specified plugin paths. The specified plugin
+ paths can be retrieved using the pluginPaths() function. Similarly, the
+ contents of a UI file can be retrieved using the load() function. For
+ example:
+
+ \snippet doc/src/snippets/quiloader/mywidget.cpp 0
+
+ By including the user interface in the form's resources (\c myform.qrc), we
+ ensure that it will be present at run-time:
+
+ \quotefile doc/src/snippets/quiloader/mywidget.qrc
+
+ The availableWidgets() function returns a QStringList with the class names
+ of the widgets available in the specified plugin paths. To create these
+ widgets, simply use the createWidget() function. For example:
+
+ \snippet doc/src/snippets/quiloader/main.cpp 0
+
+ To make a custom widget available to the loader, you can use the
+ addPluginPath() function; to remove all available widgets, you can call
+ the clearPluginPaths() function.
+
+ The createAction(), createActionGroup(), createLayout(), and createWidget()
+ functions are used internally by the QUiLoader class whenever it has to
+ create an action, action group, layout, or widget respectively. For that
+ reason, you can subclass the QUiLoader class and reimplement these
+ functions to intervene the process of constructing a user interface. For
+ example, you might want to have a list of the actions created when loading
+ a form or creating a custom widget.
+
+ For a complete example using the QUiLoader class, see the
+ \l{Calculator Builder Example}.
+
+ \sa QtUiTools, QFormBuilder
+*/
+
+/*!
+ Creates a form loader with the given \a parent.
+*/
+QUiLoader::QUiLoader(QObject *parent)
+ : QObject(parent), d_ptr(new QUiLoaderPrivate)
+{
+ Q_D(QUiLoader);
+
+ d->builder.loader = this;
+
+ QStringList paths;
+ foreach (const QString &path, QApplication::libraryPaths()) {
+ QString libPath = path;
+ libPath += QDir::separator();
+ libPath += QLatin1String("designer");
+ paths.append(libPath);
+ }
+
+ d->builder.setPluginPath(paths);
+}
+
+/*!
+ Destroys the loader.
+*/
+QUiLoader::~QUiLoader()
+{
+}
+
+/*!
+ Loads a form from the given \a device and creates a new widget with the
+ given \a parentWidget to hold its contents.
+
+ \sa createWidget(), errorString()
+*/
+QWidget *QUiLoader::load(QIODevice *device, QWidget *parentWidget)
+{
+ Q_D(QUiLoader);
+ // QXmlStreamReader will report errors on open failure.
+ if (!device->isOpen())
+ device->open(QIODevice::ReadOnly|QIODevice::Text);
+ return d->builder.load(device, parentWidget);
+}
+
+/*!
+ Returns a list naming the paths in which the loader will search when
+ locating custom widget plugins.
+
+ \sa addPluginPath(), clearPluginPaths()
+*/
+QStringList QUiLoader::pluginPaths() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.pluginPaths();
+}
+
+/*!
+ Clears the list of paths in which the loader will search when locating
+ plugins.
+
+ \sa addPluginPath(), pluginPaths()
+*/
+void QUiLoader::clearPluginPaths()
+{
+ Q_D(QUiLoader);
+ d->builder.clearPluginPaths();
+}
+
+/*!
+ Adds the given \a path to the list of paths in which the loader will search
+ when locating plugins.
+
+ \sa pluginPaths(), clearPluginPaths()
+*/
+void QUiLoader::addPluginPath(const QString &path)
+{
+ Q_D(QUiLoader);
+ d->builder.addPluginPath(path);
+}
+
+/*!
+ Creates a new widget with the given \a parent and \a name using the class
+ specified by \a className. You can use this function to create any of the
+ widgets returned by the availableWidgets() function.
+
+ The function is also used internally by the QUiLoader class whenever it
+ creates a widget. Hence, you can subclass QUiLoader and reimplement this
+ function to intervene process of constructing a user interface or widget.
+ However, in your implementation, ensure that you call QUiLoader's version
+ first.
+
+ \sa availableWidgets(), load()
+*/
+QWidget *QUiLoader::createWidget(const QString &className, QWidget *parent, const QString &name)
+{
+ Q_D(QUiLoader);
+ return d->builder.defaultCreateWidget(className, parent, name);
+}
+
+/*!
+ Creates a new layout with the given \a parent and \a name using the class
+ specified by \a className.
+
+ The function is also used internally by the QUiLoader class whenever it
+ creates a widget. Hence, you can subclass QUiLoader and reimplement this
+ function to intervene process of constructing a user interface or widget.
+ However, in your implementation, ensure that you call QUiLoader's version
+ first.
+
+ \sa createWidget(), load()
+*/
+QLayout *QUiLoader::createLayout(const QString &className, QObject *parent, const QString &name)
+{
+ Q_D(QUiLoader);
+ return d->builder.defaultCreateLayout(className, parent, name);
+}
+
+/*!
+ Creates a new action group with the given \a parent and \a name.
+
+ The function is also used internally by the QUiLoader class whenever it
+ creates a widget. Hence, you can subclass QUiLoader and reimplement this
+ function to intervene process of constructing a user interface or widget.
+ However, in your implementation, ensure that you call QUiLoader's version
+ first.
+
+ \sa createAction(), createWidget(), load()
+ */
+QActionGroup *QUiLoader::createActionGroup(QObject *parent, const QString &name)
+{
+ Q_D(QUiLoader);
+ return d->builder.defaultCreateActionGroup(parent, name);
+}
+
+/*!
+ Creates a new action with the given \a parent and \a name.
+
+ The function is also used internally by the QUiLoader class whenever it
+ creates a widget. Hence, you can subclass QUiLoader and reimplement this
+ function to intervene process of constructing a user interface or widget.
+ However, in your implementation, ensure that you call QUiLoader's version
+ first.
+
+ \sa createActionGroup(), createWidget(), load()
+*/
+QAction *QUiLoader::createAction(QObject *parent, const QString &name)
+{
+ Q_D(QUiLoader);
+ return d->builder.defaultCreateAction(parent, name);
+}
+
+/*!
+ Returns a list naming all available widgets that can be built using the
+ createWidget() function, i.e all the widgets specified within the given
+ plugin paths.
+
+ \sa pluginPaths(), createWidget()
+
+*/
+QStringList QUiLoader::availableWidgets() const
+{
+ Q_D(const QUiLoader);
+
+ d->setupWidgetMap();
+ widget_map available = *g_widgets();
+
+ foreach (QDesignerCustomWidgetInterface *plugin, d->builder.customWidgets()) {
+ available.insert(plugin->name(), true);
+ }
+
+ return available.keys();
+}
+
+
+/*!
+ \since 4.5
+ Returns a list naming all available layouts that can be built using the
+ createLayout() function
+
+ \sa createLayout()
+*/
+
+QStringList QUiLoader::availableLayouts() const
+{
+ QStringList rc;
+#define DECLARE_WIDGET(a, b)
+#define DECLARE_LAYOUT(a, b) rc.push_back(QLatin1String(#a));
+
+#include "widgets.table"
+
+#undef DECLARE_WIDGET
+#undef DECLARE_LAYOUT
+ return rc;
+}
+
+/*!
+ Sets the working directory of the loader to \a dir. The loader will look
+ for other resources, such as icons and resource files, in paths relative to
+ this directory.
+
+ \sa workingDirectory()
+*/
+
+void QUiLoader::setWorkingDirectory(const QDir &dir)
+{
+ Q_D(QUiLoader);
+ d->builder.setWorkingDirectory(dir);
+}
+
+/*!
+ Returns the working directory of the loader.
+
+ \sa setWorkingDirectory()
+*/
+
+QDir QUiLoader::workingDirectory() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.workingDirectory();
+}
+
+/*!
+ \internal
+ \since 4.3
+
+ If \a enabled is true, the loader will be able to execute scripts.
+ Otherwise, execution of scripts will be disabled.
+
+ \sa isScriptingEnabled()
+*/
+
+void QUiLoader::setScriptingEnabled(bool enabled)
+{
+ Q_D(QUiLoader);
+ d->builder.setScriptingEnabled(enabled);
+}
+
+/*!
+ \internal
+ \since 4.3
+
+ Returns true if execution of scripts is enabled; returns false otherwise.
+
+ \sa setScriptingEnabled()
+*/
+
+bool QUiLoader::isScriptingEnabled() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.isScriptingEnabled();
+}
+
+/*!
+ \since 4.5
+
+ If \a enabled is true, user interfaces loaded by this loader will
+ automatically retranslate themselves upon receiving a language change
+ event. Otherwise, the user interfaces will not be retranslated.
+
+ \sa isLanguageChangeEnabled()
+*/
+
+void QUiLoader::setLanguageChangeEnabled(bool enabled)
+{
+ Q_D(QUiLoader);
+ d->builder.dynamicTr = enabled;
+}
+
+/*!
+ \since 4.5
+
+ Returns true if dynamic retranslation on language change is enabled;
+ returns false otherwise.
+
+ \sa setLanguageChangeEnabled()
+*/
+
+bool QUiLoader::isLanguageChangeEnabled() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.dynamicTr;
+}
+
+/*!
+ \internal
+ \since 4.5
+
+ If \a enabled is true, user interfaces loaded by this loader will be
+ translated. Otherwise, the user interfaces will not be translated.
+
+ \note This is orthogonal to languageChangeEnabled.
+
+ \sa isLanguageChangeEnabled(), setLanguageChangeEnabled()
+*/
+
+void QUiLoader::setTranslationEnabled(bool enabled)
+{
+ Q_D(QUiLoader);
+ d->builder.trEnabled = enabled;
+}
+
+/*!
+ \internal
+ \since 4.5
+
+ Returns true if translation is enabled; returns false otherwise.
+
+ \sa setTranslationEnabled()
+*/
+
+bool QUiLoader::isTranslationEnabled() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.trEnabled;
+}
+
+/*!
+ Returns a human-readable description of the last error occurred in load().
+
+ \since 5.0
+ \sa load()
+*/
+
+QString QUiLoader::errorString() const
+{
+ Q_D(const QUiLoader);
+ return d->builder.errorString();
+}
+
+QT_END_NAMESPACE
+
+#include "quiloader.moc"
diff --git a/src/designer/src/uitools/quiloader.h b/src/designer/src/uitools/quiloader.h
new file mode 100644
index 000000000..4adbb01c0
--- /dev/null
+++ b/src/designer/src/uitools/quiloader.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUILOADER_H
+#define QUILOADER_H
+
+#include <QtCore/QObject>
+#include <QtCore/QScopedPointer>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QWidget;
+class QLayout;
+class QAction;
+class QActionGroup;
+class QString;
+class QIODevice;
+class QDir;
+
+class QUiLoaderPrivate;
+class QUiLoader : public QObject
+{
+ Q_OBJECT
+public:
+ QUiLoader(QObject *parent = 0);
+ virtual ~QUiLoader();
+
+ QStringList pluginPaths() const;
+ void clearPluginPaths();
+ void addPluginPath(const QString &path);
+
+ QWidget *load(QIODevice *device, QWidget *parentWidget = 0);
+ QStringList availableWidgets() const;
+ QStringList availableLayouts() const;
+
+ virtual QWidget *createWidget(const QString &className, QWidget *parent = 0, const QString &name = QString());
+ virtual QLayout *createLayout(const QString &className, QObject *parent = 0, const QString &name = QString());
+ virtual QActionGroup *createActionGroup(QObject *parent = 0, const QString &name = QString());
+ virtual QAction *createAction(QObject *parent = 0, const QString &name = QString());
+
+ void setWorkingDirectory(const QDir &dir);
+ QDir workingDirectory() const;
+
+ void setScriptingEnabled(bool enabled);
+ bool isScriptingEnabled() const;
+
+ void setLanguageChangeEnabled(bool enabled);
+ bool isLanguageChangeEnabled() const;
+
+ void setTranslationEnabled(bool enabled);
+ bool isTranslationEnabled() const;
+
+ QString errorString() const;
+
+private:
+ QScopedPointer<QUiLoaderPrivate> d_ptr;
+ Q_DECLARE_PRIVATE(QUiLoader)
+ Q_DISABLE_COPY(QUiLoader)
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QUILOADER_H
diff --git a/src/designer/src/uitools/quiloader_p.h b/src/designer/src/uitools/quiloader_p.h
new file mode 100644
index 000000000..3137e6fc8
--- /dev/null
+++ b/src/designer/src/uitools/quiloader_p.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUILOADER_P_H
+#define QUILOADER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/QByteArray>
+#include <QtCore/QMetaType>
+
+// This file is here for use by the form preview in Linguist. If you change anything
+// here or in the code which uses it, remember to adapt Linguist accordingly.
+
+#define PROP_GENERIC_PREFIX "_q_notr_"
+#define PROP_TOOLITEMTEXT "_q_toolItemText_notr"
+#define PROP_TOOLITEMTOOLTIP "_q_toolItemToolTip_notr"
+#define PROP_TABPAGETEXT "_q_tabPageText_notr"
+#define PROP_TABPAGETOOLTIP "_q_tabPageToolTip_notr"
+#define PROP_TABPAGEWHATSTHIS "_q_tabPageWhatsThis_notr"
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QUiTranslatableStringValue
+{
+public:
+ QByteArray value() const { return m_value; }
+ void setValue(const QByteArray &value) { m_value = value; }
+ QByteArray comment() const { return m_comment; }
+ void setComment(const QByteArray &comment) { m_comment = comment; }
+
+private:
+ QByteArray m_value;
+ QByteArray m_comment;
+};
+
+struct QUiItemRolePair {
+ int realRole;
+ int shadowRole;
+};
+
+#ifdef QFORMINTERNAL_NAMESPACE
+namespace QFormInternal
+{
+#endif
+
+extern const QUiItemRolePair qUiItemRoles[];
+
+#ifdef QFORMINTERNAL_NAMESPACE
+}
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+Q_DECLARE_METATYPE(QUiTranslatableStringValue)
+
+
+#endif // QUILOADER_P_H
diff --git a/src/designer/src/uitools/uitools.pro b/src/designer/src/uitools/uitools.pro
new file mode 100644
index 000000000..ca25014c0
--- /dev/null
+++ b/src/designer/src/uitools/uitools.pro
@@ -0,0 +1,50 @@
+QPRO_PWD = $$PWD
+TEMPLATE = lib
+TARGET = $$qtLibraryTarget(QtUiTools)
+QT = core
+
+CONFIG += qt staticlib module
+MODULE = uitools
+MODULE_PRI = ../modules/qt_uitools.pri
+
+DESTDIR = $$QMAKE_LIBDIR_QT
+
+symbian {
+ TARGET.UID3 = 0x2001E628
+ load(armcc_warnings)
+}
+
+win32|mac:!macx-xcode:CONFIG += debug_and_release build_all
+
+DEFINES += QFORMINTERNAL_NAMESPACE QT_DESIGNER_STATIC QT_FORMBUILDER_NO_SCRIPT
+isEmpty(QT_MAJOR_VERSION) {
+ VERSION=4.3.0
+} else {
+ VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
+}
+load(qt_targets)
+QMAKE_TARGET_PRODUCT = UiLoader
+QMAKE_TARGET_DESCRIPTION = QUiLoader
+
+include(../lib/uilib/uilib.pri)
+
+HEADERS += quiloader.h
+SOURCES += quiloader.cpp
+
+include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true)
+quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
+quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools
+quitools_private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES
+quitools_private_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools/$$QT.uitools.VERSION/QtUiTools/private
+INSTALLS += quitools_headers quitools_private_headers
+
+target.path=$$[QT_INSTALL_LIBS]
+INSTALLS += target
+
+unix|win32-g++* {
+ CONFIG += create_pc
+ QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS]
+ QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET
+ QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS]
+ QMAKE_PKGCONFIG_DESTDIR = pkgconfig
+}