Skip to content

Add tetrix examples - #349

Open
rcalixte wants to merge 3 commits into
mappu:masterfrom
rcalixte:add_tetrix
Open

Add tetrix examples#349
rcalixte wants to merge 3 commits into
mappu:masterfrom
rcalixte:add_tetrix

Conversation

@rcalixte

Copy link
Copy Markdown
Contributor

This started out without much reason but then it became a little more! The examples are a bit larger than I think is ideal but they do flow mostly logically well. This does introduce QSignalMapper as an alternative to the C++ equivalent of class-based C++ signals which I thought was a good exercise and there's also one instance of QRandomGenerator. I'm still finding my way around the maps so currently there's one per QLCDNumber object. I think we could maybe consolidate them into a single QSignalMapper object with a unique ID per object but that escaped me for the moment and the per-object overhead isn't that severe.

This example was the first time I got bit doing defer object.Delete() for manual cleanups. It happened with the QColor and QRect objects so I removed those defer calls. A reminder course on the fact that closures can heap allocate also led to some minor refactors. The Qt 5 version still has some sporadic garbage collection crashes that I haven't been able to resolve or even consistently trigger. Other than that, everything mapped over cleanly.

A fair warning: it starts out enjoyable... and then... you understand why there is no win state implemented. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant