[PyQt] Function to open window and return user input

Hans-Peter Jansen hpj at urpla.net
Mon Jan 23 22:43:59 GMT 2012


On Monday 23 January 2012, 18:53:46 Christopher Evans wrote:
> Is there a way to make this non modal? I am using Maya and we did not
> use exec because it always made the dialog application modal, as in
> it halts the main thread and doesn't allow users to interface with
> the parent app while the window is open.

Well, I don't have any experience with Maya at all, but what you need 
seems pretty straight forward. I would subclass QDialog, show (or 
exec_) the non modal dialog, and collect the data when closed.

The gory details depend on how Maya runs such extension code (eg. how 
QApplication and the event loop is handled). 

Pete

> CE
>
> On Sun, Jan 22, 2012 at 4:27 PM, Hans-Peter Jansen <hpj at urpla.net> 
wrote:
> > On Friday 20 January 2012, 20:38:33 Christopher Evans wrote:
> > > QInput is designed to get a single input from a user.
> > >
> > > In my case, we are making a complex remapping dialog that takes
> > > two ordered lists as input, allows the users to change the order,
> > > then on dialog close, it should return the two re-ordered lists.
> >
> > That's called a modal dialog. Create it, exec_ it (look up
> > QDialog::exec()), process data after close, and be done.
> >
> > Pete
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list