-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Labels
Description
In the following function:
def headerToModule(header):
"""
Translate a header file to python module path
foo/bar.h => foo.bar
"""
# Remove header extension
module = os.path.splitext(header)[0]
This will break imports if they were written in Python as the structure of the custom widget is "path.to.module"
Since the function always expects a path and a .h extension -- the above is destructive and removes the .module
in my example above. Custom widgets are not possible if using Python to author the custom widget with Qt.py
Possible Fix?
Patch the Qt.py:
module = os.path.splitext(header)[0] if header.endswith(".h") else header
The issue here is that if its a python module you simply can't use '.h' as a module name. Its a gotcha
with the above.