0

hello I'm working on Qt designer and am creating a splash screen for my application but when I run my program it shows with frames so I wrote this this in my program self.setWindowFlags(QtCore.Qt.FramelessWindowHint) this error come out

enter image description here

I really don't know how to fix it

musicamante
  • 41,230
  • 6
  • 33
  • 58
  • Please edit your question to provide a [mcve] and show all error messages as text verbatim. From the error message it appears that `self` does not refer to a `QWidget` of any description. – G.M. Apr 01 '22 at 11:58
  • It seems you're trying to manually edit a pyuic generated file, which is considered bad practice. If that's the case, please rebuild that file again and follow the official guidelines about [using Designer](//www.riverbankcomputing.com/static/Docs/PyQt5/designer.html). – musicamante Apr 01 '22 at 12:20
  • I have an example of a splashscreen [here](https://stackoverflow.com/questions/58661539/create-splash-screen-in-pyqt5/66931314#66931314) which doesn't have a border for pyqt5 if that helps. – Liam Apr 01 '22 at 13:15
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 01 '22 at 13:19
  • `UI_MainWindow` is not a widget, it's a helper class, you need to call `setWindowFlags` from `MainWindow` class instance or use second argument of `setupUi` function – mugiseyebrows Apr 01 '22 at 13:52

1 Answers1

0

the UI_MainWindow is inherited from the object, whish has no such method. Apply flag in the class inherited from UI_MainWindow and QMainWindow.

class Window(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super(Window, self).__init__()
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.setupUi(self)