diff options
author | Jarek Kobus <jkobus@trolltech.com> | 2010-04-13 13:44:13 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:39 (GMT) |
commit | ac6313c740d2264b0c005367513050b332c8a863 (patch) | |
tree | e3ccfaf017c5e118558fc832159efa69dbb3f2c1 | |
parent | 632b69b6ef1318fede89a0a3fd46a29bd6c27fe5 (diff) | |
download | Qt-ac6313c740d2264b0c005367513050b332c8a863.zip Qt-ac6313c740d2264b0c005367513050b332c8a863.tar.gz Qt-ac6313c740d2264b0c005367513050b332c8a863.tar.bz2 |
Fix writing duplicate headers' properties in designer.
Designer has written verticalHeaderVisible property in ui file twice:
once done implicitly while saving the fake properties and
once done explicitly inside QDesignerResource by calling
saveWidget(QTableView/QTreeView). The latter is removed as
it is redundant now.
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Task-number: QTBUG-9351
(cherry picked from commit 6f8364ac0c128eb8afe897b5d8f3f4e26b9105f5)
-rw-r--r-- | tools/designer/src/components/formeditor/qdesigner_resource.cpp | 61 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/qdesigner_resource.h | 4 |
2 files changed, 0 insertions, 65 deletions
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 5dbedee..a464f02 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -53,7 +53,6 @@ #include "qtresourcemodel_p.h" #include "qmdiarea_container.h" #include "qwizard_container.h" -#include "itemview_propertysheet.h" #include "layout_propertysheet.h" #include <ui4_p.h> @@ -106,8 +105,6 @@ #include <QtGui/QMenuBar> #include <QtGui/QFileDialog> #include <QtGui/QHeaderView> -#include <QtGui/QTreeView> -#include <QtGui/QTableView> #include <QtGui/QWizardPage> #include <private/qlayoutengine_p.h> @@ -1275,10 +1272,6 @@ DomWidget *QDesignerResource::createDom(QWidget *widget, DomWidget *ui_parentWid w = saveWidget(dockWidget, ui_parentWidget); else if (QDesignerContainerExtension *container = qt_extension<QDesignerContainerExtension*>(core()->extensionManager(), widget)) w = saveWidget(widget, container, ui_parentWidget); - else if (QTreeView *treeView = qobject_cast<QTreeView*>(widget)) - w = saveWidget(treeView, ui_parentWidget); - else if (QTableView *tableView = qobject_cast<QTableView*>(widget)) - w = saveWidget(tableView, ui_parentWidget); else if (QWizardPage *wizardPage = qobject_cast<QWizardPage*>(widget)) w = saveWidget(wizardPage, ui_parentWidget); else @@ -1553,60 +1546,6 @@ DomWidget *QDesignerResource::saveWidget(QDesignerDockWidget *dockWidget, DomWid return ui_widget; } -DomWidget *QDesignerResource::saveWidget(QTreeView *treeView, DomWidget *ui_parentWidget) -{ - DomWidget *ui_widget = QAbstractFormBuilder::createDom(treeView, ui_parentWidget, true); - - QDesignerPropertySheetExtension *sheet - = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), treeView); - ItemViewPropertySheet *itemViewSheet = static_cast<ItemViewPropertySheet*>(sheet); - - if (itemViewSheet) { - QHash<QString,QString> nameMap = itemViewSheet->propertyNameMap(); - foreach (const QString &fakeName, nameMap.keys()) { - int index = itemViewSheet->indexOf(fakeName); - if (sheet->isChanged(index)) { - DomProperty *domAttr = createProperty(treeView->header(), nameMap.value(fakeName), - itemViewSheet->property(index)); - domAttr->setAttributeName(fakeName); - ui_widget->setElementAttribute(ui_widget->elementAttribute() << domAttr); - } - } - } - - return ui_widget; -} - -DomWidget *QDesignerResource::saveWidget(QTableView *tableView, DomWidget *ui_parentWidget) -{ - DomWidget *ui_widget = QAbstractFormBuilder::createDom(tableView, ui_parentWidget, true); - - QDesignerPropertySheetExtension *sheet - = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), tableView); - ItemViewPropertySheet *itemViewSheet = static_cast<ItemViewPropertySheet*>(sheet); - - if (itemViewSheet) { - QHash<QString,QString> nameMap = itemViewSheet->propertyNameMap(); - foreach (const QString &fakeName, nameMap.keys()) { - int index = itemViewSheet->indexOf(fakeName); - if (sheet->isChanged(index)) { - DomProperty *domAttr; - if (fakeName.startsWith(QLatin1String("horizontal"))) { - domAttr = createProperty(tableView->horizontalHeader(), nameMap.value(fakeName), - itemViewSheet->property(index)); - } else { - domAttr = createProperty(tableView->verticalHeader(), nameMap.value(fakeName), - itemViewSheet->property(index)); - } - domAttr->setAttributeName(fakeName); - ui_widget->setElementAttribute(ui_widget->elementAttribute() << domAttr); - } - } - } - - return ui_widget; -} - static void saveStringProperty(DomProperty *property, const PropertySheetStringValue &value) { DomString *str = new DomString(); diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.h b/tools/designer/src/components/formeditor/qdesigner_resource.h index c0a861f..74fff9b 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.h +++ b/tools/designer/src/components/formeditor/qdesigner_resource.h @@ -64,8 +64,6 @@ class QTabWidget; class QStackedWidget; class QToolBox; class QToolBar; -class QTreeView; -class QTableView; class QDesignerDockWidget; class QLayoutWidget; class QWizardPage; @@ -138,8 +136,6 @@ protected: DomWidget *saveWidget(QWidget *widget, QDesignerContainerExtension *container, DomWidget *ui_parentWidget); DomWidget *saveWidget(QToolBar *toolBar, DomWidget *ui_parentWidget); DomWidget *saveWidget(QDesignerDockWidget *dockWidget, DomWidget *ui_parentWidget); - DomWidget *saveWidget(QTreeView *treeView, DomWidget *ui_parentWidget); - DomWidget *saveWidget(QTableView *tableView, DomWidget *ui_parentWidget); DomWidget *saveWidget(QWizardPage *wizardPage, DomWidget *ui_parentWidget); virtual DomCustomWidgets *saveCustomWidgets(); |