summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-11-19 15:17:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-21 16:36:50 +0100
commit37eb61677cb12ca4602e970f0d0ec6a9c0ae71e6 (patch)
treeeeedd73d9a2c4cff28a8f30eca19ff5e6f486880 /src/tools
parentb8e883bdb034795a1cfa56c26e34f109b97050b0 (diff)
uic - fix to handle QTreeWidget with empty header(s)
This makes it possible for uic to handle QTreeWidget that in the designer has one or more empty headers. Before the right(most) empty items where there wasn't a non-empty header to the right of them would not be visible. The other empty items - where there was a header to the right of it would not be empty but initialized with a number. This patch ensures the same behavior that the QTableWidget is having. Task-number: QTBUG-18156 Change-Id: I19bfd3307befe46a1af2d6a3275f7446a15b3442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 38d6782e83..35431bac1e 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -2159,6 +2159,12 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w)
const DomPropertyMap properties = propertyMap(column->elementProperty());
addCommonInitializers(&item, properties, i);
+
+ if (const DomProperty *p = properties.value(QLatin1String("text"))) {
+ DomString *str = p->elementString();
+ if (str && str->text().isEmpty())
+ m_output << m_indent << varName << "->headerItem()->setText(" << i << ", QString());\n";
+ }
}
const QString itemName = item.writeSetupUi(QString(), Item::DontConstruct);
item.writeRetranslateUi(varName + QLatin1String("->headerItem()"));