Mac: Correct writingSystem check value for Chinese

For simplified and traditional Chinese.

Based on the Apple doc: Internationalization Programming Topics -
Language and Locale Designations.

(backport of commit edfb24009cf22a0f0277be5d595b48ef9af9c3bf from qt5/qtbase)

Task-number: QTBUG-27130
Change-Id: I08969bfba17b6a2589dca5da83b668bb2d8f3e31
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Expose the NSEvent* object of a QKeyEvent

In order to properly forward keyboard events, the original NSEvent is
required. Conditionally compiled this code behind a macro named
QT_BLIZZARD_MAC_NATIVE_EVENTS.
Mac OSX: Be able to turn off sheets application wide

This is a patch submitted to QTBUG-11998. It allows us to disable
the default behavior which turns modal dialogs into sheets, unless
Qt::Sheet is explicitly set.
Modifications to the default textcontrol menu on mac

- Added define to allow for enabling of control character menu item.
- Undo and Redo only added to context menu if undo/redo is available.
Disabled buttons should not consume mouse wheel events

As buttons normally ignore all mouse wheel events it is wired if it
starts consuming then when disabled.

It seems that when another bug was fixed the mouse wheel event was
included in the list by accident.  All the other events that a button
normally consume should be consumed the same way when it is disabled.
QComboBox: Don't consume mouse wheel events without focus
QGraphicsItem custom tooltip support.

This change allows us to show custom tooltips for certain items that
inherit from QGrahicsItem. When the ItemHasCustomTooltip flag is set
sceneEvent(...) will be invoked on the item whenever graphics view
decides that it needs to show a tooltip. The item then may show its own
tooltip.  If event->isAccepted() is true (which is the default) no
further processing of the tooltip event will be performed and the
default tooltip will not be shown even if the item has its tooltip()
method return non-empty string.
Initialize all QMetaObject fields.

QMetaObject::d.extradata was left uninitialized causing invalid memory
access later.
QML Animation: Use correct running value if set before construction

It appears that componentComplete() is invoked after
componentFinalized() that is invoked by
registerFinalizedParserStatusObject(). This way if running property is
set during Animation component construction it is not property picked up
by the animation object. It would think that it is already running
while it just has set the property value but did not actually start
animation process.
Crash on exit when overriding signals handlers in states.

It appears that it is still possible to have an exit crash even after
QTBUG-21617. See

    tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp

for an analysis of the issue.

The short term solution: use reference counted pointers for the signal
handler expressions. Considering all the cases we want to preserve an
expression:

  - State is destroyed but the item is alive an is in this state
  - State is destroyed but the item has a reverse action in its reverse
    list uses this expression (not sure it is actually usable)
  - The original item signal handler expression should be preserved
    regardless of the state we are in and regardless of what do we do
    with the states (add new, delete, change current state)

It seems like reference counting is the only manageable solution unless
the overall model is modified a little bit.

In the long run I would advice a more general refactoring with a strict
rules of ownership for the expressions, state groups and states. I
would say that the reverse list should be moved into the state group and
states should own their expressions. And we do not allow destruction of
the current state or any of the states current state extends.

When a state is destroyed we would delete all the expressions that
belong to that state. The reverse list should contain only references
to the expressions that were the initial values of the item signal
handlers. Thus unless we are trying to remove current state (or a state
that the current state extends) we should be fine from the semantic
standpoint.
Fixed localization of AM/PM strings in QDateTime::getFmtString()

Prior to this change, calls to QDateTime::getFmtString() would
replace the AP token in a time format with hard-coded "am" or "pm"
values, regardless of the current locale. This was evident in calls
to QDateTime::timeString().

This fix replaces the hard-coded strings with calls to
QLocale::amText() and QLocale::pmText(), which return the correct
localized strings for "am" and "pm", respectively.

Reviewer: sraub
Fixed alt-modifier key strokes for multilingual keyboards on Mac
Silence warnings emitted by MNG plugin

They aren't very helpful. Nothing appears to be behaving incorrectly,
and there is no interest in trying to fix it, so just disable the
warning completely.
Fix rectangle size of QCompleter.
Merge branch 'blizzard-cherry-picks' into blizzard
Modifications to the default textcontrol menu on mac

- Added define to allow for enabling of control character menu item.
- There is 2 locations for adding QUnicodeControlCharacterMenu().
  One is src\gui\text\qtextcontrol.cpp, another is qlineedit.cpp.
Windows: Treat wchar_t as a native type