I have created an application using PyQt6 and integrated a QTableWidget in my UI using Qt Designer. I promoted this QTableWidget to my custom class TableWidget. The application works fine when running normally, but when I try to package it using Briefcase, I get the following error:ModuleNotFoundError: No module named ‘tablewidget’
How can I resolve this issue and ensure that my promoted classes are correctly recognized when packaging with Briefcase? Any help or pointers would be greatly appreciated.
In Qt Designer, I promoted the QTableWidget to TableWidget.
Promoted class name: TableWidget
Header file: tablewidget.h
My custom TableWidget class is defined in tablewidget.py
tablewidget.py:
from PyQt6.QtWidgets import QTableWidget
class TableWidget(QTableWidget):
def __init__(self, parent=None):
super().__init__(parent)
# custom initialization code
To troubleshoot, I demoted the QTableWidget back to the standard QTableWidget in Qt Designer and created an object of my custom TableWidget class in the code, which worked. However, I have other promoted classes in my application, so I would prefer if the promoted classes are recognized correctly.
Hannah Taube is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.