From de1d51a3fd69a4961816ecfc3982424d5379a00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Tue, 25 Feb 2020 15:59:09 +0100 Subject: uic: handle header tag for python imports Fixes: PYSIDE-1233 Change-Id: Id2b6e2a8b833da6ea4417d06643b2f7b045515a9 Reviewed-by: Friedemann Kleint --- src/tools/uic/python/pythonwriteimports.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools') diff --git a/src/tools/uic/python/pythonwriteimports.cpp b/src/tools/uic/python/pythonwriteimports.cpp index d33b4c6210..95e039e6f0 100644 --- a/src/tools/uic/python/pythonwriteimports.cpp +++ b/src/tools/uic/python/pythonwriteimports.cpp @@ -131,6 +131,8 @@ void WriteImports::acceptCustomWidget(DomCustomWidget *node) output << "import " << className << '\n'; } else { // When we do have elementHeader, we know it's a relative import. QString modulePath = node->elementHeader()->text(); + // Replace the '/' by '.' + modulePath.replace(QLatin1Char('/'), QLatin1Char('.')); // '.h' is added by default on headers for if (modulePath.endsWith(QLatin1String(".h"))) modulePath.chop(2); -- cgit v1.2.3