OSX: add several menuitem roles to support menu shortcuts in dialogs

Now menu items and key shortcuts for Cut, Copy, Paste and Select All
work in the standard ways in dialogs such as the file dialog, provided
that the corresponding QActions have been created and added to the menu.
This depends on new roles to identify each menu item which is so
broadly applicable that it should work even when a native widget has
focus; but the role will be auto-detected, just as we were already
doing for application menu items such as Quit, About and Preferences.
When the QFileDialog is opened, it will call
redirectKnownMenuItemsToFirstResponder() which will make only those
"special" menu items have the standard actions and nil targets.  When
the dialog is dismissed, those NSMenuItems must be reverted by calling
resetKnownMenuItemsToQt(), because to invoke a QAction, the NSMenuItem's
action should be itemFired and the target should be the
QCocoaMenuDelegate.

Task-number: QTBUG-17291
Change-Id: I501375ca6fa13fac75d4b4fdcede993ec2329cc7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Fix a crash on startup with QOpenGLWidget

After c4aabeb2b82d777bb555f836f55e1f7ae4fb4581 we now try to access
q_ptr in QWidgetPrivate::setRenderToTexture. QOpenGLWidget needs to
delay this call after the QObject constructor is done to make sure
that setTextureChildSeen doesn't dereference q_ptr before it has
been initialized.

Change-Id: Icaee82c8b806f42bc7614b0ac6fe4e6026331750
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
fix build for MSVC 2010

The Windows version for QS_TOUCH and QS_POINTER was slightly off.

Change-Id: Idb8a8219e09c6aa1a1b24e45b9da640c8d4b7161
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
QGuiApplication: fix crash caused by posting fake mouse event

Since Qt expects a mouse press/release event to not change
mouse position in the same event, QGuiApplicationPrivate::processMouseEvent
will detect if a QWindowSystemInterfacePrivate::MouseEvent
tries to do this and convert it to two events; one move
and one press/release.

The problem is that the extra mouse event gets posted. So if
delivering the first event causes a flush in the event queue
(which can easily happen if e.g calling processEvents), the
second event will be processed before the first returns.

On iOS we see a crash with DnD as result of this, since drag
data gets deleted on mouse release, and returning back to a mouse
move after that will cause dangling pointers.

This patch will instead of posting the event, call the
event handler recursively with the faked event as argument.
That way a flush will not cause the "pending" event to be
delivered.

Change-Id: Id9d88053b4859083fedd666584815016d67ac51b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QComboBox: Use native popups on Mac

This remains an opt-in solution bound to the usage
of SH_ComboBox_UseNativePopup in a proxy style. The
midterm goal is to make this option on by default,
possibly in 5.4. This solution is and will remain a hint
in the sense that some exotic use cases of QComboBox
(e.g., when setting its view) are inherently incompatible
with the native popup idea.

Task-number: QTBUG-32731
Change-Id: I2a3d780795c22f9989e44325fcaf314538b1de49
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
QStyle: Add new SH_ComboBox_UseNativePopup style hint

If the style hints it, QComboBox::showPopup() will try to
show a native popup instead. This is currently undocumented
and an opt-in feature (typically by using a proxy style).

Works only on Mac so far.

Task-number: QTBUG-32731
Change-Id: I4447e884cbd6b490f3039c7a95168698c0bed16e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
in command line args, escape tabs as well

Task-number: QTBUG-27154
Change-Id: I4a204b2bf2231027db55a444f304190c3b30878c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
network: finish all pending replies upon error

... and not only one. This was a problem e.g. when there were several
requests to the same host and the host was not reachable; only one
reply would get an error signal in case we suppressed other errors in
"happy eyeballs" host lookup style.

Task-number: QTBUG-36890

Change-Id: I1b5757498bd644b0d773cf6c43e4950620949c5c
Reviewed-by: Richard J. Moore <rich@kde.org>