[PyQt] Showing another form
Phil Thompson
phil at riverbankcomputing.co.uk
Fri Nov 16 14:56:43 GMT 2007
On Friday 16 November 2007, Luca Bedogni wrote:
> Hi
> it's my first message here :)
> I'm building an interface for an application I've written.
> Not sure if it's the best way, but I've a button called "Insert New", and
> I'd to get a string from a popup. So i builded another form, with a
> QLineEdit and an OK button, that i want to show when someone press "Insert
> New".
>
> So i connected "Insert New" to a signal, in my app i catch that signal and
> instantiate the form, the form.show() doesn't show nothing. If I put a
> wrong command next to show, i could see my form, but that's not a good
> solution.
>
> So, is this th best way to do that, and if positive, in what am I wrong?
You probably need a modal dialog (ie. call exec_() rather than show()).
But you probably really need QInputDialog.getText().
Phil
More information about the PyQt
mailing list