summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-03 13:08:52 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-03 15:09:53 +0100
commit8b0b2057d060c9f33cfeb0ea38a08ace22079f93 (patch)
treec1fa1cac416e2b1d4e95207e65c744cb0a5e443d
parent77f1d0bfa542e166deaa196b3b3b854d33a3a1b7 (diff)
uic: Add colon missing for "if()" constructs in Python
Task-number: PYSIDE-1169 Change-Id: I63c5305b0ddad1c4fcd585b65c3c78c05b40bac1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 4fbf01262b..5dbe10082c 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -2372,9 +2372,11 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
const auto &columns = w->elementColumn();
if (!columns.empty()) {
- m_output << m_indent << "if (" << varName << language::derefPointer << "columnCount() < "
- << columns.size() << ")\n"
- << m_dindent << varName << language::derefPointer << "setColumnCount("
+ m_output << m_indent << "if (" << varName << language::derefPointer
+ << "columnCount() < " << columns.size() << ')';
+ if (language::language() == Language::Python)
+ m_output << ':';
+ m_output << '\n' << m_dindent << varName << language::derefPointer << "setColumnCount("
<< columns.size() << ')' << language::eol;
}
@@ -2400,8 +2402,11 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
const auto &rows = w->elementRow();
if (!rows.isEmpty()) {
- m_output << m_indent << "if (" << varName << language::derefPointer << "rowCount() < " << rows.size() << ")\n"
- << m_dindent << varName << language::derefPointer << "setRowCount("
+ m_output << m_indent << "if (" << varName << language::derefPointer
+ << "rowCount() < " << rows.size() << ')';
+ if (language::language() == Language::Python)
+ m_output << ':';
+ m_output << '\n' << m_dindent << varName << language::derefPointer << "setRowCount("
<< rows.size() << ')' << language::eol;
}