I'm learning PySide6 and I'm trying to create a frameless QInputDialog.
When I set:
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QInputDialog, QMainWindow
app = QApplication()
input_dialog = QInputDialog(flags=Qt.FramelessWindowHint)
text, ok = input_dialog.getText(QMainWindow(), 'input dialog', 'Is this ok?')
if ok:
print(text)
app.exec()
the frame still appears. Why?
The getText method is static so
input_dialog
is not the displayed window but an instance of QInputDialog is created internally, so you must pass the flags through the method: