Crash while updating QLineEdit , calling setText

Denis Ryndine dry at embsys-soft.com.au
Wed Nov 4 19:26:12 GMT 2020


Hello,

Took a while, but in the end I found as usually is, the problem is the user.

How I found it, I decided to replace the widget QLineEdit with a text
edit to try get a different result. And that threw me a different
ASSERT / fatal error with a trace QLineEdit wasn't throwing : it was a
 complaint that
the thread trying to update the widget is not the one owning it /  created it.

My widgent (QLineEdit specifically) updater thread wasn't the thread
where QApplication was created and started,  and where my app QDialog
and all it's contents were created, and even though that was the only
thread that updated
any of the UI/ widgets,  that's still a big big no  no.

I've added signals and slots now to the main app/ thread and the
crashes / segfaults went away.

Regards,

Denis

On Sat, Oct 31, 2020 at 10:26 PM Florian Bruhin <me at the-compiler.org> wrote:
>
> Hey Denis,
>
> On Sat, Oct 31, 2020 at 10:38:10AM +1100, Denis Ryndine wrote:
> > That looks like all over the place, if you ask me.
>
> Yup!
>
> > I must be doing something fundamentally wrong from my Python script
> > that it brings down entire Python runtime in such way.
>
> Either that, or something you're doing is hitting bugs - most likely in
> Qt itself rather than PyQt though.
>
> At that point it'd be helpful if you could share a reproducer people
> could run locally - ideally in C++ (easier to report a bug upstream with
> it if needed, and it'd also make sure those bugs indeed happen in Qt
> rather than PyQt), but one in Python would be a first step.
>
> Florian
>
> --
> me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org
>        https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
>        GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
>              I love long mails! | https://email.is-not-s.ms/


More information about the PyQt mailing list