Clean up ShortcutOverride handling

Instead of sending the event from random places, send it from
QWindowSystemInterface. This allows to send override events on OS X to
menus before doing other key processing and reduces the number of
ShortcutOverride events on all platforms to exactly one per key press
event.

Additional test by Friedemann Kleint.

Task-number: QTBUG-38986
Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Add conversion between QVariantHash and QJsonObject

Adds automatic conversion from QVariants with a QVariantHash to
QJsonValue and explicit methods for conversion between QVariantHash
and QJsonObject.

[ChangeLog][QtCore][QJsonObject] Added conversion to and from QVariantHash

Change-Id: I140ef881463acabaab2648e28209487d8ad18e0d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Be able to read and write properties to Q_GADGET

Change-Id: Ic12f465d31459748ca08ac8c457fd61a5773e2e2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make Q_INVOKABLE work on Q_GADGET

Methods can be invoked with QMetaMethod::invokeOnGadget

Change-Id: Id734868bb530b02587daf0f62bce01798ade2ac2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Use file mapping in moc.

The change reduces heap allocations by using file mapping instead of
reading a whole file into memory just to create a slightly modified
copy of it.

For this small test case:

 moc <<EOF
  class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };
 EOF

massif shows improvement from:
peak cost: "26,8 KB"  heap "2,1 KB"  heap extra "0 B"  stacks
to:
peak cost: "11,3 KB"  heap "2,2 KB"  heap extra "0 B"  stacks

In general, depending on source file high peak memory usage is reduced
from few to few hundreds KB, especially that the allocation used to
happen for each include file too.

Change-Id: I9c1c848be848444156af25a991b67161fb9d8b29
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>