Properly (de)serialize enum values
This should fix some test issues that appeared with Qt 5.14 in the app.