It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, Matthias!
I tried to use QTimer
in my macro, but it turns out that it missed timeout
signal, looks like in code and definitely in documentation. I subclassed QTimer
and reimplemented timerEvent
as workaround.
I use KLayout 0.26.4.
Comments
Hi Eugene,
could you paste some code so I see how you're doing this?
Thanks,
Matthias
Example is artificial, but it uses both methods.
Hi Eugene,
thanks for your code. I understand what you mean now.
First of all, I'd suggest a small enhancement:
Without the "_destroy", the QTimer_Test_Dialog stays alive because the object is owned by main window. If you re-run the macro you'll see an error message than happens because you redefine a class which is already in use.
Your workaround is working nicely, but you're right, the timeOut signal should be there. It's there for Qt4, but not for Qt5. I'll check that. For your reference I have created a ticket for this: https://github.com/KLayout/klayout/issues/629
Thanks and best regards,
Matthias
Hi, Matthias!
Thank you for suggestion! Actually my real code use
show()
(modal dialog could not be moved on Ubuntu). What is right place to call_destroy()
in this case?Eugene.
I tried to call
_destroy()
in my other code that usesexec_()
, but PyLint complains about access to protected member.Eugene.
Hi Eugene,
For "show()" is pretty difficult to use "_destroy". When your dialog is opened and you re-run the macro, this is probably crash the application or cause weird effects.
The issue is only there for debugging and development. If you're not using the integrated IDE, this is not a problem.
I have found a way to map private events too, so the bug is fixed. I just don't know if I'll be able to backport this to the 0.26 branch.
Best regards,
Matthias
Hi, Matthias!
Thank you for quick fix!
Eugene.