Update to recent ObjFW changes

This commit is contained in:
Jonathan Schleifer 2017-05-08 02:11:18 +02:00
parent ba805dab97
commit 1e5a65195e
No known key found for this signature in database
GPG key ID: 28D65178B37F33E3
28 changed files with 341 additions and 331 deletions

View file

@ -31,21 +31,22 @@
@property (readonly, getter=isPolished) bool polished; @property (readonly, getter=isPolished) bool polished;
@property (readonly, getter=isRemoved) bool removed; @property (readonly, getter=isRemoved) bool removed;
- initWithQChildEvent: (QChildEvent*)qChildEvent; - initWithQEvent: (QEvent *)event OF_UNAVAILABLE;
- initWithQChildEvent: (QChildEvent *)qChildEvent;
- initWithType: (QChildEvent::Type)type - initWithType: (QChildEvent::Type)type
child: (QtObject*)child; child: (QtObject *)child;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtChildEvent* static OF_INLINE QtChildEvent *
toOF(QChildEvent *qChildEvent) toOF(QChildEvent *qChildEvent)
{ {
return [[[QtChildEvent alloc] return [[[QtChildEvent alloc]
initWithQChildEvent: qChildEvent] autorelease]; initWithQChildEvent: qChildEvent] autorelease];
} }
static OF_INLINE QChildEvent* static OF_INLINE QChildEvent *
toQt(QtChildEvent *childEvent) toQt(QtChildEvent *childEvent)
{ {
return [childEvent qChildEvent]; return [childEvent qChildEvent];

View file

@ -27,18 +27,18 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtChildEvent @implementation QtChildEvent
- initWithQEvent: (QEvent*)event - initWithQEvent: (QEvent *)event
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQChildEvent: (QChildEvent*)event - initWithQChildEvent: (QChildEvent *)event
{ {
return [super initWithQEvent: event]; return [super initWithQEvent: event];
} }
- initWithType: (QChildEvent::Type)type - initWithType: (QChildEvent::Type)type
child: (QtObject*)child child: (QtObject *)child
{ {
try { try {
self = [self initWithQChildEvent: self = [self initWithQChildEvent:
@ -54,9 +54,9 @@ using ObjQt::toQt;
} }
} }
- (QChildEvent*)qChildEvent - (QChildEvent *)qChildEvent
{ {
return dynamic_cast<QChildEvent*>(_qEvent); return dynamic_cast<QChildEvent *>(_qEvent);
} }
- (bool)isAdded - (bool)isAdded
@ -64,7 +64,7 @@ using ObjQt::toQt;
return toQt(self)->added(); return toQt(self)->added();
} }
- (QtObject*)child - (QtObject *)child
{ {
return toOF(toQt(self)->child()); return toOF(toQt(self)->child());
} }

View file

@ -30,24 +30,25 @@
@property (copy) OFString *organizationDomain, *organizationName; @property (copy) OFString *organizationDomain, *organizationName;
@property (getter=isQuitLockEnabled) bool quitLockEnabled; @property (getter=isQuitLockEnabled) bool quitLockEnabled;
- initWithQCoreApplication: (QCoreApplication*)qCoreApplication; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE;
- (void)installNativeEventFilter: (QAbstractNativeEventFilter*)filterObject; - initWithQCoreApplication: (QCoreApplication *)qCoreApplication;
- (void)installNativeEventFilter: (QAbstractNativeEventFilter *)filterObject;
- (void)quit; - (void)quit;
- (void)removeNativeEventFilter: (QAbstractNativeEventFilter*)filterObject; - (void)removeNativeEventFilter: (QAbstractNativeEventFilter *)filterObject;
- (bool)sendEvent: (QtEvent*)event - (bool)sendEvent: (QtEvent *)event
receiver: (QtObject*)receiver; receiver: (QtObject *)receiver;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtCoreApplication* static OF_INLINE QtCoreApplication *
toOF(QCoreApplication *qCoreApplication) toOF(QCoreApplication *qCoreApplication)
{ {
return [[[QtCoreApplication alloc] return [[[QtCoreApplication alloc]
initWithQCoreApplication: qCoreApplication] autorelease]; initWithQCoreApplication: qCoreApplication] autorelease];
} }
static OF_INLINE QCoreApplication* static OF_INLINE QCoreApplication *
toQt(QtCoreApplication *coreApplication) toQt(QtCoreApplication *coreApplication)
{ {
return [coreApplication qCoreApplication]; return [coreApplication qCoreApplication];

View file

@ -28,62 +28,62 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtCoreApplication @implementation QtCoreApplication
- initWithQObject: (QObject*)qObject - initWithQObject: (QObject *)qObject
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQCoreApplication: (QCoreApplication*)qCoreApplication - initWithQCoreApplication: (QCoreApplication *)qCoreApplication
{ {
return [super initWithQObject: qCoreApplication]; return [super initWithQObject: qCoreApplication];
} }
- (QCoreApplication*)qCoreApplication - (QCoreApplication *)qCoreApplication
{ {
return qobject_cast<QCoreApplication*>(_qObject); return qobject_cast<QCoreApplication *>(_qObject);
} }
- (OFString*)applicationName - (OFString *)applicationName
{ {
return toOF(toQt(self)->applicationName()); return toOF(toQt(self)->applicationName());
} }
- (void)setApplicationName: (OFString*)applicationName - (void)setApplicationName: (OFString *)applicationName
{ {
toQt(self)->setApplicationName(toQt(applicationName)); toQt(self)->setApplicationName(toQt(applicationName));
} }
- (OFString*)applicationVersion - (OFString *)applicationVersion
{ {
return toOF(toQt(self)->applicationVersion()); return toOF(toQt(self)->applicationVersion());
} }
- (void)installNativeEventFilter: (QAbstractNativeEventFilter*)filterObject - (void)installNativeEventFilter: (QAbstractNativeEventFilter *)filterObject
{ {
toQt(self)->installNativeEventFilter(filterObject); toQt(self)->installNativeEventFilter(filterObject);
} }
- (void)setApplicationVersion: (OFString*)applicationVersion - (void)setApplicationVersion: (OFString *)applicationVersion
{ {
toQt(self)->setApplicationVersion(toQt(applicationVersion)); toQt(self)->setApplicationVersion(toQt(applicationVersion));
} }
- (OFString*)organizationDomain - (OFString *)organizationDomain
{ {
return toOF(toQt(self)->organizationDomain()); return toOF(toQt(self)->organizationDomain());
} }
- (void)setOrganizationDomain: (OFString*)organizationDomain - (void)setOrganizationDomain: (OFString *)organizationDomain
{ {
toQt(self)->setOrganizationDomain(toQt(organizationDomain)); toQt(self)->setOrganizationDomain(toQt(organizationDomain));
} }
- (OFString*)organizationName - (OFString *)organizationName
{ {
return toOF(toQt(self)->organizationName()); return toOF(toQt(self)->organizationName());
} }
- (void)setOrganizationName: (OFString*)organizationName - (void)setOrganizationName: (OFString *)organizationName
{ {
toQt(self)->setOrganizationName(toQt(organizationName)); toQt(self)->setOrganizationName(toQt(organizationName));
} }
@ -103,13 +103,13 @@ using ObjQt::toQt;
toQt(self)->setQuitLockEnabled(quitLockEnabled); toQt(self)->setQuitLockEnabled(quitLockEnabled);
} }
- (void)removeNativeEventFilter: (QAbstractNativeEventFilter*)filterObject - (void)removeNativeEventFilter: (QAbstractNativeEventFilter *)filterObject
{ {
toQt(self)->removeNativeEventFilter(filterObject); toQt(self)->removeNativeEventFilter(filterObject);
} }
- (bool)sendEvent: (QtEvent*)event - (bool)sendEvent: (QtEvent *)event
receiver: (QtObject*)receiver receiver: (QtObject *)receiver
{ {
return toQt(self)->notify(toQt(receiver), toQt(event)); return toQt(self)->notify(toQt(receiver), toQt(event));
} }

View file

@ -38,20 +38,21 @@
@property (readonly) QEvent::Type type; @property (readonly) QEvent::Type type;
+ (int)registerEventType: (int)hint; + (int)registerEventType: (int)hint;
- initWithQEvent: (QEvent*)qEvent; - init OF_UNAVAILABLE;
- initWithQEvent: (QEvent *)qEvent;
- (void)accept; - (void)accept;
- (void)ignore; - (void)ignore;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtEvent* static OF_INLINE QtEvent *
toOF(QEvent *qEvent) toOF(QEvent *qEvent)
{ {
return [[[QtEvent alloc] initWithQEvent: qEvent] autorelease]; return [[[QtEvent alloc] initWithQEvent: qEvent] autorelease];
} }
static OF_INLINE QEvent* static OF_INLINE QEvent *
toQt(QtEvent *event) toQt(QtEvent *event)
{ {
return [event qEvent]; return [event qEvent];

View file

@ -35,7 +35,7 @@
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQEvent: (QEvent*)qEvent - initWithQEvent: (QEvent *)qEvent
{ {
self = [super init]; self = [super init];

View file

@ -40,56 +40,57 @@
@property (retain) QtObject *parent; @property (retain) QtObject *parent;
@property (copy) OFString *objectName; @property (copy) OFString *objectName;
- initWithQObject: (QObject*)qObject; - init OF_UNAVAILABLE;
- initWithQObject: (QObject *)qObject;
- (bool)setBlockSignals: (bool)block; - (bool)setBlockSignals: (bool)block;
- (OFArray OF_GENERIC(QtObject*)*)children; - (OFArray OF_GENERIC(QtObject *) *)children;
- (QMetaObject::Connection)connectSignal: (OFString*)signal - (QMetaObject::Connection)connectSignal: (OFString *)signal
sender: (QtObject*)sender sender: (QtObject *)sender
method: (OFString*)method method: (OFString *)method
type: (Qt::ConnectionType)type; type: (Qt::ConnectionType)type;
- (bool)disconnectSignal: (OFString*)signal - (bool)disconnectSignal: (OFString *)signal
receiver: (QtObject*)receiver receiver: (QtObject *)receiver
method: (OFString*)method; method: (OFString *)method;
- (bool)disconnectAllSignalsForReceiver: (QtObject*)receiver - (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver
method: (OFString*)method; method: (OFString *)method;
- (void)dumpObjectInfo; - (void)dumpObjectInfo;
- (void)dumpObjectTree; - (void)dumpObjectTree;
- (OFArray OF_GENERIC(OFDataArray*)*)dynamicPropertyNames; - (OFArray OF_GENERIC(OFDataArray *) *)dynamicPropertyNames;
- (bool)handleEvent: (QtEvent*)event; - (bool)handleEvent: (QtEvent *)event;
- (bool)filterEvent: (QtEvent*)event - (bool)filterEvent: (QtEvent *)event
forObject: (QtObject*)watched; forObject: (QtObject *)watched;
// MISSING: T findChild(const QString &name = QString(), // MISSING: T findChild(const QString &name = QString(),
// Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING QList<T> findChildren(const QString &name = QString(), // MISSING QList<T> findChildren(const QString &name = QString(),
// Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING: QList<T> findChildren(const QRegExp &regExp, // MISSING: QList<T> findChildren(const QRegExp &regExp,
// Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
- (bool)inheritsClassWithName: (OFString*)className; - (bool)inheritsClassWithName: (OFString *)className;
- (void)installEventFilter: (QtObject*)filterObj; - (void)installEventFilter: (QtObject *)filterObj;
- (bool)isWidgetType; - (bool)isWidgetType;
- (bool)isWindowType; - (bool)isWindowType;
- (void)killTimerWithID: (int)ID; - (void)killTimerWithID: (int)ID;
- (void)moveToThread: (QtThread*)targetThread; - (void)moveToThread: (QtThread *)targetThread;
- (QVariant)propertyForName: (OFString*)name; - (QVariant)propertyForName: (OFString *)name;
- (void)removeEventFilter: (QtObject*)obj; - (void)removeEventFilter: (QtObject *)obj;
- (bool)setProperty: (QVariant&)value - (bool)setProperty: (QVariant&)value
forName: (OFString*)name; forName: (OFString *)name;
- (bool)signalsBlocked; - (bool)signalsBlocked;
- (int)startTimerWithInterval: (int)interval - (int)startTimerWithInterval: (int)interval
type: (Qt::TimerType)type; type: (Qt::TimerType)type;
- (QtThread*)thread; - (QtThread *)thread;
- (void)deleteLater; - (void)deleteLater;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtObject* static OF_INLINE QtObject *
toOF(QObject *qObject) toOF(QObject *qObject)
{ {
return [[[QtObject alloc] initWithQObject: qObject] autorelease]; return [[[QtObject alloc] initWithQObject: qObject] autorelease];
} }
static OF_INLINE QObject* static OF_INLINE QObject *
toQt(QtObject *object) toQt(QtObject *object)
{ {
return [object qObject]; return [object qObject];

View file

@ -39,7 +39,7 @@ using ObjQt::toQt;
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQObject: (QObject*)qObject - initWithQObject: (QObject *)qObject
{ {
self = [super init]; self = [super init];
@ -68,12 +68,12 @@ using ObjQt::toQt;
_ownsObject = false; _ownsObject = false;
} }
- (OFString*)objectName - (OFString *)objectName
{ {
return toOF(_qObject->objectName()); return toOF(_qObject->objectName());
} }
- (void)setObjectName: (OFString*)objectName - (void)setObjectName: (OFString *)objectName
{ {
_qObject->setObjectName(toQt(objectName)); _qObject->setObjectName(toQt(objectName));
} }
@ -83,7 +83,7 @@ using ObjQt::toQt;
return _qObject->blockSignals(block); return _qObject->blockSignals(block);
} }
- (OFArray OF_GENERIC(QtObject*)*)children - (OFArray OF_GENERIC(QtObject *) *)children
{ {
const QObjectList &qChildren = _qObject->children(); const QObjectList &qChildren = _qObject->children();
OFMutableArray *children = [OFMutableArray arrayWithCapacity: OFMutableArray *children = [OFMutableArray arrayWithCapacity:
@ -100,25 +100,25 @@ using ObjQt::toQt;
return children; return children;
} }
- (QMetaObject::Connection)connectSignal: (OFString*)signal - (QMetaObject::Connection)connectSignal: (OFString *)signal
sender: (QtObject*)sender sender: (QtObject *)sender
method: (OFString*)method method: (OFString *)method
type: (Qt::ConnectionType)type type: (Qt::ConnectionType)type
{ {
return _qObject->connect(toQt(sender), return _qObject->connect(toQt(sender),
[signal UTF8String], [method UTF8String], type); [signal UTF8String], [method UTF8String], type);
} }
- (bool)disconnectSignal: (OFString*)signal - (bool)disconnectSignal: (OFString *)signal
receiver: (QtObject*)receiver receiver: (QtObject *)receiver
method: (OFString*)method method: (OFString *)method
{ {
return _qObject->disconnect([signal UTF8String], toQt(receiver), return _qObject->disconnect([signal UTF8String], toQt(receiver),
[method UTF8String]); [method UTF8String]);
} }
- (bool)disconnectAllSignalsForReceiver: (QtObject*)receiver - (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver
method: (OFString*)method method: (OFString *)method
{ {
return _qObject->disconnect(toQt(receiver), [method UTF8String]); return _qObject->disconnect(toQt(receiver), [method UTF8String]);
} }
@ -133,7 +133,7 @@ using ObjQt::toQt;
_qObject->dumpObjectTree(); _qObject->dumpObjectTree();
} }
- (OFArray OF_GENERIC(OFDataArray*)*)dynamicPropertyNames - (OFArray OF_GENERIC(OFDataArray *) *)dynamicPropertyNames
{ {
const QList<QByteArray> &dynamicPropertyNames = const QList<QByteArray> &dynamicPropertyNames =
_qObject->dynamicPropertyNames(); _qObject->dynamicPropertyNames();
@ -151,23 +151,23 @@ using ObjQt::toQt;
return ret; return ret;
} }
- (bool)handleEvent: (QtEvent*)event - (bool)handleEvent: (QtEvent *)event
{ {
return _qObject->event(toQt(event)); return _qObject->event(toQt(event));
} }
- (bool)filterEvent: (QtEvent*)event - (bool)filterEvent: (QtEvent *)event
forObject: (QtObject*)watched forObject: (QtObject *)watched
{ {
return _qObject->eventFilter(toQt(watched), toQt(event)); return _qObject->eventFilter(toQt(watched), toQt(event));
} }
- (bool)inheritsClassWithName: (OFString*)className - (bool)inheritsClassWithName: (OFString *)className
{ {
return _qObject->inherits([className UTF8String]); return _qObject->inherits([className UTF8String]);
} }
- (void)installEventFilter: (QtObject*)filterObj - (void)installEventFilter: (QtObject *)filterObj
{ {
_qObject->installEventFilter(toQt(filterObj)); _qObject->installEventFilter(toQt(filterObj));
} }
@ -187,38 +187,38 @@ using ObjQt::toQt;
_qObject->killTimer(ID); _qObject->killTimer(ID);
} }
- (const QMetaObject*)metaObject - (const QMetaObject *)metaObject
{ {
return _qObject->metaObject(); return _qObject->metaObject();
} }
- (void)moveToThread: (QtThread*)targetThread - (void)moveToThread: (QtThread *)targetThread
{ {
_qObject->moveToThread(toQt(targetThread)); _qObject->moveToThread(toQt(targetThread));
} }
- (QtObject*)parent - (QtObject *)parent
{ {
return toOF(_qObject->parent()); return toOF(_qObject->parent());
} }
- (void)setParent: (QtObject*)parent - (void)setParent: (QtObject *)parent
{ {
_qObject->setParent(toQt(parent)); _qObject->setParent(toQt(parent));
} }
- (QVariant)propertyForName: (OFString*)name - (QVariant)propertyForName: (OFString *)name
{ {
return _qObject->property([name UTF8String]); return _qObject->property([name UTF8String]);
} }
- (void)removeEventFilter: (QtObject*)obj - (void)removeEventFilter: (QtObject *)obj
{ {
_qObject->removeEventFilter(toQt(obj)); _qObject->removeEventFilter(toQt(obj));
} }
- (bool)setProperty: (QVariant&)value - (bool)setProperty: (QVariant &)value
forName: (OFString*)name forName: (OFString *)name
{ {
return _qObject->setProperty([name UTF8String], value); return _qObject->setProperty([name UTF8String], value);
} }
@ -234,7 +234,7 @@ using ObjQt::toQt;
return _qObject->startTimer(interval, type); return _qObject->startTimer(interval, type);
} }
- (QtThread*)thread - (QtThread *)thread
{ {
return toOF(_qObject->thread()); return toOF(_qObject->thread());
} }

View file

@ -34,7 +34,8 @@
@property QThread::Priority priority; @property QThread::Priority priority;
@property unsigned int stackSize; @property unsigned int stackSize;
- initWithQThread: (QThread*)qThread; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE;
- initWithQThread: (QThread *)qThread;
- (void)exitWithReturnCode: (int)returnCode; - (void)exitWithReturnCode: (int)returnCode;
- (void)requestInterruption; - (void)requestInterruption;
- (bool)waitForMilliseconds: (unsigned long)time; - (bool)waitForMilliseconds: (unsigned long)time;
@ -45,13 +46,13 @@
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtThread* static OF_INLINE QtThread *
toOF(QThread *qThread) toOF(QThread *qThread)
{ {
return [[[QtThread alloc] initWithQThread: qThread] autorelease]; return [[[QtThread alloc] initWithQThread: qThread] autorelease];
} }
static OF_INLINE QThread* static OF_INLINE QThread *
toQt(QtThread *thread) toQt(QtThread *thread)
{ {
return [thread qThread]; return [thread qThread];

View file

@ -25,27 +25,27 @@
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtThread: QtObject @implementation QtThread: QtObject
- initWithQObject: (QObject*)qObject - initWithQObject: (QObject *)qObject
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQThread: (QThread*)qThread - initWithQThread: (QThread *)qThread
{ {
return [super initWithQObject: qThread]; return [super initWithQObject: qThread];
} }
- (QThread*)qThread - (QThread *)qThread
{ {
return qobject_cast<QThread*>(_qObject); return qobject_cast<QThread *>(_qObject);
} }
- (QAbstractEventDispatcher*)eventDispatcher - (QAbstractEventDispatcher *)eventDispatcher
{ {
return toQt(self)->eventDispatcher(); return toQt(self)->eventDispatcher();
} }
- (void)setEventDispatcher: (QAbstractEventDispatcher*)eventDispatcher - (void)setEventDispatcher: (QAbstractEventDispatcher *)eventDispatcher
{ {
toQt(self)->setEventDispatcher(eventDispatcher); toQt(self)->setEventDispatcher(eventDispatcher);
} }

View file

@ -36,24 +36,25 @@
@property bool quitsOnLastWindowClosed; @property bool quitsOnLastWindowClosed;
@property QIcon windowIcon; @property QIcon windowIcon;
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication; - initWithQCoreApplication: (QCoreApplication *)qCoreApplication OF_UNAVAILABLE;
- initWithQGuiApplication: (QGuiApplication *)qGuiApplication;
- (double)devicePixelRatio; - (double)devicePixelRatio;
- (bool)isSavingSession; - (bool)isSavingSession;
- (bool)isSessionRestored; - (bool)isSessionRestored;
- (OFString*)sessionID; - (OFString *)sessionID;
- (OFString*)sessionKey; - (OFString *)sessionKey;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtGUIApplication* static OF_INLINE QtGUIApplication *
toOF(QGuiApplication *qGuiApplication) toOF(QGuiApplication *qGuiApplication)
{ {
return [[[QtGUIApplication alloc] return [[[QtGUIApplication alloc]
initWithQGuiApplication: qGuiApplication] autorelease]; initWithQGuiApplication: qGuiApplication] autorelease];
} }
static OF_INLINE QGuiApplication* static OF_INLINE QGuiApplication *
toQt(QtGUIApplication *GUIApplication) toQt(QtGUIApplication *GUIApplication)
{ {
return [GUIApplication qGuiApplication]; return [GUIApplication qGuiApplication];

View file

@ -29,38 +29,38 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtGUIApplication @implementation QtGUIApplication
- initWithQCoreApplication: (QCoreApplication*)qCoreApplication - initWithQCoreApplication: (QCoreApplication *)qCoreApplication
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication - initWithQGuiApplication: (QGuiApplication *)qGuiApplication
{ {
return [super initWithQCoreApplication: qGuiApplication]; return [super initWithQCoreApplication: qGuiApplication];
} }
- (QGuiApplication*)qGuiApplication - (QGuiApplication *)qGuiApplication
{ {
return qobject_cast<QGuiApplication*>(_qObject); return qobject_cast<QGuiApplication *>(_qObject);
} }
- (OFString*)applicationDisplayName - (OFString *)applicationDisplayName
{ {
return toOF(toQt(self)->applicationDisplayName()); return toOF(toQt(self)->applicationDisplayName());
} }
- (void)setApplicationDisplayName: (OFString*)applicationDisplayName - (void)setApplicationDisplayName: (OFString *)applicationDisplayName
{ {
toQt(self)->setApplicationDisplayName(toQt(applicationDisplayName)); toQt(self)->setApplicationDisplayName(toQt(applicationDisplayName));
} }
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
- (OFString*)desktopFileName - (OFString *)desktopFileName
{ {
return toOF(toQt(self)->desktopFileName()); return toOF(toQt(self)->desktopFileName());
} }
- (void)setDesktopFileName: (OFString*)desktopFileName - (void)setDesktopFileName: (OFString *)desktopFileName
{ {
toQt(self)->setDesktopFileName(toQt(desktopFileName)); toQt(self)->setDesktopFileName(toQt(desktopFileName));
} }
@ -91,12 +91,12 @@ using ObjQt::toQt;
toQt(self)->setLayoutDirection(layoutDirection); toQt(self)->setLayoutDirection(layoutDirection);
} }
- (OFString*)platformName - (OFString *)platformName
{ {
return toOF(toQt(self)->platformName()); return toOF(toQt(self)->platformName());
} }
- (QScreen*)primaryScreen - (QScreen *)primaryScreen
{ {
return toQt(self)->primaryScreen(); return toQt(self)->primaryScreen();
} }
@ -111,12 +111,12 @@ using ObjQt::toQt;
toQt(self)->setQuitOnLastWindowClosed(quitsOnLastWindowClosed); toQt(self)->setQuitOnLastWindowClosed(quitsOnLastWindowClosed);
} }
- (OFString*)sessionID - (OFString *)sessionID
{ {
return toOF(toQt(self)->sessionId()); return toOF(toQt(self)->sessionId());
} }
- (OFString*)sessionKey - (OFString *)sessionKey
{ {
return toOF(toQt(self)->sessionKey()); return toOF(toQt(self)->sessionKey());
} }

View file

@ -25,7 +25,7 @@
#include <QPaintDevice> #include <QPaintDevice>
@protocol QtPaintDevice @protocol QtPaintDevice
- (QPaintDevice*)qPaintDevice; - (QPaintDevice *)qPaintDevice;
- (int)colorCount; - (int)colorCount;
- (int)depth; - (int)depth;
- (int)devicePixelRatio; - (int)devicePixelRatio;
@ -36,7 +36,7 @@
- (int)heightMM; - (int)heightMM;
- (int)logicalDPIX; - (int)logicalDPIX;
- (int)logicalDPIY; - (int)logicalDPIY;
- (QPaintEngine*)paintEngine; - (QPaintEngine *)paintEngine;
- (bool)paintingActive; - (bool)paintingActive;
- (int)physicalDPIX; - (int)physicalDPIX;
- (int)physicalDPIY; - (int)physicalDPIY;
@ -50,7 +50,7 @@
namespace ObjQt { namespace ObjQt {
static OF_INLINE QPaintDevice* static OF_INLINE QPaintDevice *
toQt(QtPaintDevice *paintDevice) toQt(QtPaintDevice *paintDevice)
{ {
return [paintDevice qPaintDevice]; return [paintDevice qPaintDevice];

View file

@ -29,9 +29,9 @@ using ObjQt::toQt;
@implementation QtPaintDevice @implementation QtPaintDevice
@dynamic qObject; @dynamic qObject;
- (QPaintDevice*)qPaintDevice - (QPaintDevice *)qPaintDevice
{ {
return dynamic_cast<QPaintDevice*>([self qObject]); return dynamic_cast<QPaintDevice *>([self qObject]);
} }
- (int)colorCount - (int)colorCount
@ -76,7 +76,7 @@ using ObjQt::toQt;
return toQt(self)->logicalDpiY(); return toQt(self)->logicalDpiY();
} }
- (QPaintEngine*)paintEngine - (QPaintEngine *)paintEngine
{ {
return toQt(self)->paintEngine(); return toQt(self)->paintEngine();
} }

View file

@ -38,20 +38,21 @@
@property QKeySequence shortcut; @property QKeySequence shortcut;
@property (copy) OFString *text; @property (copy) OFString *text;
- initWithQAbstractButton: (QAbstractButton*)qAbstractButton; - initWithQWidget: (QWidget *)qWidget OF_UNAVAILABLE;
- (QButtonGroup*)group; - initWithQAbstractButton: (QAbstractButton *)qAbstractButton;
- (QButtonGroup *)group;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtAbstractButton* static OF_INLINE QtAbstractButton *
toOF(QAbstractButton *qAbstractButton) toOF(QAbstractButton *qAbstractButton)
{ {
return [[[QtAbstractButton alloc] return [[[QtAbstractButton alloc]
initWithQAbstractButton: qAbstractButton] autorelease]; initWithQAbstractButton: qAbstractButton] autorelease];
} }
static OF_INLINE QAbstractButton* static OF_INLINE QAbstractButton *
toQt(QtAbstractButton *abstractButton) toQt(QtAbstractButton *abstractButton)
{ {
return [abstractButton qAbstractButton]; return [abstractButton qAbstractButton];

View file

@ -29,19 +29,19 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtAbstractButton @implementation QtAbstractButton
- initWithQWidget: (QWidget*)qWidget - initWithQWidget: (QWidget *)qWidget
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQAbstractButton: (QAbstractButton*)qAbstractButton - initWithQAbstractButton: (QAbstractButton *)qAbstractButton
{ {
return [super initWithQWidget: qAbstractButton]; return [super initWithQWidget: qAbstractButton];
} }
- (QAbstractButton*)qAbstractButton - (QAbstractButton *)qAbstractButton
{ {
return qobject_cast<QAbstractButton*>(_qObject); return qobject_cast<QAbstractButton *>(_qObject);
} }
- (bool)autoExclusive - (bool)autoExclusive
@ -144,17 +144,17 @@ using ObjQt::toQt;
toQt(self)->setShortcut(shortcut); toQt(self)->setShortcut(shortcut);
} }
- (OFString*)text - (OFString *)text
{ {
return toOF(toQt(self)->text()); return toOF(toQt(self)->text());
} }
- (void)setText: (OFString*)text - (void)setText: (OFString *)text
{ {
toQt(self)->setText(toQt(text)); toQt(self)->setText(toQt(text));
} }
- (QButtonGroup*)group - (QButtonGroup *)group
{ {
return toQt(self)->group(); return toQt(self)->group();
} }

View file

@ -46,34 +46,35 @@
@property (getter=isVisible) bool visible; @property (getter=isVisible) bool visible;
@property (copy) OFString *whatsThis; @property (copy) OFString *whatsThis;
- initWithQAction: (QAction*)qAction; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE;
- (QActionGroup*)actionGroup; - initWithQAction: (QAction *)qAction;
- (QActionGroup *)actionGroup;
- (void)activate: (QAction::ActionEvent)event; - (void)activate: (QAction::ActionEvent)event;
- (QList<QGraphicsWidget*>)associatedGraphicsWidgets; - (QList<QGraphicsWidget *>)associatedGraphicsWidgets;
- (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets; - (OFArray OF_GENERIC(QtWidget *) *)associatedWidgets;
- (QVariant)data; - (QVariant)data;
- (bool)isSeparator; - (bool)isSeparator;
- (QMenu*)menu; - (QMenu *)menu;
- (QtWidget*)parentWidget; - (QtWidget *)parentWidget;
- (void)setActionGroup: (QActionGroup*)group; - (void)setActionGroup: (QActionGroup *)group;
- (void)setData: (const QVariant&)data; - (void)setData: (const QVariant&)data;
- (void)setMenu: (QMenu*)menu; - (void)setMenu: (QMenu *)menu;
- (void)setSeparator: (bool)isSeparator; - (void)setSeparator: (bool)isSeparator;
- (void)setShortcuts: (const QList<QKeySequence>&)shortcuts; - (void)setShortcuts: (const QList<QKeySequence>&)shortcuts;
- (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key; - (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key;
- (QList<QKeySequence>)shortcuts; - (QList<QKeySequence>)shortcuts;
- (bool)showStatusText: (QtWidget*)widget; - (bool)showStatusText: (QtWidget *)widget;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtAction* static OF_INLINE QtAction *
toOF(QAction *qAction) toOF(QAction *qAction)
{ {
return [[[QtAction alloc] initWithQAction: qAction] autorelease]; return [[[QtAction alloc] initWithQAction: qAction] autorelease];
} }
static OF_INLINE QAction* static OF_INLINE QAction *
toQt(QtAction *action) toQt(QtAction *action)
{ {
return [action qAction]; return [action qAction];

View file

@ -28,19 +28,19 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtAction @implementation QtAction
- initWithQObject: (QObject*)qObject - initWithQObject: (QObject *)qObject
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQAction: (QAction*)qAction - initWithQAction: (QAction *)qAction
{ {
return [super initWithQObject: qAction]; return [super initWithQObject: qAction];
} }
- (QAction*)qAction - (QAction *)qAction
{ {
return qobject_cast<QAction*>(_qObject); return qobject_cast<QAction *>(_qObject);
} }
- (bool)autoRepeat - (bool)autoRepeat
@ -103,12 +103,12 @@ using ObjQt::toQt;
toQt(self)->setIcon(icon); toQt(self)->setIcon(icon);
} }
- (OFString*)iconText - (OFString *)iconText
{ {
return toOF(toQt(self)->iconText()); return toOF(toQt(self)->iconText());
} }
- (void)setIconText: (OFString*)iconText - (void)setIconText: (OFString *)iconText
{ {
toQt(self)->setIconText(toQt(iconText)); toQt(self)->setIconText(toQt(iconText));
} }
@ -163,32 +163,32 @@ using ObjQt::toQt;
toQt(self)->setShortcutContext(shortcutContext); toQt(self)->setShortcutContext(shortcutContext);
} }
- (OFString*)statusTip - (OFString *)statusTip
{ {
return toOF(toQt(self)->statusTip()); return toOF(toQt(self)->statusTip());
} }
- (void)setStatusTip: (OFString*)statusTip - (void)setStatusTip: (OFString *)statusTip
{ {
toQt(self)->setStatusTip(toQt(statusTip)); toQt(self)->setStatusTip(toQt(statusTip));
} }
- (OFString*)text - (OFString *)text
{ {
return toOF(toQt(self)->text()); return toOF(toQt(self)->text());
} }
- (void)setText: (OFString*)text - (void)setText: (OFString *)text
{ {
toQt(self)->setText(toQt(text)); toQt(self)->setText(toQt(text));
} }
- (OFString*)toolTip - (OFString *)toolTip
{ {
return toOF(toQt(self)->toolTip()); return toOF(toQt(self)->toolTip());
} }
- (void)setToolTip: (OFString*)toolTip - (void)setToolTip: (OFString *)toolTip
{ {
toQt(self)->setToolTip(toQt(toolTip)); toQt(self)->setToolTip(toQt(toolTip));
} }
@ -203,17 +203,17 @@ using ObjQt::toQt;
toQt(self)->setVisible(visible); toQt(self)->setVisible(visible);
} }
- (OFString*)whatsThis - (OFString *)whatsThis
{ {
return toOF(toQt(self)->whatsThis()); return toOF(toQt(self)->whatsThis());
} }
- (void)setWhatsThis: (OFString*)whatsThis - (void)setWhatsThis: (OFString *)whatsThis
{ {
toQt(self)->setWhatsThis(toQt(whatsThis)); toQt(self)->setWhatsThis(toQt(whatsThis));
} }
- (QActionGroup*)actionGroup - (QActionGroup *)actionGroup
{ {
return toQt(self)->actionGroup(); return toQt(self)->actionGroup();
} }
@ -223,14 +223,14 @@ using ObjQt::toQt;
toQt(self)->activate(event); toQt(self)->activate(event);
} }
- (QList<QGraphicsWidget*>)associatedGraphicsWidgets - (QList<QGraphicsWidget *>)associatedGraphicsWidgets
{ {
return toQt(self)->associatedGraphicsWidgets(); return toQt(self)->associatedGraphicsWidgets();
} }
- (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets - (OFArray OF_GENERIC(QtWidget *) *)associatedWidgets
{ {
const QList<QWidget*> &widgets = toQt(self)->associatedWidgets(); const QList<QWidget *> &widgets = toQt(self)->associatedWidgets();
OFMutableArray *ret = OFMutableArray *ret =
[OFMutableArray arrayWithCapacity: widgets.count()]; [OFMutableArray arrayWithCapacity: widgets.count()];
void *pool = objc_autoreleasePoolPush(); void *pool = objc_autoreleasePoolPush();
@ -255,27 +255,27 @@ using ObjQt::toQt;
return toQt(self)->isSeparator(); return toQt(self)->isSeparator();
} }
- (QMenu*)menu - (QMenu *)menu
{ {
return toQt(self)->menu(); return toQt(self)->menu();
} }
- (QtWidget*)parentWidget - (QtWidget *)parentWidget
{ {
return toOF(toQt(self)->parentWidget()); return toOF(toQt(self)->parentWidget());
} }
- (void)setActionGroup: (QActionGroup*)group - (void)setActionGroup: (QActionGroup *)group
{ {
toQt(self)->setActionGroup(group); toQt(self)->setActionGroup(group);
} }
- (void)setData: (const QVariant&)userData - (void)setData: (const QVariant &)userData
{ {
toQt(self)->setData(userData); toQt(self)->setData(userData);
} }
- (void)setMenu: (QMenu*)menu - (void)setMenu: (QMenu *)menu
{ {
toQt(self)->setMenu(menu); toQt(self)->setMenu(menu);
} }
@ -285,7 +285,7 @@ using ObjQt::toQt;
toQt(self)->setSeparator(isSeparator); toQt(self)->setSeparator(isSeparator);
} }
- (void)setShortcuts: (const QList<QKeySequence>&)shortcuts - (void)setShortcuts: (const QList<QKeySequence> &)shortcuts
{ {
toQt(self)->setShortcuts(shortcuts); toQt(self)->setShortcuts(shortcuts);
} }
@ -300,7 +300,7 @@ using ObjQt::toQt;
return toQt(self)->shortcuts(); return toQt(self)->shortcuts();
} }
- (bool)showStatusText: (QtWidget*)widget - (bool)showStatusText: (QtWidget *)widget
{ {
return toQt(self)->showStatusText(toQt(widget)); return toQt(self)->showStatusText(toQt(widget));
} }

