yorik wrote: ↑Wed Jan 26, 2022 11:58 am
Yes, this is all old, legacy code from a time I wasn't very good at coding
The whole grid and snapping system could definitely be reworked.
It also looks like it was tweaked for feature improvement several times. Some refactor could be good, but I guess the main issue for me was my lack of knowledge on this part of code.
Indeed many startup procedures happen before the 3D view is on. Firing a Qt timer is how we usually solved this in the past, for ex. in the Tux module.
Yes, saw that in the past when fixing something in Tux. I'll refactor it when I get some spare time.
However here it indeed probably needs to have an event when view is ready. I think having a slot in Gui::DocumentObserver when a view is created (fired when the view is ready) would be beneficial. Eventually one when a view is closed too, but IMO less useful. I'll ping @wmayer soon to probe how he feels about implementing this.
I can look at the onChange function too.. Which macro has it successfully working?
Ouch, I'm with my mobile now. Will post it here in the coming day.