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=isRemoved) bool removed;
- initWithQChildEvent: (QChildEvent*)qChildEvent;
- initWithQEvent: (QEvent *)event OF_UNAVAILABLE;
- initWithQChildEvent: (QChildEvent *)qChildEvent;
- initWithType: (QChildEvent::Type)type
child: (QtObject*)child;
child: (QtObject *)child;
@end
namespace ObjQt {
static OF_INLINE QtChildEvent*
static OF_INLINE QtChildEvent *
toOF(QChildEvent *qChildEvent)
{
return [[[QtChildEvent alloc]
initWithQChildEvent: qChildEvent] autorelease];
}
static OF_INLINE QChildEvent*
static OF_INLINE QChildEvent *
toQt(QtChildEvent *childEvent)
{
return [childEvent qChildEvent];

View file

@ -27,18 +27,18 @@ using ObjQt::toOF;
using ObjQt::toQt;
@implementation QtChildEvent
- initWithQEvent: (QEvent*)event
- initWithQEvent: (QEvent *)event
{
OF_INVALID_INIT_METHOD
}
- initWithQChildEvent: (QChildEvent*)event
- initWithQChildEvent: (QChildEvent *)event
{
return [super initWithQEvent: event];
}
- initWithType: (QChildEvent::Type)type
child: (QtObject*)child
child: (QtObject *)child
{
try {
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
@ -64,7 +64,7 @@ using ObjQt::toQt;
return toQt(self)->added();
}
- (QtObject*)child
- (QtObject *)child
{
return toOF(toQt(self)->child());
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -25,27 +25,27 @@
using ObjQt::toQt;
@implementation QtThread: QtObject
- initWithQObject: (QObject*)qObject
- initWithQObject: (QObject *)qObject
{
OF_INVALID_INIT_METHOD
}
- initWithQThread: (QThread*)qThread
- initWithQThread: (QThread *)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();
}
- (void)setEventDispatcher: (QAbstractEventDispatcher*)eventDispatcher
- (void)setEventDispatcher: (QAbstractEventDispatcher *)eventDispatcher
{
toQt(self)->setEventDispatcher(eventDispatcher);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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