View file

@ -36,21 +36,22 @@
@property (copy) OFString *styleSheet; @property (copy) OFString *styleSheet;
@property int wheelScrollLines; @property int wheelScrollLines;
- initWithQApplication: (QApplication*)qApplication; - initWithQGuiApplication: (QGuiApplication *)qGuiApplication OF_UNAVAILABLE;
- initWithQApplication: (QApplication *)qApplication;
- (void)aboutQt; - (void)aboutQt;
- (void)closeAllWindows; - (void)closeAllWindows;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtApplication* static OF_INLINE QtApplication *
toOF(QApplication *qApplication) toOF(QApplication *qApplication)
{ {
return [[[QtApplication alloc] return [[[QtApplication alloc]
initWithQApplication: qApplication] autorelease]; initWithQApplication: qApplication] autorelease];
} }
static OF_INLINE QApplication* static OF_INLINE QApplication *
toQt(QtApplication *application) toQt(QtApplication *application)
{ {
return [application qApplication]; return [application qApplication];

View file

@ -29,19 +29,19 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtApplication @implementation QtApplication
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication - initWithQGuiApplication: (QGuiApplication *)qGuiApplication
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQApplication: (QApplication*)qApplication - initWithQApplication: (QApplication *)qApplication
{ {
return [super initWithQGuiApplication: qApplication]; return [super initWithQGuiApplication: qApplication];
} }
- (QApplication*)qApplication - (QApplication *)qApplication
{ {
return qobject_cast<QApplication*>(_qObject); return qobject_cast<QApplication *>(_qObject);
} }
- (bool)autoSIPEnabled - (bool)autoSIPEnabled
@ -114,12 +114,12 @@ using ObjQt::toQt;
toQt(self)->setStartDragTime(startDragTime); toQt(self)->setStartDragTime(startDragTime);
} }
- (OFString*)styleSheet - (OFString *)styleSheet
{ {
return toOF(toQt(self)->styleSheet()); return toOF(toQt(self)->styleSheet());
} }
- (void)setStyleSheet: (OFString*)styleSheet - (void)setStyleSheet: (OFString *)styleSheet
{ {
toQt(self)->setStyleSheet(toQt(styleSheet)); toQt(self)->setStyleSheet(toQt(styleSheet));
} }

View file

@ -28,27 +28,28 @@
@interface QtPushButton: QtAbstractButton @interface QtPushButton: QtAbstractButton
@property (readonly) QPushButton *qPushButton; @property (readonly) QPushButton *qPushButton;
@property QMenu* menu; @property QMenu *menu;
@property bool autoDefault; @property bool autoDefault;
@property (getter=isDefault, setter=setDefault:) bool default_; @property (getter=isDefault, setter=setDefault:) bool default_;
@property (getter=isFlat) bool flat; @property (getter=isFlat) bool flat;
- initWithQPushButton: (QPushButton*)qPushButton; - initWithQAbstractButton: (QAbstractButton *)qAbstractButton OF_UNAVAILABLE;
- initWithText: (OFString*)text; - initWithQPushButton: (QPushButton *)qPushButton;
- initWithText: (OFString *)text;
- initWithIcon: (QIcon)icon - initWithIcon: (QIcon)icon
text: (OFString*)text; text: (OFString *)text;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtPushButton* static OF_INLINE QtPushButton *
toOF(QPushButton *qPushButton) toOF(QPushButton *qPushButton)
{ {
return [[[QtPushButton alloc] return [[[QtPushButton alloc]
initWithQPushButton: qPushButton] autorelease]; initWithQPushButton: qPushButton] autorelease];
} }
static OF_INLINE QPushButton* static OF_INLINE QPushButton *
toQt(QtPushButton *pushButton) toQt(QtPushButton *pushButton)
{ {
return [pushButton qPushButton]; return [pushButton qPushButton];

View file

@ -30,18 +30,17 @@ using ObjQt::toOF;
using ObjQt::toQt; using ObjQt::toQt;
@implementation QtPushButton @implementation QtPushButton
- initWithQAbstractButton: (QAbstractButton *)qAbstractButton
- initWithQAbstractButton: (QAbstractButton*)qAbstractButton
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQPushButton: (QPushButton*)qPushButton - initWithQPushButton: (QPushButton *)qPushButton
{ {
return [super initWithQAbstractButton: qPushButton]; return [super initWithQAbstractButton: qPushButton];
} }
- initWithText: (OFString*)text - initWithText: (OFString *)text
{ {
try { try {
self = [self initWithQPushButton: self = [self initWithQPushButton:
@ -58,7 +57,7 @@ using ObjQt::toQt;
} }
- initWithIcon: (QIcon)icon - initWithIcon: (QIcon)icon
text: (OFString*)text text: (OFString *)text
{ {
try { try {
self = [self initWithQPushButton: self = [self initWithQPushButton:
@ -74,17 +73,17 @@ using ObjQt::toQt;
} }
} }
- (QPushButton*)qPushButton - (QPushButton *)qPushButton
{ {
return qobject_cast<QPushButton*>(_qObject); return qobject_cast<QPushButton *>(_qObject);
} }
- (QMenu*)menu - (QMenu *)menu
{ {
return toQt(self)->menu(); return toQt(self)->menu();
} }
- (void)setMenu: (QMenu*)menu - (void)setMenu: (QMenu *)menu
{ {
toQt(self)->setMenu(menu); toQt(self)->setMenu(menu);
} }

View file

@ -86,23 +86,24 @@
@property (readonly) int x; @property (readonly) int x;
@property (readonly) int y; @property (readonly) int y;
- initWithQWidget: (QWidget*)qWidget; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE;
- (OFArray OF_GENERIC(QtAction*)*)actions; - initWithQWidget: (QWidget *)qWidget;
- (OFArray OF_GENERIC(QtAction *) *)actions;
- (void)activateWindow; - (void)activateWindow;
- (void)addAction: (QtAction*)action; - (void)addAction: (QtAction *)action;
- (void)addActions: (OFArray OF_GENERIC(QtAction*)*)actions; - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions;
- (void)adjustSize; - (void)adjustSize;
- (QPalette::ColorRole)backgroundRole; - (QPalette::ColorRole)backgroundRole;
- (QBackingStore*)backingStore; - (QBackingStore *)backingStore;
- (QtWidget*)childAt: (of_point_t)point; - (QtWidget *)childAt: (of_point_t)point;
- (void)clearFocus; - (void)clearFocus;
- (void)clearMask; - (void)clearMask;
- (QMargins)contentsMargins; - (QMargins)contentsMargins;
- (of_rectangle_t)contentsRect; - (of_rectangle_t)contentsRect;
- (WId)effectiveWinID; - (WId)effectiveWinID;
- (void)ensurePolished; - (void)ensurePolished;
- (QtWidget*)focusProxy; - (QtWidget *)focusProxy;
- (QtWidget*)focusWidget; - (QtWidget *)focusWidget;
- (QFontInfo)fontInfo; - (QFontInfo)fontInfo;
- (QFontMetrics)fontMetrics; - (QFontMetrics)fontMetrics;
- (QPalette::ColorRole)foregroundRole; - (QPalette::ColorRole)foregroundRole;
@ -112,12 +113,12 @@
flags: (Qt::GestureFlags)flags; flags: (Qt::GestureFlags)flags;
- (void)grabKeyboard; - (void)grabKeyboard;
- (void)grabMouse; - (void)grabMouse;
- (void)grabMouseWithCursor: (const QCursor&)cursor; - (void)grabMouseWithCursor: (const QCursor &)cursor;
- (int)grabShortcutWithKey: (const QKeySequence&)key; - (int)grabShortcutWithKey: (const QKeySequence &)key;
- (int)grabShortcutWithKey: (const QKeySequence&)key - (int)grabShortcutWithKey: (const QKeySequence &)key
context: (Qt::ShortcutContext)context; context: (Qt::ShortcutContext)context;
- (QGraphicsEffect*)graphicsEffect; - (QGraphicsEffect *)graphicsEffect;
- (QGraphicsProxyWidget*)graphicsProxyWidget; - (QGraphicsProxyWidget *)graphicsProxyWidget;
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
- (bool)hasEditFocus; - (bool)hasEditFocus;
#endif #endif
@ -125,51 +126,51 @@
- (bool)hasHeightForWidth; - (bool)hasHeightForWidth;
- (int)heightForWidth: (int)w; - (int)heightForWidth: (int)w;
- (QVariant)queryInputMethod: (Qt::InputMethodQuery)query; - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query;
- (void)insertAction: (QtAction*)action - (void)insertAction: (QtAction *)action
before: (QtAction*)before; before: (QtAction *)before;
- (void)insertActions: (OFArray OF_GENERIC(QtAction*)*)actions - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions
before: (QtAction*)before; before: (QtAction *)before;
- (bool)isAncestorOf: (QtWidget*)child; - (bool)isAncestorOf: (QtWidget *)child;
- (bool)isEnabledTo: (QtWidget*)ancestor; - (bool)isEnabledTo: (QtWidget *)ancestor;
- (bool)isHidden; - (bool)isHidden;
- (bool)isVisibleTo: (QtWidget*)ancestor; - (bool)isVisibleTo: (QtWidget *)ancestor;
- (bool)isWindow; - (bool)isWindow;
- (of_point_t)mapPosition: (of_point_t)pos - (of_point_t)mapPosition: (of_point_t)pos
from: (QtWidget*)parent; from: (QtWidget *)parent;
- (of_point_t)mapPositionFromGlobal: (of_point_t)pos; - (of_point_t)mapPositionFromGlobal: (of_point_t)pos;
- (of_point_t)mapPositionFromParent: (of_point_t)pos; - (of_point_t)mapPositionFromParent: (of_point_t)pos;
- (of_point_t)mapPosition: (of_point_t)pos - (of_point_t)mapPosition: (of_point_t)pos
to: (QtWidget*)parent; to: (QtWidget *)parent;
- (of_point_t)mapPositionToGlobal: (of_point_t)pos; - (of_point_t)mapPositionToGlobal: (of_point_t)pos;
- (of_point_t)mapPositionToParent: (of_point_t)pos; - (of_point_t)mapPositionToParent: (of_point_t)pos;
- (QRegion)mask; - (QRegion)mask;
- (QtWidget*)nativeParentWidget; - (QtWidget *)nativeParentWidget;
- (QtWidget*)nextInFocusChain; - (QtWidget *)nextInFocusChain;
- (void)overrideWindowFlags: (Qt::WindowFlags)flags; - (void)overrideWindowFlags: (Qt::WindowFlags)flags;
- (QtWidget*)parentWidget; - (QtWidget *)parentWidget;
- (QtWidget*)previousInFocusChain; - (QtWidget *)previousInFocusChain;
- (void)releaseKeyboard; - (void)releaseKeyboard;
- (void)releaseMouse; - (void)releaseMouse;
- (void)releaseShortcut: (int)ID; - (void)releaseShortcut: (int)ID;
- (void)removeAction: (QtAction*)action; - (void)removeAction: (QtAction *)action;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion; sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags; flags: (QWidget::RenderFlags)renderFlags;
- (void)renderIntoPainter: (QPainter*)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion; sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPainter: (QPainter*)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags; flags: (QWidget::RenderFlags)renderFlags;
- (void)repaintInRectangle: (of_rectangle_t)rect; - (void)repaintInRectangle: (of_rectangle_t)rect;
- (void)repaintInRegion: (const QRegion&)region; - (void)repaintInRegion: (const QRegion &)region;
- (bool)restoreGeometry: (OFDataArray*)geometry; - (bool)restoreGeometry: (OFDataArray *)geometry;
- (OFDataArray*)saveGeometry; - (OFDataArray *)saveGeometry;
- (void)scrollRight: (int)dx - (void)scrollRight: (int)dx
down: (int)dy; down: (int)dy;
- (void)scrollRight: (int)dx - (void)scrollRight: (int)dx
@ -184,24 +185,24 @@
- (void)setFixedSize: (of_dimension_t)size; - (void)setFixedSize: (of_dimension_t)size;
- (void)setFixedWidth: (int)width; - (void)setFixedWidth: (int)width;
- (void)setFocus: (Qt::FocusReason)reason; - (void)setFocus: (Qt::FocusReason)reason;
- (void)setFocusProxy: (QtWidget*)widget; - (void)setFocusProxy: (QtWidget *)widget;
- (void)setForegroundRole: (QPalette::ColorRole)role; - (void)setForegroundRole: (QPalette::ColorRole)role;
- (void)setGraphicsEffect: (QGraphicsEffect*)effect; - (void)setGraphicsEffect: (QGraphicsEffect *)effect;
- (void)setLayout: (QLayout*)layout; - (void)setLayout: (QLayout *)layout;
- (void)setMaskFromBitmap: (const QBitmap&)bitmap; - (void)setMaskFromBitmap: (const QBitmap &)bitmap;
- (void)setMask: (const QRegion&)region; - (void)setMask: (const QRegion &)region;
- (void)setParent: (QtWidget*)parent; - (void)setParent: (QtWidget *)parent;
- (void)setParent: (QtWidget*)parent - (void)setParent: (QtWidget *)parent
flags: (Qt::WindowFlags)flags; flags: (Qt::WindowFlags)flags;
- (void)setAutoRepeat: (bool)enable - (void)setAutoRepeat: (bool)enable
forShortcut: (int)ID; forShortcut: (int)ID;
- (void)setEnabled: (bool)enable - (void)setEnabled: (bool)enable
forShortcut: (int)ID; forShortcut: (int)ID;
- (void)setStyle: (QStyle*)style; - (void)setStyle: (QStyle *)style;
- (void)setWindowRole: (OFString*)role; - (void)setWindowRole: (OFString *)role;
- (void)setWindowState: (Qt::WindowStates)windowState; - (void)setWindowState: (Qt::WindowStates)windowState;
- (void)stackUnder: (QtWidget*)widget; - (void)stackUnder: (QtWidget *)widget;
- (QStyle*)style; - (QStyle *)style;
- (bool)testAttribute: (Qt::WidgetAttribute)attribute; - (bool)testAttribute: (Qt::WidgetAttribute)attribute;
- (bool)isUnderMouse; - (bool)isUnderMouse;
- (void)ungrabGesture: (Qt::GestureType)gesture; - (void)ungrabGesture: (Qt::GestureType)gesture;
@ -209,13 +210,13 @@
- (void)unsetLayoutDirection; - (void)unsetLayoutDirection;
- (void)unsetLocale; - (void)unsetLocale;
- (void)updateInRectangle: (of_rectangle_t)rect; - (void)updateInRectangle: (of_rectangle_t)rect;
- (void)updateInRegion: (const QRegion&)region; - (void)updateInRegion: (const QRegion &)region;
- (void)updateGeometry; - (void)updateGeometry;
- (QRegion)visibleRegion; - (QRegion)visibleRegion;
- (WId)winID; - (WId)winID;
- (QtWidget*)window; - (QtWidget *)window;
- (QWindow*)windowHandle; - (QWindow *)windowHandle;
- (OFString*)windowRole; - (OFString *)windowRole;
- (Qt::WindowStates)windowState; - (Qt::WindowStates)windowState;
- (Qt::WindowType)windowType; - (Qt::WindowType)windowType;
@end @end
@ -225,13 +226,13 @@
namespace ObjQt { namespace ObjQt {
static OF_INLINE QtWidget* static OF_INLINE QtWidget *
toOF(QWidget *qWidget) toOF(QWidget *qWidget)
{ {
return [[[QtWidget alloc] initWithQWidget: qWidget] autorelease]; return [[[QtWidget alloc] initWithQWidget: qWidget] autorelease];
} }
static OF_INLINE QWidget* static OF_INLINE QWidget *
toQt(QtWidget *widget) toQt(QtWidget *widget)
{ {
return [widget qWidget]; return [widget qWidget];

View file

@ -40,19 +40,19 @@ using ObjQt::toQt;
[self inheritMethodsFromClass: [QtPaintDevice class]]; [self inheritMethodsFromClass: [QtPaintDevice class]];
} }
- initWithQObject: (QObject*)qObject - initWithQObject: (QObject *)qObject
{ {
OF_INVALID_INIT_METHOD OF_INVALID_INIT_METHOD
} }
- initWithQWidget: (QWidget*)qWidget - initWithQWidget: (QWidget *)qWidget
{ {
return [super initWithQObject: qWidget]; return [super initWithQObject: qWidget];
} }
- (QWidget*)qWidget - (QWidget *)qWidget
{ {
return qobject_cast<QWidget*>(_qObject); return qobject_cast<QWidget *>(_qObject);
} }
- (bool)acceptDrops - (bool)acceptDrops
@ -65,22 +65,22 @@ using ObjQt::toQt;
toQt(self)->setAcceptDrops(acceptDrops); toQt(self)->setAcceptDrops(acceptDrops);
} }
- (OFString*)accessibleDescription - (OFString *)accessibleDescription
{ {
return toOF(toQt(self)->accessibleDescription()); return toOF(toQt(self)->accessibleDescription());
} }
- (void)setAccessibleDescription: (OFString*)accessibleDescription - (void)setAccessibleDescription: (OFString *)accessibleDescription
{ {
toQt(self)->setAccessibleDescription(toQt(accessibleDescription)); toQt(self)->setAccessibleDescription(toQt(accessibleDescription));
} }
- (OFString*)accessibleName - (OFString *)accessibleName
{ {
return toOF(toQt(self)->accessibleName()); return toOF(toQt(self)->accessibleName());
} }
- (void)setAccessibleName: (OFString*)accessibleName - (void)setAccessibleName: (OFString *)accessibleName
{ {
toQt(self)->setAccessibleName(toQt(accessibleName)); toQt(self)->setAccessibleName(toQt(accessibleName));
} }
@ -165,12 +165,12 @@ using ObjQt::toQt;
toQt(self)->setFocusPolicy(focusPolicy); toQt(self)->setFocusPolicy(focusPolicy);
} }
- (const QFont&)font - (const QFont &)font
{ {
return toQt(self)->font(); return toQt(self)->font();
} }
- (void)setFont: (const QFont&)font - (void)setFont: (const QFont &)font
{ {
toQt(self)->setFont(font); toQt(self)->setFont(font);
} }
@ -345,12 +345,12 @@ using ObjQt::toQt;
return toOF(toQt(self)->normalGeometry()); return toOF(toQt(self)->normalGeometry());
} }
- (const QPalette&)palette - (const QPalette &)palette
{ {
return toQt(self)->palette(); return toQt(self)->palette();
} }
- (void)setPalette: (const QPalette&)palette - (void)setPalette: (const QPalette &)palette
{ {
toQt(self)->setPalette(palette); toQt(self)->setPalette(palette);
} }
@ -405,32 +405,32 @@ using ObjQt::toQt;
toQt(self)->setSizePolicy(sizePolicy); toQt(self)->setSizePolicy(sizePolicy);
} }
- (OFString*)statusTip - (OFString *)statusTip
{ {
return toOF(toQt(self)->statusTip()); return toOF(toQt(self)->statusTip());
} }
- (void)setStatusTip: (OFString*)statusTip - (void)setStatusTip: (OFString *)statusTip
{ {
toQt(self)->setStatusTip(toQt(statusTip)); toQt(self)->setStatusTip(toQt(statusTip));
} }
- (OFString*)styleSheet - (OFString *)styleSheet
{ {
return toOF(toQt(self)->styleSheet()); return toOF(toQt(self)->styleSheet());
} }
- (void)setStyleSheet: (OFString*)styleSheet - (void)setStyleSheet: (OFString *)styleSheet
{ {
toQt(self)->setStyleSheet(toQt(styleSheet)); toQt(self)->setStyleSheet(toQt(styleSheet));
} }
- (OFString*)toolTip - (OFString *)toolTip
{ {
return toOF(toQt(self)->toolTip()); return toOF(toQt(self)->toolTip());
} }
- (void)setToolTip: (OFString*)toolTip - (void)setToolTip: (OFString *)toolTip
{ {
toQt(self)->setToolTip(toQt(toolTip)); toQt(self)->setToolTip(toQt(toolTip));
} }
@ -465,12 +465,12 @@ using ObjQt::toQt;
toQt(self)->setVisible(visible); toQt(self)->setVisible(visible);
} }
- (OFString*)whatsThis - (OFString *)whatsThis
{ {
return toOF(toQt(self)->whatsThis()); return toOF(toQt(self)->whatsThis());
} }
- (void)setWhatsThis: (OFString*)whatsThis - (void)setWhatsThis: (OFString *)whatsThis
{ {
toQt(self)->setWhatsThis(toQt(whatsThis)); toQt(self)->setWhatsThis(toQt(whatsThis));
} }
@ -480,12 +480,12 @@ using ObjQt::toQt;
return toQt(self)->width(); return toQt(self)->width();
} }
- (OFString*)windowFilePath - (OFString *)windowFilePath
{ {
return toOF(toQt(self)->windowFilePath()); return toOF(toQt(self)->windowFilePath());
} }
- (void)setWindowFilePath: (OFString*)windowFilePath - (void)setWindowFilePath: (OFString *)windowFilePath
{ {
toQt(self)->setWindowFilePath(toQt(windowFilePath)); toQt(self)->setWindowFilePath(toQt(windowFilePath));
} }
@ -540,12 +540,12 @@ using ObjQt::toQt;
toQt(self)->setWindowOpacity(windowOpacity); toQt(self)->setWindowOpacity(windowOpacity);
} }
- (OFString*)windowTitle - (OFString *)windowTitle
{ {
return toOF(toQt(self)->windowTitle()); return toOF(toQt(self)->windowTitle());
} }
- (void)setWindowTitle: (OFString*)windowTitle - (void)setWindowTitle: (OFString *)windowTitle
{ {
toQt(self)->setWindowTitle(toQt(windowTitle)); toQt(self)->setWindowTitle(toQt(windowTitle));
} }
@ -560,9 +560,9 @@ using ObjQt::toQt;
return toQt(self)->y(); return toQt(self)->y();
} }
- (OFArray OF_GENERIC(QtAction*)*)actions - (OFArray OF_GENERIC(QtAction *) *)actions
{ {
const QList<QAction*> &actions = toQt(self)->actions(); const QList<QAction *> &actions = toQt(self)->actions();
OFMutableArray *ret = OFMutableArray *ret =
[OFMutableArray arrayWithCapacity: actions.count()]; [OFMutableArray arrayWithCapacity: actions.count()];
void *pool = objc_autoreleasePoolPush(); void *pool = objc_autoreleasePoolPush();
@ -582,14 +582,14 @@ using ObjQt::toQt;
toQt(self)->activateWindow(); toQt(self)->activateWindow();
} }
- (void)addAction: (QtAction*)action - (void)addAction: (QtAction *)action
{ {
toQt(self)->addAction(toQt(action)); toQt(self)->addAction(toQt(action));
} }
- (void)addActions: (OFArray OF_GENERIC(QtAction*)*)actions - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions
{ {
QList<QAction*> list; QList<QAction *> list;
for (QtAction *action in actions) for (QtAction *action in actions)
list.append(toQt(action)); list.append(toQt(action));
@ -607,12 +607,12 @@ using ObjQt::toQt;
return toQt(self)->backgroundRole(); return toQt(self)->backgroundRole();
} }
- (QBackingStore*)backingStore - (QBackingStore *)backingStore
{ {
return toQt(self)->backingStore(); return toQt(self)->backingStore();
} }
- (QtWidget*)childAt: (of_point_t)point - (QtWidget *)childAt: (of_point_t)point
{ {
return toOF(toQt(self)->childAt(toQt(point))); return toOF(toQt(self)->childAt(toQt(point)));
} }
@ -647,12 +647,12 @@ using ObjQt::toQt;
toQt(self)->ensurePolished(); toQt(self)->ensurePolished();
} }
- (QtWidget*)focusProxy - (QtWidget *)focusProxy
{ {
return toOF(toQt(self)->focusProxy()); return toOF(toQt(self)->focusProxy());
} }
- (QtWidget*)focusWidget - (QtWidget *)focusWidget
{ {
return toOF(toQt(self)->focusWidget()); return toOF(toQt(self)->focusWidget());
} }
@ -698,28 +698,28 @@ using ObjQt::toQt;
toQt(self)->grabMouse(); toQt(self)->grabMouse();
} }
- (void)grabMouseWithCursor: (const QCursor&)cursor - (void)grabMouseWithCursor: (const QCursor &)cursor
{ {
toQt(self)->grabMouse(cursor); toQt(self)->grabMouse(cursor);
} }
- (int)grabShortcutWithKey: (const QKeySequence&)key - (int)grabShortcutWithKey: (const QKeySequence &)key
{ {
return toQt(self)->grabShortcut(key); return toQt(self)->grabShortcut(key);
} }
- (int)grabShortcutWithKey: (const QKeySequence&)key - (int)grabShortcutWithKey: (const QKeySequence &)key
context: (Qt::ShortcutContext)context context: (Qt::ShortcutContext)context
{ {
return toQt(self)->grabShortcut(key, context); return toQt(self)->grabShortcut(key, context);
} }
- (QGraphicsEffect*)graphicsEffect - (QGraphicsEffect *)graphicsEffect
{ {
return toQt(self)->graphicsEffect(); return toQt(self)->graphicsEffect();
} }
- (QGraphicsProxyWidget*)graphicsProxyWidget - (QGraphicsProxyWidget *)graphicsProxyWidget
{ {
return toQt(self)->graphicsProxyWidget(); return toQt(self)->graphicsProxyWidget();
} }
@ -746,16 +746,16 @@ using ObjQt::toQt;
return toQt(self)->inputMethodQuery(query); return toQt(self)->inputMethodQuery(query);
} }
- (void)insertAction: (QtAction*)action - (void)insertAction: (QtAction *)action
before: (QtAction*)before before: (QtAction *)before
{ {
toQt(self)->insertAction(toQt(before), toQt(action)); toQt(self)->insertAction(toQt(before), toQt(action));
} }
- (void)insertActions: (OFArray OF_GENERIC(QtAction*)*)actions - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions
before: (QtAction*)before before: (QtAction *)before
{ {
QList<QAction*> list; QList<QAction *> list;
for (QtAction *action in actions) for (QtAction *action in actions)
list.append(toQt(action)); list.append(toQt(action));
@ -763,12 +763,12 @@ using ObjQt::toQt;
toQt(self)->insertActions(toQt(before), list); toQt(self)->insertActions(toQt(before), list);
} }
- (bool)isAncestorOf: (QtWidget*)child - (bool)isAncestorOf: (QtWidget *)child
{ {
return toQt(self)->isAncestorOf(toQt(child)); return toQt(self)->isAncestorOf(toQt(child));
} }
- (bool)isEnabledTo: (QtWidget*)ancestor - (bool)isEnabledTo: (QtWidget *)ancestor
{ {
return toQt(self)->isEnabledTo(toQt(ancestor)); return toQt(self)->isEnabledTo(toQt(ancestor));
} }
@ -778,7 +778,7 @@ using ObjQt::toQt;
return toQt(self)->isHidden(); return toQt(self)->isHidden();
} }
- (bool)isVisibleTo: (QtWidget*)ancestor - (bool)isVisibleTo: (QtWidget *)ancestor
{ {
return toQt(self)->isVisibleTo(toQt(ancestor)); return toQt(self)->isVisibleTo(toQt(ancestor));
} }
@ -789,7 +789,7 @@ using ObjQt::toQt;
} }
- (of_point_t)mapPosition: (of_point_t)pos - (of_point_t)mapPosition: (of_point_t)pos
from: (QtWidget*)parent from: (QtWidget *)parent
{ {
return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos))); return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos)));
} }
@ -805,7 +805,7 @@ using ObjQt::toQt;
} }
- (of_point_t)mapPosition: (of_point_t)pos - (of_point_t)mapPosition: (of_point_t)pos
to: (QtWidget*)parent to: (QtWidget *)parent
{ {
return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos))); return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos)));
} }
@ -825,12 +825,12 @@ using ObjQt::toQt;
return toQt(self)->mask(); return toQt(self)->mask();
} }
- (QtWidget*)nativeParentWidget - (QtWidget *)nativeParentWidget
{ {
return toOF(toQt(self)->nativeParentWidget()); return toOF(toQt(self)->nativeParentWidget());
} }
- (QtWidget*)nextInFocusChain - (QtWidget *)nextInFocusChain
{ {
return toOF(toQt(self)->nextInFocusChain()); return toOF(toQt(self)->nextInFocusChain());
} }
@ -840,12 +840,12 @@ using ObjQt::toQt;
toQt(self)->overrideWindowFlags(flags); toQt(self)->overrideWindowFlags(flags);
} }
- (QtWidget*)parentWidget - (QtWidget *)parentWidget
{ {
return toOF(toQt(self)->parentWidget()); return toOF(toQt(self)->parentWidget());
} }
- (QtWidget*)previousInFocusChain - (QtWidget *)previousInFocusChain
{ {
return toOF(toQt(self)->previousInFocusChain()); return toOF(toQt(self)->previousInFocusChain());
} }
@ -865,12 +865,12 @@ using ObjQt::toQt;
toQt(self)->releaseShortcut(ID); toQt(self)->releaseShortcut(ID);
} }
- (void)removeAction: (QtAction*)action - (void)removeAction: (QtAction *)action
{ {
toQt(self)->removeAction(toQt(action)); toQt(self)->removeAction(toQt(action));
} }
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
{ {
@ -878,7 +878,7 @@ using ObjQt::toQt;
sourceRegion); sourceRegion);
} }
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags flags: (QWidget::RenderFlags)renderFlags
@ -887,14 +887,14 @@ using ObjQt::toQt;
sourceRegion, renderFlags); sourceRegion, renderFlags);
} }
- (void)renderIntoPainter: (QPainter*)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
{ {
toQt(self)->render(target, toQt(targetOffset), sourceRegion); toQt(self)->render(target, toQt(targetOffset), sourceRegion);
} }
- (void)renderIntoPainter: (QPainter*)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (of_point_t)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags flags: (QWidget::RenderFlags)renderFlags
@ -908,17 +908,17 @@ using ObjQt::toQt;
toQt(self)->repaint(toQt(rect)); toQt(self)->repaint(toQt(rect));
} }
- (void)repaintInRegion: (const QRegion&)region - (void)repaintInRegion: (const QRegion &)region
{ {
toQt(self)->repaint(region); toQt(self)->repaint(region);
} }
- (bool)restoreGeometry: (OFDataArray*)geometry - (bool)restoreGeometry: (OFDataArray *)geometry
{ {
return toQt(self)->restoreGeometry(toQt(geometry)); return toQt(self)->restoreGeometry(toQt(geometry));
} }
- (OFDataArray*)saveGeometry - (OFDataArray *)saveGeometry
{ {
return toOF(toQt(self)->saveGeometry()); return toOF(toQt(self)->saveGeometry());
} }
@ -969,7 +969,7 @@ using ObjQt::toQt;
toQt(self)->setFocus(reason); toQt(self)->setFocus(reason);
} }
- (void)setFocusProxy: (QtWidget*)widget - (void)setFocusProxy: (QtWidget *)widget
{ {
toQt(self)->setFocusProxy(toQt(widget)); toQt(self)->setFocusProxy(toQt(widget));
} }
@ -979,32 +979,32 @@ using ObjQt::toQt;
toQt(self)->setForegroundRole(role); toQt(self)->setForegroundRole(role);
} }
- (void)setGraphicsEffect: (QGraphicsEffect*)effect - (void)setGraphicsEffect: (QGraphicsEffect *)effect
{ {
toQt(self)->setGraphicsEffect(effect); toQt(self)->setGraphicsEffect(effect);
} }
- (void)setLayout: (QLayout*)layout - (void)setLayout: (QLayout *)layout
{ {
toQt(self)->setLayout(layout); toQt(self)->setLayout(layout);
} }
- (void)setMaskFromBitmap: (const QBitmap&)bitmap - (void)setMaskFromBitmap: (const QBitmap &)bitmap
{ {
toQt(self)->setMask(bitmap); toQt(self)->setMask(bitmap);
} }
- (void)setMask: (const QRegion&)region - (void)setMask: (const QRegion &)region
{ {
toQt(self)->setMask(region); toQt(self)->setMask(region);
} }
- (void)setParent: (QtWidget*)parent - (void)setParent: (QtWidget *)parent
{ {
toQt(self)->setParent(toQt(parent)); toQt(self)->setParent(toQt(parent));
} }
- (void)setParent: (QtWidget*)parent - (void)setParent: (QtWidget *)parent
flags: (Qt::WindowFlags)flags flags: (Qt::WindowFlags)flags
{ {
toQt(self)->setParent(toQt(parent), flags); toQt(self)->setParent(toQt(parent), flags);
@ -1022,12 +1022,12 @@ using ObjQt::toQt;
toQt(self)->setShortcutEnabled(ID, enable); toQt(self)->setShortcutEnabled(ID, enable);
} }
- (void)setStyle: (QStyle*)style - (void)setStyle: (QStyle *)style
{ {
toQt(self)->setStyle(style); toQt(self)->setStyle(style);
} }
- (void)setWindowRole: (OFString*)role - (void)setWindowRole: (OFString *)role
{ {
toQt(self)->setWindowRole(toQt(role)); toQt(self)->setWindowRole(toQt(role));
} }
@ -1037,12 +1037,12 @@ using ObjQt::toQt;
toQt(self)->setWindowState(windowState); toQt(self)->setWindowState(windowState);
} }
- (void)stackUnder: (QtWidget*)widget - (void)stackUnder: (QtWidget *)widget
{ {
toQt(self)->stackUnder(toQt(widget)); toQt(self)->stackUnder(toQt(widget));
} }
- (QStyle*)style - (QStyle *)style
{ {
return toQt(self)->style(); return toQt(self)->style();
} }
@ -1067,7 +1067,7 @@ using ObjQt::toQt;
toQt(self)->update(toQt(rect)); toQt(self)->update(toQt(rect));
} }
- (void)updateInRegion: (const QRegion&)region - (void)updateInRegion: (const QRegion &)region
{ {
toQt(self)->update(region); toQt(self)->update(region);
} }
@ -1087,17 +1087,17 @@ using ObjQt::toQt;
return toQt(self)->winId(); return toQt(self)->winId();
} }
- (QtWidget*)window - (QtWidget *)window
{ {
return toOF(toQt(self)->window()); return toOF(toQt(self)->window());
} }
- (QWindow*)windowHandle - (QWindow *)windowHandle
{ {
return toQt(self)->windowHandle(); return toQt(self)->windowHandle();
} }
- (OFString*)windowRole - (OFString *)windowRole
{ {
return toOF(toQt(self)->windowRole()); return toOF(toQt(self)->windowRole());
} }

