#include "qcocoaautoreleasepool.h"
#include "qcocoacursor.h"
+#include <QtCore/QScopedPointer>
#include <QtGui/QPlatformIntegration>
QT_BEGIN_NAMESPACE
QPlatformTheme *platformTheme() const;
private:
- QPlatformFontDatabase *mFontDb;
+
+ QScopedPointer<QPlatformFontDatabase> mFontDb;
QAbstractEventDispatcher *mEventDispatcher;
- QPlatformAccessibility *mAccessibility;
- QPlatformTheme *mPlatformTheme;
+ QScopedPointer<QPlatformAccessibility> mAccessibility;
+ QScopedPointer<QPlatformTheme> mPlatformTheme;
};
QT_END_NAMESPACE
QCocoaIntegration::QCocoaIntegration()
: mFontDb(new QCoreTextFontDatabase())
, mEventDispatcher(new QCocoaEventDispatcher())
+ , mAccessibility(new QPlatformAccessibility)
+ , mPlatformTheme(new QCocoaTheme)
+
{
QCocoaAutoReleasePool pool;
screenAdded(screen);
}
- mAccessibility = new QPlatformAccessibility;
- mPlatformTheme = new QCocoaTheme;
}
QCocoaIntegration::~QCocoaIntegration()
{
- delete mAccessibility;
+ [[NSApplication sharedApplication] setDelegate: 0];
}
bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) const
QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const
{
- return mFontDb;
+ return mFontDb.data();
}
QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const
QPlatformAccessibility *QCocoaIntegration::accessibility() const
{
- return mAccessibility;
+ return mAccessibility.data();
}
QPlatformTheme *QCocoaIntegration::platformTheme() const
{
- return mPlatformTheme;
+ return mPlatformTheme.data();
}
QT_END_NAMESPACE