Each tier of quality adds a module slot to all machines.
This is a straight rip of Andrey135296's code, partially fixed for Maraxsis. (It's still half-broken with Maraxsis but it shouldn't crash anymore.)
Credits/Acknowledgements
Original code
Andrey135296 - Wrote the original Quality Effects mod & a lot of the "foundational" code (ie code that QEF was built on)
Lots of crash-fixes and bug-fixes
Kyos - Wrote QEF2, and I got permission to copy their code over to QEF (this mod!) so their bug fixes are here too.
https://mods.factorio.com/user/Hyos
factorio-mod-template
fgardt's factorio mod template is so insanely useful, I don't have to do a whole "update changelog, info.json, redownload mod, etc." mess to update QEF, I just add a github commit (or merge a branch in) and it's done
https://github.com/fgardt/factorio-mod-template