Closed Jake4353 closed 7 months ago
Is it possible to load a ui file within a FluentWindow or Frameless window as it returns this error when i try to load it.
raise TypeError(TypeError: ('Wrong base class of toplevel widget', (<class '__main__.Ui'>, 'QMainWindow'))
But if i do a normal QMainWindow it works, But the only issue i have is the default window frame
Windows 11 23H2
3.10.10
pyqt5 5.15.9
1.5.1
Run a ui file containing a Fluent widget with the code.
import sys from PyQt5 import uic, QtWidgets # from qframelesswindow import FramelessWindow # from qfluentwidgets import FluentWindow # class Ui(FramelessWindow): # class Ui(FluentWindow): class Ui(QtWidgets.QMainWindow): def __init__(self): super(Ui, self).__init__() uic.loadUi('main.ui', self) self.show() app = QtWidgets.QApplication(sys.argv) window = Ui() app.exec_()
It could be that the class of your UI file is not QWidget. I tested it and there was no problem. You can upload your UI file.
What happened?
Is it possible to load a ui file within a FluentWindow or Frameless window as it returns this error when i try to load it.
But if i do a normal QMainWindow it works, But the only issue i have is the default window frame
Operation System
Windows 11 23H2
Python Version
3.10.10
PyQt/PySide Version
pyqt5 5.15.9
PyQt/PySide-Fluent-Widgets Version
1.5.1
How to Reproduce?
Run a ui file containing a Fluent widget with the code.
Minimum code