Sorry for vague title, but I am having a little trouble with both using PyQT, Python, and QT, all very new versions, problem 1 is:
How can I check if Shift/Ctrl/Alt is pressed, I know I can do a keypressevent and a keyrelease event, however this goes wrong if I press shift down over the window, and release shift over a different application, the keyreleaseevent is not called and my app does not know that shift is no longer held down, I expect I could work something out with windowleave events, but is there a better way?
Second problem is more tricky, I call a class which then spawns a thread to get a picture, once it has the picture it notififies the object which asked for the picture, so that it can use it, generally speaking this works great, but sometimes it crashes either with no error message at all, a segmentation fault, or a XLib: GCError 13. I can do it 100s of times it it's fine, and then it will crash, I have made it so that no more than 5 threads are open at a time, and that they exit before opening a new thread, I know QT is not totally thread safe, but is it that bad? It seems odd that it will work one hundred times or more and then decide it's had enough and crash. I know this question is vague and I have a hard time explaining exactly what it's doing, but has anyone had similar problems or any tips on how to solve it?
Thanks a lot in advance.
Garry
How can I check if Shift/Ctrl/Alt is pressed, I know I can do a keypressevent and a keyrelease event, however this goes wrong if I press shift down over the window, and release shift over a different application, the keyreleaseevent is not called and my app does not know that shift is no longer held down, I expect I could work something out with windowleave events, but is there a better way?
Second problem is more tricky, I call a class which then spawns a thread to get a picture, once it has the picture it notififies the object which asked for the picture, so that it can use it, generally speaking this works great, but sometimes it crashes either with no error message at all, a segmentation fault, or a XLib: GCError 13. I can do it 100s of times it it's fine, and then it will crash, I have made it so that no more than 5 threads are open at a time, and that they exit before opening a new thread, I know QT is not totally thread safe, but is it that bad? It seems odd that it will work one hundred times or more and then decide it's had enough and crash. I know this question is vague and I have a hard time explaining exactly what it's doing, but has anyone had similar problems or any tips on how to solve it?
Thanks a lot in advance.
Garry