[PySide] Frameless dialog does not show

Ludo Visser l.c.visser at science-applied.nl
Wed Jul 25 11:18:27 CEST 2012


Hi,

I'm trying to create a modal frameless window, because I don't want the user the
possibility to move the window or accidentally close it. However, there seems to
be an issue with my understanding of QDialogs.

I have attached two snippets that illustrate my problem. The first example
('works-as-expected.py') shows the dialog as I intend to have it. The second
snippet ('does-not-work-as-expected.py') fails to do what I want: it doesn't
show the dialog.

Some things I have noticed in debugging this issue:
1) If I comment out line 12:
      self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
   everything works fine!
2) From my understanding of the documentation of QDialog, setting the parent of
   a top-level window  should result in the dialog being centered on top of its
   parent. However, setting the parent has no effect in this case.
3) In the application I work on, I can see a little bit of the dialog peeking
   through the parent's layout: it seems the dialog has become a widget embedded
   in the parent somehow. I cannot reproduce this behavior in this simplified
   example.
4) I have the same issue with PyQt4, so I don't think it is a bug in PySide.

Any ideas? I'm using Python 2.7 + PySide 1.1.0.

Best regards,
Ludo Visser


-------------- next part --------------
A non-text attachment was scrubbed...
Name: works-as-expected.py
Type: text/x-python-script
Size: 584 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20120725/b3432164/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: does-not-work-as-expected.py
Type: text/x-python-script
Size: 1020 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20120725/b3432164/attachment-0001.bin>
-------------- next part --------------



-- 
Ludo C. Visser, M.Sc.
Science Applied
phone: +31 6 1066 3076
e-mail: l.c.visser at science-applied.nl
web: www.science-applied.nl



More information about the PySide mailing list