Cocoa: Create QCocoaWindow when enabling touch.

The ref-counting and (native) touch enabling is
implemented in QCocoaWindow.

Change-Id: I4f3f5e16db59afec7dd7dd2f8360dd60b90bfe6d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
bb10
Morten Johan Sørvig 2013-04-12 11:46:28 +02:00 committed by The Qt Project
parent 2da29c9736
commit 11fdd8edcd
1 changed files with 5 additions and 0 deletions

View File

@ -228,6 +228,11 @@ void QCocoaNativeInterface::setWindowContentView(QPlatformWindow *window, void *
void QCocoaNativeInterface::registerTouchWindow(QWindow *window, bool enable)
{
// Make sure the QCocoaWindow is created when enabling. Disabling might
// happen on window destruction, don't (re)create the QCocoaWindow then.
if (enable)
window->create();
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
if (cocoaWindow)
cocoaWindow->registerTouch(enable);