Complete newbie to Qt and Qt Designer. I tried following some tutorials online to figure a way to embed matplotlib graph in Qt. Apparently the approach is to use subclass of QWidget which is done by "promoting" the QWidget.
I tried the approach shown in this SE link and this youtube video
Without promoting the QWidget, the *.ui file can be loaded into python without having any issue with the below script.
from PyQt5 import QtWidgets, uic
import sys
class Ui(QtWidgets.QMainWindow):
def __init__(self):
super(Ui, self).__init__()
uic.loadUi('untitled.ui', self)
self.show()
app = QtWidgets.QApplication(sys.argv)
window = Ui()
app.exec_()
But when I promote the QWidget as below, I get the following error.
Traceback (most recent call last):
File "C:\Users\user.user\Desktop\pyqt_gui.py", line 11, in <module>
window = Ui()
File "C:\Users\user.user\Desktop\pyqt_gui.py", line 7, in __init__
uic.loadUi('untitled.ui', self)
...
...
...
File "C:\Users\user.user\Anaconda3\lib\site-packages\PyQt5\uic\Loader\qobjectcreator.py", line 115, in search
module = __import__(mname, {}, {}, (cls,))
ModuleNotFoundError: No module named 'canvas'
Could someone please shed some light on this ?