Skip to content

Commit

Permalink
uic/Python: Recognize more C++ suffixes when determining the custom w…
Browse files Browse the repository at this point in the history
…idget module

Also check for .H, .hh, .hpp.

Pick-to: 6.7
Task-number: PYSIDE-2648
Change-Id: I993647e2b55e3b76d714a9d3a4b539c2d5874f04
Reviewed-by: Cristian Maureira-Fredes <[email protected]>
  • Loading branch information
FriedemannKleint committed Apr 22, 2024
1 parent 041ca2a commit bd231cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tools/uic/python/pythonwriteimports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit bd231cc

Please sign in to comment.