diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-05-23 09:03:52 +0200 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-27 12:12:20 +0200 |
commit | 4ace7475e7862bbe03e0d993f4675147ed28c972 (patch) | |
tree | f61bff665ce2e620c8ab5ed3a4736baf59839fb9 /src/tools/uic/cpp/cppwriteincludes.cpp | |
parent | bf234e32887567caa27d9aa28aac3a12f09b5f19 (diff) |
uic: #include <QLayout> for QToolBox on non-laid-out forms.
for the fake tab-spacing property, which accesses the internal
layout and sets its spacing.
Task-number: QTBUG-19339
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
Change-Id: I89f5c035bd3798a0998c3046de643bda0fa8da6b
(cherry picked from commit 89f5c035bd3798a0998c3046de643bda0fa8da6b)
Reviewed-on: http://codereview.qt.nokia.com/173
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteincludes.cpp')
-rw-r--r-- | src/tools/uic/cpp/cppwriteincludes.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp index 16a87c8d7b..c4613e20ae 100644 --- a/src/tools/uic/cpp/cppwriteincludes.cpp +++ b/src/tools/uic/cpp/cppwriteincludes.cpp @@ -82,7 +82,7 @@ static inline QString moduleHeader(const QString &module, const QString &header) namespace CPP { WriteIncludes::WriteIncludes(Uic *uic) - : m_uic(uic), m_output(uic->output()), m_scriptsActivated(false) + : m_uic(uic), m_output(uic->output()), m_scriptsActivated(false), m_laidOut(false) { // When possible (no namespace) use the "QtModule/QClass" convention // and create a re-mapping of the old header "qclass.h" to it. Do not do this @@ -106,6 +106,7 @@ WriteIncludes::WriteIncludes(Uic *uic) void WriteIncludes::acceptUI(DomUI *node) { m_scriptsActivated = false; + m_laidOut = false; m_localIncludes.clear(); m_globalIncludes.clear(); m_knownClasses.clear(); @@ -144,6 +145,7 @@ void WriteIncludes::acceptWidget(DomWidget *node) void WriteIncludes::acceptLayout(DomLayout *node) { add(node->attributeClass()); + m_laidOut = true; TreeWalker::acceptLayout(node); } @@ -220,6 +222,9 @@ void WriteIncludes::add(const QString &className, bool determineHeader, const QS m_knownClasses.insert(className); + if (!m_laidOut && m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))) + add(QLatin1String("QLayout")); // spacing property of QToolBox) + if (className == QLatin1String("Line")) { // ### hmm, deprecate me! add(QLatin1String("QFrame")); return; |