View file

@ -25,13 +25,13 @@
#include <QByteArray> #include <QByteArray>
@interface OFDataArray (QByteArray) @interface OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray&)qByteArray; + (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray;
- (QByteArray)qByteArray; - (QByteArray)qByteArray;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE OFDataArray* static OF_INLINE OFDataArray *
toOF(const QByteArray &qByteArray) toOF(const QByteArray &qByteArray)
{ {
return [OFDataArray dataArrayWithQByteArray: qByteArray]; return [OFDataArray dataArrayWithQByteArray: qByteArray];

View file

@ -23,7 +23,7 @@
#import "OFDataArray+QByteArray.h" #import "OFDataArray+QByteArray.h"
@implementation OFDataArray (QByteArray) @implementation OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray&)qByteArray + (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray
{ {
OFDataArray *ret = [OFDataArray dataArray]; OFDataArray *ret = [OFDataArray dataArray];
[ret addItems: qByteArray.data() [ret addItems: qByteArray.data()
@ -34,6 +34,6 @@
- (QByteArray)qByteArray - (QByteArray)qByteArray
{ {
return QByteArray((char*)[self items], [self count] * [self itemSize]); return QByteArray((char *)[self items], [self count] * [self itemSize]);
} }
@end @end

View file

@ -25,14 +25,14 @@
#include <QString> #include <QString>
@interface OFString (QString) @interface OFString (QString)
+ (instancetype)stringWithQString: (const QString&)qString; + (instancetype)stringWithQString: (const QString &)qString;
- initWithQString: (const QString&)qString; - initWithQString: (const QString &)qString;
- (QString)qString; - (QString)qString;
@end @end
namespace ObjQt { namespace ObjQt {
static OF_INLINE OFString* static OF_INLINE OFString *
toOF(const QString &qString) toOF(const QString &qString)
{ {
return [OFString stringWithQString: qString]; return [OFString stringWithQString: qString];

View file

@ -23,27 +23,27 @@
#import "OFString+QString.h" #import "OFString+QString.h"
@implementation OFString (QString) @implementation OFString (QString)
+ stringWithQString: (const QString&)qString + stringWithQString: (const QString &)qString
{ {
return [[[self alloc] initWithQString: qString] autorelease]; return [[[self alloc] initWithQString: qString] autorelease];
} }
- initWithQString: (const QString&)qString - initWithQString: (const QString &)qString
{ {
static_assert(sizeof(QChar) == sizeof(of_char16_t), static_assert(sizeof(QChar) == sizeof(char16_t),
"QChar and of_char16_t have a different size!"); "QChar and char16_t have a different size!");
return [self initWithUTF16String: (of_char16_t*)qString.data() return [self initWithUTF16String: (char16_t *)qString.data()
length: qString.length()]; length: qString.length()];
} }
- (QString)qString - (QString)qString
{ {
static_assert(sizeof(of_char16_t) == sizeof(QChar), static_assert(sizeof(char16_t) == sizeof(QChar),
"of_char16_t and QChar have a different size!"); "char16_t and QChar have a different size!");
void *pool = objc_autoreleasePoolPush(); void *pool = objc_autoreleasePoolPush();
QString ret = QString((QChar*)[self UTF16String]); QString ret = QString((QChar *)[self UTF16String]);
objc_autoreleasePoolPop(pool); objc_autoreleasePoolPop(pool);