diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-04-17 14:24:17 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-04-22 16:48:50 +0200 |
commit | bd231cc051d6246f572af23d953c27a95e0846a8 (patch) | |
tree | 5dd4f0f04cd314e46481892c2132ad2d57f7a68f /src/tools | |
parent | 041ca2a3a818955ebcbbc0acd164138ffd561a6c (diff) |
uic/Python: Recognize more C++ suffixes when determining the custom widget module
Also check for .H, .hh, .hpp.
Pick-to: 6.7
Task-number: PYSIDE-2648
Change-Id: I993647e2b55e3b76d714a9d3a4b539c2d5874f04
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/uic/python/pythonwriteimports.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/uic/python/pythonwriteimports.cpp b/src/tools/uic/python/pythonwriteimports.cpp index b122c0f895..74eeab8387 100644 --- a/src/tools/uic/python/pythonwriteimports.cpp +++ b/src/tools/uic/python/pythonwriteimports.cpp @@ -229,9 +229,13 @@ void WriteImports::addPythonCustomWidget(const QString &className, const DomCust QString modulePath = node->elementHeader()->text(); // Replace the '/' by '.' modulePath.replace(u'/', u'.'); - // '.h' is added by default on headers for <customwidget> - if (modulePath.endsWith(".h"_L1)) + // '.h' is added by default on headers for <customwidget>. + if (modulePath.endsWith(".h"_L1, Qt::CaseInsensitive)) modulePath.chop(2); + else if (modulePath.endsWith(".hh"_L1)) + modulePath.chop(3); + else if (modulePath.endsWith(".hpp"_L1)) + modulePath.chop(4); insertClass(modulePath, className, &m_customWidgets); } } |