summaryrefslogtreecommitdiffstats
path: root/tools/uilib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/uilib')
-rw-r--r--tools/uilib/abstractformbuilder.cpp3154
-rw-r--r--tools/uilib/abstractformbuilder.h283
-rw-r--r--tools/uilib/container.h82
-rw-r--r--tools/uilib/container.qdoc199
-rw-r--r--tools/uilib/customwidget.h101
-rw-r--r--tools/uilib/customwidget.qdoc295
-rw-r--r--tools/uilib/extension.h109
-rw-r--r--tools/uilib/formbuilder.cpp550
-rw-r--r--tools/uilib/formbuilder.h110
-rw-r--r--tools/uilib/formbuilderextra.cpp533
-rw-r--r--tools/uilib/formbuilderextra_p.h276
-rw-r--r--tools/uilib/formscriptrunner.cpp208
-rw-r--r--tools/uilib/formscriptrunner_p.h120
-rw-r--r--tools/uilib/properties.cpp681
-rw-r--r--tools/uilib/properties_p.h176
-rw-r--r--tools/uilib/qdesignerexportwidget.h66
-rw-r--r--tools/uilib/resourcebuilder.cpp180
-rw-r--r--tools/uilib/resourcebuilder_p.h104
-rw-r--r--tools/uilib/textbuilder.cpp84
-rw-r--r--tools/uilib/textbuilder_p.h93
-rw-r--r--tools/uilib/ui4.cpp8907
-rw-r--r--tools/uilib/ui4_p.h3603
-rw-r--r--tools/uilib/uilib.pri34
-rw-r--r--tools/uilib/uilib_global.h64
-rw-r--r--tools/uilib/widgets.table148
25 files changed, 0 insertions, 20160 deletions
diff --git a/tools/uilib/abstractformbuilder.cpp b/tools/uilib/abstractformbuilder.cpp
deleted file mode 100644
index da64a5ee27..0000000000
--- a/tools/uilib/abstractformbuilder.cpp
+++ /dev/null
@@ -1,3154 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/abstractformbuilder.h b/tools/uilib/abstractformbuilder.h
deleted file mode 100644
index d0882500be..0000000000
--- a/tools/uilib/abstractformbuilder.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/container.h b/tools/uilib/container.h
deleted file mode 100644
index cf670edafb..0000000000
--- a/tools/uilib/container.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/container.qdoc b/tools/uilib/container.qdoc
deleted file mode 100644
index 8f7a07d30c..0000000000
--- a/tools/uilib/container.qdoc
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/customwidget.h b/tools/uilib/customwidget.h
deleted file mode 100644
index 43cc055046..0000000000
--- a/tools/uilib/customwidget.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/customwidget.qdoc b/tools/uilib/customwidget.qdoc
deleted file mode 100644
index 9c3bfdd9df..0000000000
--- a/tools/uilib/customwidget.qdoc
+++ /dev/null
@@ -1,295 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/extension.h b/tools/uilib/extension.h
deleted file mode 100644
index 9d6754e9e1..0000000000
--- a/tools/uilib/extension.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formbuilder.cpp b/tools/uilib/formbuilder.cpp
deleted file mode 100644
index 5e22ddb998..0000000000
--- a/tools/uilib/formbuilder.cpp
+++ /dev/null
@@ -1,550 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formbuilder.h b/tools/uilib/formbuilder.h
deleted file mode 100644
index b94db06ebd..0000000000
--- a/tools/uilib/formbuilder.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formbuilderextra.cpp b/tools/uilib/formbuilderextra.cpp
deleted file mode 100644
index 3d34a20bff..0000000000
--- a/tools/uilib/formbuilderextra.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formbuilderextra_p.h b/tools/uilib/formbuilderextra_p.h
deleted file mode 100644
index 20516a5489..0000000000
--- a/tools/uilib/formbuilderextra_p.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formscriptrunner.cpp b/tools/uilib/formscriptrunner.cpp
deleted file mode 100644
index 8efb12f9e3..0000000000
--- a/tools/uilib/formscriptrunner.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/formscriptrunner_p.h b/tools/uilib/formscriptrunner_p.h
deleted file mode 100644
index f0a6a368c7..0000000000
--- a/tools/uilib/formscriptrunner_p.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/properties.cpp b/tools/uilib/properties.cpp
deleted file mode 100644
index 88cd455d65..0000000000
--- a/tools/uilib/properties.cpp
+++ /dev/null
@@ -1,681 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/properties_p.h b/tools/uilib/properties_p.h
deleted file mode 100644
index 98b84fce9f..0000000000
--- a/tools/uilib/properties_p.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/qdesignerexportwidget.h b/tools/uilib/qdesignerexportwidget.h
deleted file mode 100644
index 54053ff274..0000000000
--- a/tools/uilib/qdesignerexportwidget.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/resourcebuilder.cpp b/tools/uilib/resourcebuilder.cpp
deleted file mode 100644
index 72921c636b..0000000000
--- a/tools/uilib/resourcebuilder.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/resourcebuilder_p.h b/tools/uilib/resourcebuilder_p.h
deleted file mode 100644
index ca699a05fa..0000000000
--- a/tools/uilib/resourcebuilder_p.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/textbuilder.cpp b/tools/uilib/textbuilder.cpp
deleted file mode 100644
index d9d2ac3b1a..0000000000
--- a/tools/uilib/textbuilder.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/textbuilder_p.h b/tools/uilib/textbuilder_p.h
deleted file mode 100644
index bef4a64f0f..0000000000
--- a/tools/uilib/textbuilder_p.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/ui4.cpp b/tools/uilib/ui4.cpp
deleted file mode 100644
index 5c232c862c..0000000000
--- a/tools/uilib/ui4.cpp
+++ /dev/null
@@ -1,8907 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/ui4_p.h b/tools/uilib/ui4_p.h
deleted file mode 100644
index 6a56c9eadc..0000000000
--- a/tools/uilib/ui4_p.h
+++ /dev/null
@@ -1,3603 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/uilib.pri b/tools/uilib/uilib.pri
deleted file mode 100644
index 75904c2f66..0000000000
--- a/tools/uilib/uilib.pri
+++ /dev/null
@@ -1,34 +0,0 @@
-
-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/tools/uilib/uilib_global.h b/tools/uilib/uilib_global.h
deleted file mode 100644
index b27a9bd3f6..0000000000
--- a/tools/uilib/uilib_global.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** 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/tools/uilib/widgets.table b/tools/uilib/widgets.table
deleted file mode 100644
index 9b8727849b..0000000000
--- a/tools/uilib/widgets.table
+++ /dev/null
@@ -1,148 +0,0 @@
-
-#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