diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-11-02 10:49:29 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-11-19 10:16:18 +0000 |
commit | 85b4aaaa99556fa248a7d688d2fe9d99d28234b0 (patch) | |
tree | 46de5387705660103b2d02e8ded3572fdd7672d8 | |
parent | 97d12b454118730afc2f03ac44a6be12b47823ee (diff) |
uic: Generate code for container page tooltips using the Qt configure system
Previously, the generation of this code was #ifdefed in uic itself.
However, the #ifdef should be in the generated code (anticipating
the cmake port where host and target builds might differ).
Task-number: PYSIDE-797
Change-Id: I46255f852f5f6a3d95d3a20456b6f00f2067a3fe
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r-- | src/tools/uic/cpp/cppwriteinitialization.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index a75aa0abd7..28e97f3bba 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -726,12 +726,14 @@ void WriteInitialization::acceptWidget(DomWidget *node) autoTrOutput(plabelString, pageDefaultString) << m_indent << parentWidget << "->setItemText(" << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(plabelString, pageDefaultString) << ");\n"; -#ifndef QT_NO_TOOLTIP if (DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) { - autoTrOutput(ptoolTip->elementString()) << m_indent << parentWidget << "->setItemToolTip(" - << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(ptoolTip->elementString()) << ");\n"; + autoTrOutput(ptoolTip->elementString()) + << language::openQtConfig(toolTipConfigKey()) + << m_indent << parentWidget << "->setItemToolTip(" << parentWidget + << "->indexOf(" << varName << "), " + << autoTrCall(ptoolTip->elementString()) << ");\n" + << language::closeQtConfig(toolTipConfigKey()); } -#endif // QT_NO_TOOLTIP } else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QTabWidget"))) { QString icon; if (const DomProperty *picon = attributes.value(QLatin1String("icon"))) { @@ -747,18 +749,22 @@ void WriteInitialization::acceptWidget(DomWidget *node) autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget << "->setTabText(" << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(ptitleString, pageDefaultString) << ");\n"; -#ifndef QT_NO_TOOLTIP if (const DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) { - autoTrOutput(ptoolTip->elementString()) << m_indent << parentWidget << "->setTabToolTip(" - << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(ptoolTip->elementString()) << ");\n"; + autoTrOutput(ptoolTip->elementString()) + << language::openQtConfig(toolTipConfigKey()) + << m_indent << parentWidget << "->setTabToolTip(" << parentWidget + << "->indexOf(" << varName << "), " + << autoTrCall(ptoolTip->elementString()) << ");\n" + << language::closeQtConfig(toolTipConfigKey()); } -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS if (const DomProperty *pwhatsThis = attributes.value(QLatin1String("whatsThis"))) { - autoTrOutput(pwhatsThis->elementString()) << m_indent << parentWidget << "->setTabWhatsThis(" - << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(pwhatsThis->elementString()) << ");\n"; + autoTrOutput(pwhatsThis->elementString()) + << language::openQtConfig(whatsThisConfigKey()) + << m_indent << parentWidget << "->setTabWhatsThis(" << parentWidget + << "->indexOf(" << varName << "), " + << autoTrCall(pwhatsThis->elementString()) << ");\n" + << language::closeQtConfig(whatsThisConfigKey()); } -#endif // QT_NO_WHATSTHIS } // |