'PySide6 setupUi TypeError

I'm trying to run the following Code:

import PySide6
from PySide6.QtWidgets import QApplication, QMainWindow
from frm_main import Ui_frm_main

class Frm_main(QMainWindow, Ui_frm_main):
    def __init__(self):
        super().__init__()
        self.setupUi(self)

app = QApplication()
frm_main = Frm_main()
frm_main.show()
app.exec()

but I get this error:

File "c:\Python Projects\PyQt Test\frm_main.py", 
line 18, in setupUi
     self.centralwidget = QtWidgets.QWidget(frm_main)
TypeError: QWidget(parent: QWidget = None, flags: 
Union[Qt.WindowFlags, Qt.WindowType] = 
Qt.WindowFlags()): argument 1 has unexpected type 
'Frm_main'

I used pyuic5 to create the frm_main.py file from a .ui file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source