0

I'am going to start coding a GUI with Python and Qt using PySide.

I'am using Qt-creator to generate ui for my application.

I need a dialog without os decoration such titlebar, statusbar, ... And this Dialog must be modal, or at least it must close when I click outside its borders.

The Modal behaviour is setted by qt-creator: Dialog.setWindowModality(QtCore.Qt.WindowModal) Dialog.setModal(True)

The in my python code I'am using:

def handle_menu(self):
    self.menu = QtGui.QDialog(self)
    menuUi = menuDialog.Ui_Dialog()
    menuUi.setupUi(self.menu)
    self.menu.setWindowFlags( QtCore.Qt.CustomizeWindowHint ) # Hide the OS decorations
    self.menu.show() 

In this way the Modal setting doesn't work, if I comment the setWindowFlags command Modal Dialog works, but a titlebar is shown.

willygroup
  • 143
  • 1
  • 10

1 Answers1

1

I have solved using this command:

self.menu.setWindowFlags( QtCore.Qt.SplashScreen | QtCore.Qt.FramelessWindowHint )

Instead of this:

self.menu.setWindowFlags( QtCore.Qt.CustomizeWindowHint ) # Hide the OS decorations
willygroup
  • 143
  • 1
  • 10