I've tried everything I can think of, but no matter what I do, I get this error whenever I try to set the window's attribute "FramelessWindowHint." First, here is the code:
import sys
from PyQt6.QtWidgets import QApplication, QWidget
from PyQt6.QtCore import Qt
class MainApp(QWidget):
def __init__(self):
super().__init__()
self.setWindowFlags(Qt.FramelessWindowHint)
app = QApplication(sys.argv)
window = MainApp()
window.show()
sys.exit(app.exec())
This is my code. When I run it without the line self.setWindowFlags(Qt.FramelessWindowHint)
, it works fine, and I can add other elements, I just stripped it down for the question. The "ID" for FramelessWindowHint, at least in PyQt5, is 2048. If I try this using PyQt5, it works fine, but when I try replacing the from PyQt6.QtCore import Qt
with PyQt5, it throws an error:
TypeError: setWindowFlags(self, Qt.WindowFlags): argument 1 has unexpected type 'WindowType'
I have searched everywhere I can think of, and nobody else has this problem as far as I can find. I looked in https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtcore/qt.html but it doesn't say anything about this, it shows FramelessWindowHint
normally.
If anyone else has had this problem or knows the solution, please let me know. I'll try to reply as soon as possible, TIA!