summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteincludes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/uic/cpp/cppwriteincludes.cpp')
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index de64b85219b..809cac6bef0 100644
--- a/src/tools/uic/cpp/cppwriteincludes.cpp
+++ b/src/tools/uic/cpp/cppwriteincludes.cpp
@@ -109,7 +109,6 @@ void WriteIncludes::acceptUI(DomUI *node)
add(QLatin1String("QAction"));
add(QLatin1String("QButtonGroup")); // ### only if it is really necessary
- add(QLatin1String("QHeaderView"));
TreeWalker::acceptUI(node);
@@ -212,6 +211,14 @@ void WriteIncludes::add(const QString &className, bool determineHeader, const QS
m_knownClasses.insert(className);
+ const CustomWidgetsInfo *cwi = m_uic->customWidgetsInfo();
+ if (cwi->extends(className, QLatin1String("QTreeView"))
+ || cwi->extends(className, QLatin1String("QTreeWidget"))
+ || cwi->extends(className, QLatin1String("QTableView"))
+ || cwi->extends(className, QLatin1String("QTableWidget"))) {
+ add(QLatin1String("QHeaderView"));
+ }
+
if (!m_laidOut && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox")))
add(QLatin1String("QLayout")); // spacing property of QToolBox)