diff options
author | Cristián Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2020-02-25 15:59:09 +0100 |
---|---|---|
committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-02-27 11:19:39 +0100 |
commit | de1d51a3fd69a4961816ecfc3982424d5379a00f (patch) | |
tree | 29f1c4f1d4dc7a7e69517530106cd584505c272b /src/tools | |
parent | 715468df40e4ce97da04f327b6e34d535ff9b97d (diff) |
uic: handle header tag for python imports
Fixes: PYSIDE-1233
Change-Id: Id2b6e2a8b833da6ea4417d06643b2f7b045515a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/uic/python/pythonwriteimports.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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 <customwidget> if (modulePath.endsWith(QLatin1String(".h"))) modulePath.chop(2); |