summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2010-04-13 13:44:13 (GMT)
committerJarek Kobus <jkobus@trolltech.com>2010-04-13 13:44:13 (GMT)
commit6f8364ac0c128eb8afe897b5d8f3f4e26b9105f5 (patch)
treec75b7a2c52799c800944a92b7219ccd9e2eba32b /tools
parent2ff6df50fac75af2d1b9d49101d9b1d8af28535d (diff)
downloadQt-6f8364ac0c128eb8afe897b5d8f3f4e26b9105f5.zip
Qt-6f8364ac0c128eb8afe897b5d8f3f4e26b9105f5.tar.gz
Qt-6f8364ac0c128eb8afe897b5d8f3f4e26b9105f5.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
Diffstat (limited to 'tools')
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp61
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.h4
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 b659179..1d78695 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 33b5b88..47dd263 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();