Fix ownership / lifetime of QCocoaNativeInterface

Change-Id: I21dd1e3186e0dbbc60294f807de0db6aad8b9eee
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
James Turner 2012-04-09 14:23:45 +01:00 committed by Qt by Nokia
parent 99a2074369
commit 3918386779
2 changed files with 3 additions and 1 deletions

View File

@ -113,6 +113,7 @@ private:
QList<QCocoaScreen *> mScreens;
QCocoaClipboard *mCocoaClipboard;
QScopedPointer<QCocoaDrag> mCocoaDrag;
QScopedPointer<QPlatformNativeInterface> mNativeInterface;
QScopedPointer<QCocoaServices> mServices;
};

View File

@ -99,6 +99,7 @@ QCocoaIntegration::QCocoaIntegration()
, mAccessibility(new QPlatformAccessibility)
, mCocoaClipboard(new QCocoaClipboard)
, mCocoaDrag(new QCocoaDrag)
, mNativeInterface(new QCocoaNativeInterface)
, mServices(new QCocoaServices)
{
QCocoaAutoReleasePool pool;
@ -205,7 +206,7 @@ QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const
QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const
{
return new QCocoaNativeInterface();
return mNativeInterface.data();
}
QPlatformInputContext *QCocoaIntegration::inputContext() const