Correctly convert enums and QFlags from and to JSON


Previously, enums declared with Q_ENUM were stringified in the
conversion to JSON and QFlags did not work at all. The conversion of
QJsonValue(int) to enum worked fine, however. This patch implements
some extra logic for detecting enums and QFlags, thus correctly
converting to and from integers.

[ChangeLog] Enum values and QFlags are now correctly converted to and
from integers in the JS interface

Fixes: QTBUG-72924
Change-Id: I23d4a1120b805201c8d450edbd990aad5ad258a2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
commit38f097ba76fe5b26ccc15a5599e312336200e564
parentc80cbce7ac3b38a45a38b57795c7eb19e5177a17
authorArno Rehn <a.rehn@menlosystems.com>
committerArno Rehn <a.rehn@menlosystems.com>
commit timeThu, 31 Jan 2019 08:19:11 +0000