Shinmera / qtools

Qtools is a collection of utilities to aid development with CommonQt
https://shinmera.github.io/qtools
zlib License
209 stars 17 forks source link

Fix WITH-MAIN-WINDOW ignoring :main-thread karg #19

Closed D4ryus closed 7 years ago

D4ryus commented 7 years ago

WITH-MAIN-WINDOW accepts a :main-thread keyword argument, but ENSURE-QAPPLICATION will always be called with NIL.

Bug was introduced with commit 49a61ae1aa, which added the keyword argument to WITH-MAIN-WINDOW to disable TMT usage.

Shinmera commented 7 years ago

ensure-qapplication should be called with :main-thread NIL as it is called within the main inner function of main-window-exec, which is being called inside the tmt body, if :main-thread is non-NIL. Therefore, ensure-qapplication is always either already in the main thread, or not, depending on the setting you pass to with-main-window.

D4ryus commented 7 years ago

oh yeah, ur right, iam sry. I've got a bug where when i call WITH-MAIN-WINDOW the first time, everything works and my application starts. But when i close the window and call it again it fails and throws errors about not beeing called in the right thread. This seemed to have fixed it, but it does not make sense at all... I will try to reproduce the bug, since its gone now after I reinstalled qtools.

D4ryus commented 7 years ago

Well, iam not able to reproduce it. Everything works as expected now. Anyway, thanks for the quick response and all the great work!

Shinmera commented 7 years ago

Well, good to hear that the problem went away.