spring cleaning

some management in the event handlers to make sure gui items being processed don’t get removed/moved around in the item queue.

serialization of items has been expanded to allow for local copies of items including their full hierarchy. Child objects that reference other objects within the hierarchy should now be guaranteed to point to the same (relative) item within the copy, while references pointing at items outside the hierarchy should remain the same on a copied item.

I’ve found a neat little code profiler that allows me to find bottlenecks in my program flow:

Very Sleepy

Event handlers might be improved upon by implementing the base event handler in the base class only, then calling specific functions according to the event being processed:

mousePressEvent()

mouseReleaseEvent()

mouseMoveEvent()

wheelEvent()

keyEvent()

etc.

Expanding on the event handlers in this manner would greatly improve legibility of the code. However, there’s an issue with container items: they will have to iterate through their child items and call the respective function n times, resulting in unneccessary code duplication and automatically demanding that these parent classes implement all the available event handler functions.

Another approach would be to move the vector with potential child items to the base class and iterating through it in the base event handler. This would require any class that aggregate other gui items (such as the list view – labels) to add these aggregations to the base class child vector – which means rewriting a lot of the UI code.

Leave a Reply