You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally functions called outside of the main Qt thread should not manipulate the GUI, instead relying on Signals to change things.
Currently setAutoFillBackground and _input_set_value are used in set_value and get_value of the BaseParam object, which manipulate the GUI directly. This can cause the entire kernel to crash sometimes.
https://doc.qt.io/qt-5/qt.html#ConnectionType-enum - the default Signal connection type is Auto, which means emitting a signal is equivalent to calling a function directly when in the main thread, but uses a queue system when emitted from a different thread. Using Signals we can thus make set_value and get_value safe to use in the main thread and in Workers.
Note that we can't guarantee the user's setters and getters will be threadsafe, but these shouldn't in general have to manipulate the GUI themselves (for that we have the changed Signal).
The text was updated successfully, but these errors were encountered:
Related TODO: colour param red on set_value - currently that only happens on input field change, but we block that Signal when the change is a result of set_value. This is not visible if the UI freezes when set_value is called, but if puzzle.process_events() is called or the set_value happens in a thread, it would be good to make the visual indication happen.
Generally functions called outside of the main Qt thread should not manipulate the GUI, instead relying on Signals to change things.
Currently
setAutoFillBackground
and_input_set_value
are used inset_value
andget_value
of theBaseParam
object, which manipulate the GUI directly. This can cause the entire kernel to crash sometimes.https://doc.qt.io/qt-5/qt.html#ConnectionType-enum - the default Signal connection type is Auto, which means emitting a signal is equivalent to calling a function directly when in the main thread, but uses a queue system when emitted from a different thread. Using Signals we can thus make
set_value
andget_value
safe to use in the main thread and in Workers.Note that we can't guarantee the user's setters and getters will be threadsafe, but these shouldn't in general have to manipulate the GUI themselves (for that we have the
changed
Signal).The text was updated successfully, but these errors were encountered: