[PyQt] Dialog not deleted in PyQt5
Phil Thompson
phil at riverbankcomputing.com
Mon Apr 28 17:53:57 BST 2014
On 26/04/2014 5:18 pm, Martin Altmayer wrote:
> Hello,
>
> In the minimal working example in the attachment a dialog is deleted
> when using PyQt4 but not deleted when using PyQt5. Was there an
> intended change in the delete-behavior?
>
> The example will show a single button that opens a dialog which
> connects to a signal. The signal is emitted after the dialog is
> accepted and makes the dialog print a line. In PyQt4, whenever you
> accept the dialog, you will get one line of output. In PyQt5, when you
> accepted the n-th dialog you will get n lines of output, because all n
> dialogs are still alive and listening to the signal.
>
> As a workaround one can delete the dialog manually using deleteLater
> (depending on the version pyqtSlot might be necessary as discussed in
> http://www.riverbankcomputing.com/pipermail/pyqt/2014-April/034042.html).
>
> Versions: PyQt: 4.10.4-2 and 5.2.1-2 Qt: 4.8.6 and 5.2.1 SIP
> 4.15.5
Should be fixed in tonight's PyQt5 snapshot.
Thanks,
Phil
More information about the PyQt
mailing list