Closed bob-white closed 7 years ago
@bob-white what about moving this into the QT module instead? Putting it in core introduces a potential version-breaking dependency, I wanted to isolate those into an optional module
Good call. Realized I need to add some other methods as well.
While you're at it, it would be kindly to add a version switch that handled QT4/QT5 issues.... jus' sayin' :)
Ha just noticed the other comment. You want I should add that to QTextField as well? Do we want to worry about PySide vs PyQt? Or should we just stick with supporting PySide(2) for now?
Added support for PySide2 for now, if we want to stretch this to handle PyQt, it might be best to adopt something along the lines of https://github.com/mottosso/Qt.py, to have a single adapter layer.
Agreed, the audience for this is QT-averse (like me!)
I was testing this a bit more. Turns out while it does make the window modal, it doesn't actually block.
Which means it does avoid the problems in #56, but doesn't really work as a replacement for layoutDialog
Modal but non-blocking sounds ... problematic...
@bob-white, maybe we should make a new QTPy branch and push that over that way?
This is superseded by #68
Not sure if this fixes #56 or not, but it does provide a potential alternative. This behaves identically to the BindingWindow, except it blocks input to all other windows.
This allows us to define a ModalWindow, just like any other Window class, and lets us bypass cmds.layoutDialog
For example: from maya import cmds from mGui import gui, forms
def test(*_, **__): cmds.polySphere()
with gui.ModalWindow() as win: with forms.FillForm() as form: btn = gui.Button() btn.command += test
win.show()