From 85b4aaaa99556fa248a7d688d2fe9d99d28234b0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 2 Nov 2018 10:49:29 +0100 Subject: 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 --- src/tools/uic/cpp/cppwriteinitialization.cpp | 30 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp') diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index a75aa0abd71..28e97f3bbaa 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 } // -- cgit v1.2.3