Index: src/QtCore/QtChildEvent.h ================================================================== --- src/QtCore/QtChildEvent.h +++ src/QtCore/QtChildEvent.h @@ -29,14 +29,15 @@ @property (readonly, nonatomic, getter=isAdded) bool added; @property (readonly, nonatomic) QtObject *child; @property (readonly, nonatomic, getter=isPolished) bool polished; @property (readonly, nonatomic, getter=isRemoved) bool removed; -- initWithQEvent: (QEvent *)event OF_UNAVAILABLE; -- initWithQChildEvent: (QChildEvent *)qChildEvent OF_DESIGNATED_INITIALIZER; -- initWithType: (QChildEvent::Type)type - child: (QtObject *)child; +- (instancetype)initWithQEvent: (QEvent *)event OF_UNAVAILABLE; +- (instancetype)initWithQChildEvent: + (QChildEvent *)qChildEvent OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithType: (QChildEvent::Type)type + child: (QtObject *)child; @end namespace ObjQt { static OF_INLINE QtChildEvent * @@ -50,9 +51,9 @@ } static OF_INLINE QChildEvent * toQt(QtChildEvent *childEvent) { - return [childEvent qChildEvent]; + return childEvent.qChildEvent; } } Index: src/QtCore/QtChildEvent.mm ================================================================== --- src/QtCore/QtChildEvent.mm +++ src/QtCore/QtChildEvent.mm @@ -25,22 +25,22 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtChildEvent -- initWithQEvent: (QEvent *)event +- (instancetype)initWithQEvent: (QEvent *)event { OF_INVALID_INIT_METHOD } -- initWithQChildEvent: (QChildEvent *)event +- (instancetype)initWithQChildEvent: (QChildEvent *)event { return [super initWithQEvent: event]; } -- initWithType: (QChildEvent::Type)type - child: (QtObject *)child +- (instancetype)initWithType: (QChildEvent::Type)type + child: (QtObject *)child { try { self = [self initWithQChildEvent: new QChildEvent(type, toQt(child))]; Index: src/QtCore/QtCoreApplication.h ================================================================== --- src/QtCore/QtCoreApplication.h +++ src/QtCore/QtCoreApplication.h @@ -28,12 +28,12 @@ @property (readonly, nonatomic) QCoreApplication *qCoreApplication; @property (nonatomic, copy) OFString *applicationName, *applicationVersion; @property (nonatomic, copy) OFString *organizationDomain, *organizationName; @property (nonatomic, getter=isQuitLockEnabled) bool quitLockEnabled; -- initWithQObject: (QObject *)qObject OF_UNAVAILABLE; -- initWithQCoreApplication: (QCoreApplication *)qCoreApplication +- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; +- (instancetype)initWithQCoreApplication: (QCoreApplication *)qCoreApplication OF_DESIGNATED_INITIALIZER; - (void)installNativeEventFilter: (QAbstractNativeEventFilter *)filterObject; - (void)quit; - (void)removeNativeEventFilter: (QAbstractNativeEventFilter *)filterObject; - (bool)sendEvent: (QtEvent *)event @@ -53,9 +53,9 @@ } static OF_INLINE QCoreApplication * toQt(QtCoreApplication *coreApplication) { - return [coreApplication qCoreApplication]; + return coreApplication.qCoreApplication; } } Index: src/QtCore/QtCoreApplication.mm ================================================================== --- src/QtCore/QtCoreApplication.mm +++ src/QtCore/QtCoreApplication.mm @@ -26,16 +26,16 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtCoreApplication -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } -- initWithQCoreApplication: (QCoreApplication *)qCoreApplication +- (instancetype)initWithQCoreApplication: (QCoreApplication *)qCoreApplication { return [super initWithQObject: qCoreApplication]; } - (QCoreApplication *)qCoreApplication Index: src/QtCore/QtEvent.h ================================================================== --- src/QtCore/QtEvent.h +++ src/QtCore/QtEvent.h @@ -36,12 +36,12 @@ @property (nonatomic, getter=isAccepted) bool accepted; @property (readonly, nonatomic, getter=isSpontaneous) bool spontaneous; @property (readonly, nonatomic) QEvent::Type type; + (int)registerEventType: (int)hint; -- init OF_UNAVAILABLE; -- initWithQEvent: (QEvent *)qEvent OF_DESIGNATED_INITIALIZER; +- (instancetype)init OF_UNAVAILABLE; +- (instancetype)initWithQEvent: (QEvent *)qEvent OF_DESIGNATED_INITIALIZER; - (void)accept; - (void)ignore; @end namespace ObjQt { @@ -56,9 +56,9 @@ } static OF_INLINE QEvent * toQt(QtEvent *event) { - return [event qEvent]; + return event.qEvent; } } Index: src/QtCore/QtEvent.mm ================================================================== --- src/QtCore/QtEvent.mm +++ src/QtCore/QtEvent.mm @@ -28,16 +28,16 @@ + (int)registerEventType: (int)hint { return QEvent::registerEventType(hint); } -- init +- (instancetype)init { OF_INVALID_INIT_METHOD } -- initWithQEvent: (QEvent *)qEvent +- (instancetype)initWithQEvent: (QEvent *)qEvent { self = [super init]; _qEvent = qEvent; Index: src/QtCore/QtObject.h ================================================================== --- src/QtCore/QtObject.h +++ src/QtCore/QtObject.h @@ -42,12 +42,12 @@ @property (readonly, nonatomic) OFArray OF_GENERIC(QtObject *) *children; @property (readonly, nonatomic) OFArray OF_GENERIC(OFData *) *dynamicPropertyNames; @property (readonly, nonatomic) QtThread *thread; -- init OF_UNAVAILABLE; -- initWithQObject: (QObject *)qObject OF_DESIGNATED_INITIALIZER; +- (instancetype)init OF_UNAVAILABLE; +- (instancetype)initWithQObject: (QObject *)qObject OF_DESIGNATED_INITIALIZER; - (bool)setBlockSignals: (bool)block; - (QMetaObject::Connection)connectSignal: (OFString *)signal sender: (QtObject *)sender method: (OFString *)method type: (Qt::ConnectionType)type; @@ -95,9 +95,9 @@ } static OF_INLINE QObject * toQt(QtObject *object) { - return [object qObject]; + return object.qObject; } } Index: src/QtCore/QtObject.mm ================================================================== --- src/QtCore/QtObject.mm +++ src/QtCore/QtObject.mm @@ -32,16 +32,16 @@ using ObjQt::toQt; @implementation QtObject @synthesize qObject = _qObject; -- init +- (instancetype)init { OF_INVALID_INIT_METHOD } -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { self = [super init]; _qObject = qObject; @@ -104,25 +104,25 @@ sender: (QtObject *)sender method: (OFString *)method type: (Qt::ConnectionType)type { return _qObject->connect(toQt(sender), - [signal UTF8String], [method UTF8String], type); + signal.UTF8String, method.UTF8String, type); } - (bool)disconnectSignal: (OFString *)signal receiver: (QtObject *)receiver method: (OFString *)method { - return _qObject->disconnect([signal UTF8String], toQt(receiver), - [method UTF8String]); + return _qObject->disconnect(signal.UTF8String, toQt(receiver), + method.UTF8String); } - (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver method: (OFString *)method { - return _qObject->disconnect(toQt(receiver), [method UTF8String]); + return _qObject->disconnect(toQt(receiver), method.UTF8String); } - (void)dumpObjectInfo { _qObject->dumpObjectInfo(); @@ -162,11 +162,11 @@ return _qObject->eventFilter(toQt(watched), toQt(event)); } - (bool)inheritsClassWithName: (OFString *)className { - return _qObject->inherits([className UTF8String]); + return _qObject->inherits(className.UTF8String); } - (void)installEventFilter: (QtObject *)filterObj { _qObject->installEventFilter(toQt(filterObj)); @@ -207,11 +207,11 @@ _qObject->setParent(toQt(parent)); } - (QVariant)propertyForName: (OFString *)name { - return _qObject->property([name UTF8String]); + return _qObject->property(name.UTF8String); } - (void)removeEventFilter: (QtObject *)obj { _qObject->removeEventFilter(toQt(obj)); @@ -218,11 +218,11 @@ } - (bool)setProperty: (QVariant &)value forName: (OFString *)name { - return _qObject->setProperty([name UTF8String], value); + return _qObject->setProperty(name.UTF8String, value); } - (bool)signalsBlocked { return _qObject->signalsBlocked(); Index: src/QtCore/QtThread.h ================================================================== --- src/QtCore/QtThread.h +++ src/QtCore/QtThread.h @@ -33,12 +33,12 @@ @property (readonly, nonatomic, getter=isRunning) bool running; @property (readonly, nonatomic) int loopLevel; @property (nonatomic) QThread::Priority priority; @property (nonatomic) unsigned int stackSize; -- initWithQObject: (QObject *)qObject OF_UNAVAILABLE; -- initWithQThread: (QThread *)qThread OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; +- (instancetype)initWithQThread: (QThread *)qThread OF_DESIGNATED_INITIALIZER; - (void)exitWithReturnCode: (int)returnCode; - (void)requestInterruption; - (bool)waitForMilliseconds: (unsigned long)time; - (void)quit; - (void)startWithPriority: (QThread::Priority)priority; @@ -57,9 +57,9 @@ } static OF_INLINE QThread * toQt(QtThread *thread) { - return [thread qThread]; + return thread.qThread; } } Index: src/QtCore/QtThread.mm ================================================================== --- src/QtCore/QtThread.mm +++ src/QtCore/QtThread.mm @@ -23,16 +23,16 @@ #import "QtThread.h" using ObjQt::toQt; @implementation QtThread: QtObject -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } -- initWithQThread: (QThread *)qThread +- (instancetype)initWithQThread: (QThread *)qThread { return [super initWithQObject: qThread]; } - (QThread *)qThread Index: src/QtGui/QtGUIApplication.h ================================================================== --- src/QtGui/QtGUIApplication.h +++ src/QtGui/QtGUIApplication.h @@ -36,12 +36,13 @@ @property (nonatomic) bool quitsOnLastWindowClosed; @property (nonatomic) QIcon windowIcon; @property (readonly, nonatomic) OFString *sessionID; @property (readonly, nonatomic) OFString *sessionKey; -- initWithQCoreApplication: (QCoreApplication *)qCoreApplication OF_UNAVAILABLE; -- initWithQGuiApplication: (QGuiApplication *)qGuiApplication +- (instancetype)initWithQCoreApplication: (QCoreApplication *)qCoreApplication + OF_UNAVAILABLE; +- (instancetype)initWithQGuiApplication: (QGuiApplication *)qGuiApplication OF_DESIGNATED_INITIALIZER; - (double)devicePixelRatio; - (bool)isSavingSession; - (bool)isSessionRestored; @end @@ -59,9 +60,9 @@ } static OF_INLINE QGuiApplication * toQt(QtGUIApplication *GUIApplication) { - return [GUIApplication qGuiApplication]; + return GUIApplication.qGuiApplication; } } Index: src/QtGui/QtGUIApplication.mm ================================================================== --- src/QtGui/QtGUIApplication.mm +++ src/QtGui/QtGUIApplication.mm @@ -27,16 +27,16 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtGUIApplication -- initWithQCoreApplication: (QCoreApplication *)qCoreApplication +- (instancetype)initWithQCoreApplication: (QCoreApplication *)qCoreApplication { OF_INVALID_INIT_METHOD } -- initWithQGuiApplication: (QGuiApplication *)qGuiApplication +- (instancetype)initWithQGuiApplication: (QGuiApplication *)qGuiApplication { return [super initWithQCoreApplication: qGuiApplication]; } - (QGuiApplication *)qGuiApplication Index: src/QtGui/QtPaintDevice.h ================================================================== --- src/QtGui/QtPaintDevice.h +++ src/QtGui/QtPaintDevice.h @@ -51,9 +51,9 @@ namespace ObjQt { static OF_INLINE QPaintDevice * toQt(id paintDevice) { - return [paintDevice qPaintDevice]; + return paintDevice.qPaintDevice; } } Index: src/QtGui/QtPaintDevice.mm ================================================================== --- src/QtGui/QtPaintDevice.mm +++ src/QtGui/QtPaintDevice.mm @@ -29,11 +29,11 @@ @implementation QtPaintDevice @dynamic qObject; - (QPaintDevice *)qPaintDevice { - return dynamic_cast([self qObject]); + return dynamic_cast(self.qObject); } - (int)colorCount { return toQt(self)->colorCount(); Index: src/QtWidgets/QtAbstractButton.h ================================================================== --- src/QtWidgets/QtAbstractButton.h +++ src/QtWidgets/QtAbstractButton.h @@ -37,12 +37,12 @@ @property (nonatomic) of_dimension_t iconSize; @property (nonatomic) QKeySequence shortcut; @property (nonatomic, copy) OFString *text; @property (readonly, nonatomic) QButtonGroup *group; -- initWithQWidget: (QWidget *)qWidget OF_UNAVAILABLE; -- initWithQAbstractButton: (QAbstractButton *)qAbstractButton +- (instancetype)initWithQWidget: (QWidget *)qWidget OF_UNAVAILABLE; +- (instancetype)initWithQAbstractButton: (QAbstractButton *)qAbstractButton OF_DESIGNATED_INITIALIZER; @end namespace ObjQt { @@ -57,9 +57,9 @@ } static OF_INLINE QAbstractButton * toQt(QtAbstractButton *abstractButton) { - return [abstractButton qAbstractButton]; + return abstractButton.qAbstractButton; } } Index: src/QtWidgets/QtAbstractButton.mm ================================================================== --- src/QtWidgets/QtAbstractButton.mm +++ src/QtWidgets/QtAbstractButton.mm @@ -27,16 +27,16 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtAbstractButton -- initWithQWidget: (QWidget *)qWidget +- (instancetype)initWithQWidget: (QWidget *)qWidget { OF_INVALID_INIT_METHOD } -- initWithQAbstractButton: (QAbstractButton *)qAbstractButton +- (instancetype)initWithQAbstractButton: (QAbstractButton *)qAbstractButton { return [super initWithQWidget: qAbstractButton]; } - (QAbstractButton *)qAbstractButton Index: src/QtWidgets/QtAction.h ================================================================== --- src/QtWidgets/QtAction.h +++ src/QtWidgets/QtAction.h @@ -45,15 +45,15 @@ @property (copy, nonatomic) OFString *toolTip; @property (nonatomic, getter=isVisible) bool visible; @property (copy, nonatomic) OFString *whatsThis; @property (readonly, nonatomic) OFArray OF_GENERIC(QtWidget *) *associatedWidgets; - @property (nonatomic, setter=setSeparator:) bool isSeparator; +@property (nonatomic, setter=setSeparator:) bool isSeparator; @property (readonly, nonatomic) QtWidget *parentWidget; -- initWithQObject: (QObject *)qObject OF_UNAVAILABLE; -- initWithQAction: (QAction *)qAction OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; +- (instancetype)initWithQAction: (QAction *)qAction OF_DESIGNATED_INITIALIZER; - (QActionGroup *)actionGroup; - (void)activate: (QAction::ActionEvent)event; - (QList)associatedGraphicsWidgets; - (QVariant)data; - (QMenu *)menu; @@ -77,9 +77,9 @@ } static OF_INLINE QAction * toQt(QtAction *action) { - return [action qAction]; + return action.qAction; } } Index: src/QtWidgets/QtAction.mm ================================================================== --- src/QtWidgets/QtAction.mm +++ src/QtWidgets/QtAction.mm @@ -26,16 +26,16 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtAction -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } -- initWithQAction: (QAction *)qAction +- (instancetype)initWithQAction: (QAction *)qAction { return [super initWithQObject: qAction]; } - (QAction *)qAction Index: src/QtWidgets/QtApplication.h ================================================================== --- src/QtWidgets/QtApplication.h +++ src/QtWidgets/QtApplication.h @@ -34,12 +34,14 @@ @property (nonatomic) int startDragDistance; @property (nonatomic) int startDragTime; @property (nonatomic, copy) OFString *styleSheet; @property (nonatomic) int wheelScrollLines; -- initWithQGuiApplication: (QGuiApplication *)qGuiApplication OF_UNAVAILABLE; -- initWithQApplication: (QApplication *)qApplication OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithQGuiApplication: (QGuiApplication *)qGuiApplication + OF_UNAVAILABLE; +- (instancetype)initWithQApplication: (QApplication *)qApplication + OF_DESIGNATED_INITIALIZER; - (void)aboutQt; - (void)closeAllWindows; @end namespace ObjQt { @@ -55,9 +57,9 @@ } static OF_INLINE QApplication * toQt(QtApplication *application) { - return [application qApplication]; + return application.qApplication; } } Index: src/QtWidgets/QtApplication.mm ================================================================== --- src/QtWidgets/QtApplication.mm +++ src/QtWidgets/QtApplication.mm @@ -27,16 +27,16 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtApplication -- initWithQGuiApplication: (QGuiApplication *)qGuiApplication +- (instancetype)initWithQGuiApplication: (QGuiApplication *)qGuiApplication { OF_INVALID_INIT_METHOD } -- initWithQApplication: (QApplication *)qApplication +- (instancetype)initWithQApplication: (QApplication *)qApplication { return [super initWithQGuiApplication: qApplication]; } - (QApplication *)qApplication Index: src/QtWidgets/QtGraphicsWidget.h ================================================================== --- src/QtWidgets/QtGraphicsWidget.h +++ src/QtWidgets/QtGraphicsWidget.h @@ -50,12 +50,12 @@ @property (readonly, nonatomic) bool isActiveWindow; @property (nonatomic) QStyle *style; @property (readonly, nonatomic) of_rectangle_t windowFrameGeometry; @property (readonly, nonatomic) of_rectangle_t windowFrameRect; -- initWithQObject: (QObject *)qObject OF_UNAVAILABLE; -- initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget +- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; +- (instancetype)initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget OF_DESIGNATED_INITIALIZER; - (void)addAction: (QtAction *)action; - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions; - (void)adjustSize; - (QtGraphicsWidget *)focusWidget; @@ -105,9 +105,9 @@ } static OF_INLINE QGraphicsWidget * toQt(QtGraphicsWidget *graphicsWidget) { - return [graphicsWidget qGraphicsWidget]; + return graphicsWidget.qGraphicsWidget; } } Index: src/QtWidgets/QtGraphicsWidget.mm ================================================================== --- src/QtWidgets/QtGraphicsWidget.mm +++ src/QtWidgets/QtGraphicsWidget.mm @@ -31,23 +31,23 @@ @implementation QtGraphicsObject @end @implementation QtGraphicsWidget -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } -- initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget +- (instancetype)initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget { return [super initWithQObject: qGraphicsWidget]; } - (QGraphicsWidget *)qGraphicsWidget { - return dynamic_cast([self qObject]); + return dynamic_cast(self.qObject); } - (bool)autoFillBackground { return toQt(self)->autoFillBackground(); Index: src/QtWidgets/QtPushButton.h ================================================================== --- src/QtWidgets/QtPushButton.h +++ src/QtWidgets/QtPushButton.h @@ -31,15 +31,17 @@ @property (nonatomic) QMenu *menu; @property (nonatomic) bool autoDefault; @property (nonatomic, getter=isDefault, setter=setDefault:) bool default_; @property (nonatomic, getter=isFlat) bool flat; -- initWithQAbstractButton: (QAbstractButton *)qAbstractButton OF_UNAVAILABLE; -- initWithQPushButton: (QPushButton *)qPushButton OF_DESIGNATED_INITIALIZER; -- initWithText: (OFString *)text; -- initWithIcon: (QIcon)icon - text: (OFString *)text; +- (instancetype)initWithQAbstractButton: (QAbstractButton *)qAbstractButton + OF_UNAVAILABLE; +- (instancetype)initWithQPushButton: (QPushButton *)qPushButton + OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithText: (OFString *)text; +- (instancetype)initWithIcon: (QIcon)icon + text: (OFString *)text; @end namespace ObjQt { static OF_INLINE QtPushButton * @@ -53,9 +55,9 @@ } static OF_INLINE QPushButton * toQt(QtPushButton *pushButton) { - return [pushButton qPushButton]; + return pushButton.qPushButton; } } Index: src/QtWidgets/QtPushButton.mm ================================================================== --- src/QtWidgets/QtPushButton.mm +++ src/QtWidgets/QtPushButton.mm @@ -28,21 +28,21 @@ using ObjQt::toOF; using ObjQt::toQt; @implementation QtPushButton -- initWithQAbstractButton: (QAbstractButton *)qAbstractButton +- (instancetype)initWithQAbstractButton: (QAbstractButton *)qAbstractButton { OF_INVALID_INIT_METHOD } -- initWithQPushButton: (QPushButton *)qPushButton +- (instancetype)initWithQPushButton: (QPushButton *)qPushButton { return [super initWithQAbstractButton: qPushButton]; } -- initWithText: (OFString *)text +- (instancetype)initWithText: (OFString *)text { try { self = [self initWithQPushButton: new QPushButton(toQt(text))]; @@ -54,12 +54,12 @@ [self release]; throw; } } -- initWithIcon: (QIcon)icon - text: (OFString *)text +- (instancetype)initWithIcon: (QIcon)icon + text: (OFString *)text { try { self = [self initWithQPushButton: new QPushButton(icon, toQt(text))]; Index: src/QtWidgets/QtWidget.h ================================================================== --- src/QtWidgets/QtWidget.h +++ src/QtWidgets/QtWidget.h @@ -96,12 +96,12 @@ @property (readonly, nonatomic) QtWidget *parentWidget; @property (readonly, nonatomic) QtWidget *previousInFocusChain; @property (readonly, nonatomic) QtWidget *window; @property (readonly, nonatomic) OFString *windowRole; -- initWithQObject: (QObject *)qObject OF_UNAVAILABLE; -- initWithQWidget: (QWidget *)qWidget OF_DESIGNATED_INITIALIZER; +- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; +- (instancetype)initWithQWidget: (QWidget *)qWidget OF_DESIGNATED_INITIALIZER; - (void)activateWindow; - (void)addAction: (QtAction *)action; - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions; - (void)adjustSize; - (QPalette::ColorRole)backgroundRole; @@ -236,9 +236,9 @@ } static OF_INLINE QWidget * toQt(QtWidget *widget) { - return [widget qWidget]; + return widget.qWidget; } } Index: src/QtWidgets/QtWidget.mm ================================================================== --- src/QtWidgets/QtWidget.mm +++ src/QtWidgets/QtWidget.mm @@ -38,16 +38,16 @@ { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } -- initWithQObject: (QObject *)qObject +- (instancetype)initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } -- initWithQWidget: (QWidget *)qWidget +- (instancetype)initWithQWidget: (QWidget *)qWidget { return [super initWithQObject: qWidget]; } - (QWidget *)qWidget Index: src/common/OFColor+QColor.h ================================================================== --- src/common/OFColor+QColor.h +++ src/common/OFColor+QColor.h @@ -23,13 +23,14 @@ #import #include @interface OFColor (QColor) +@property (readonly, nonatomic) QColor qColor; + + (instancetype)colorWithQColor: (const QColor &)qColor; - (instancetype)initWithQColor: (const QColor &)qColor; -- (QColor)qColor; @end namespace ObjQt { static OF_INLINE OFColor * @@ -45,9 +46,9 @@ toQt(OFColor *color) { if (color == nil) return QColor(); - return [color qColor]; + return color.qColor; } } Index: src/common/OFData+QByteArray.h ================================================================== --- src/common/OFData+QByteArray.h +++ src/common/OFData+QByteArray.h @@ -23,13 +23,14 @@ #import #include @interface OFData (QByteArray) +@property (readonly, nonatomic) QByteArray qByteArray; + + (instancetype)dataWithQByteArray: (const QByteArray &)qByteArray; - (instancetype)initWithQByteArray: (const QByteArray &)qByteArray; -- (QByteArray)qByteArray; @end namespace ObjQt { static OF_INLINE OFData * @@ -45,9 +46,9 @@ toQt(OFData *data) { if (data == nil) return QByteArray(); - return [data qByteArray]; + return data.qByteArray; } } Index: src/common/OFData+QByteArray.mm ================================================================== --- src/common/OFData+QByteArray.mm +++ src/common/OFData+QByteArray.mm @@ -34,9 +34,8 @@ count: qByteArray.count()]; } - (QByteArray)qByteArray { - return QByteArray((const char *)[self items], - [self count] * [self itemSize]); + return QByteArray((const char *)self.items, self.count * self.itemSize); } @end Index: src/common/OFString+QString.h ================================================================== --- src/common/OFString+QString.h +++ src/common/OFString+QString.h @@ -23,13 +23,14 @@ #import #include @interface OFString (QString) +@property (readonly, nonatomic) QString qString; + + (instancetype)stringWithQString: (const QString &)qString; - (instancetype)initWithQString: (const QString &)qString; -- (QString)qString; @end namespace ObjQt { static OF_INLINE OFString * @@ -45,9 +46,9 @@ toQt(OFString *string) { if (string == nil) return QString(); - return [string qString]; + return string.qString; } } Index: src/common/OFString+QString.mm ================================================================== --- src/common/OFString+QString.mm +++ src/common/OFString+QString.mm @@ -41,11 +41,11 @@ { 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); return ret; }