Try to set the windows flag in the constructor

class ModalDialog(QtGui.QDialog):
    def __init__(self, *args, **kwargs):

        kwargs['f'] = QtCore.Qt.FramelessWindowHint
        QtGui.QDialog.__init__(self, *args, **kwargs)

        #self.setWindowFlags(QtCore.Qt.FramelessWindowHint)


Regards
Juande


El 25/07/2012 11:18, Ludo Visser escribió:
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








_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to