You can either set the modality setting as Marcus mentioned, or you can use
exec_() instead of show() which automatically does a modal window and also
blocks on the call until it is accepted or rejected.
 On 6/10/2014 10:46 PM, "Marcus Ottosson" <[email protected]> wrote:

> Hi Fredrik,
>
> This behaviour is called “modality”. Have a look here:
>
>    - http://qt-project.org/doc/qt-4.8/qwidget.html#windowModality-prop
>
> Best,
> Marcus
> ​
>
> On 6 October 2014 10:36, Fredrik Averpil <[email protected]>
> wrote:
>
>> Hi,
>>
>> You know how the save dialog locks up the Maya UI and only allows you to
>> interact with the save dialog… do you know how can this be achieved when
>> loading up a custom PySide window?
>>
>> I’m doing this at the moment, which makes sure that the custom ui stays
>> on top of Maya, but it doesn’t lock up the main Maya window in the same way
>> the save dialog does:
>>
>> from PySide import QtGui
>> class MyApp(QtGui.QMainWindow):
>>     def __init__(self, parent=None):
>>         super(MyApp, self).__init__(parent)
>>
>>         self.centralWidget = QtGui.QWidget(self)
>>         self.setCentralWidget(self.centralWidget)
>>         self.mainLayout=QtGui.QVBoxLayout(self.centralWidget)
>>         self.list_widget = QtGui.QListWidget()
>>         self.mainLayout.addWidget(self.list_widget)
>>
>> my_app = MyApp( parent=QtGui.QApplication.activeWindow() )
>> my_app.show()
>>
>> Cheers,
>> Fredrik
>> ​
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMVD1vAj3pyJLBEjmNRm0R5p5%2BuaTDzxD7oOEW%3D0MvfgA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMVD1vAj3pyJLBEjmNRm0R5p5%2BuaTDzxD7oOEW%3D0MvfgA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> *Marcus Ottosson*
> [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB7%2BT%2By%2BnHu%2BwDTetFpa_6YSJempYLPmwC_yYSYmoXzQw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB7%2BT%2By%2BnHu%2BwDTetFpa_6YSJempYLPmwC_yYSYmoXzQw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2vqmBwbSR6v95WSSkhEkv7Ua%2BhLRbg%3D%2B%2BCbqKGEN3WDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to