Use dot syntax
This commit is contained in:
parent
e5a0058952
commit
5b48e3eb1e
31 changed files with 98 additions and 90 deletions
|
@ -31,10 +31,11 @@
|
|||
@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 {
|
||||
|
@ -52,7 +53,7 @@ toOF(QChildEvent *qChildEvent)
|
|||
static OF_INLINE QChildEvent *
|
||||
toQt(QtChildEvent *childEvent)
|
||||
{
|
||||
return [childEvent qChildEvent];
|
||||
return childEvent.qChildEvent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,18 +27,18 @@ 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:
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
@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;
|
||||
|
@ -55,7 +55,7 @@ toOF(QCoreApplication *qCoreApplication)
|
|||
static OF_INLINE QCoreApplication *
|
||||
toQt(QtCoreApplication *coreApplication)
|
||||
{
|
||||
return [coreApplication qCoreApplication];
|
||||
return coreApplication.qCoreApplication;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ 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];
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
@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
|
||||
|
@ -58,7 +58,7 @@ toOF(QEvent *qEvent)
|
|||
static OF_INLINE QEvent *
|
||||
toQt(QtEvent *event)
|
||||
{
|
||||
return [event qEvent];
|
||||
return event.qEvent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
return QEvent::registerEventType(hint);
|
||||
}
|
||||
|
||||
- init
|
||||
- (instancetype)init
|
||||
{
|
||||
OF_INVALID_INIT_METHOD
|
||||
}
|
||||
|
||||
- initWithQEvent: (QEvent *)qEvent
|
||||
- (instancetype)initWithQEvent: (QEvent *)qEvent
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
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
|
||||
|
@ -97,7 +97,7 @@ toOF(QObject *qObject)
|
|||
static OF_INLINE QObject *
|
||||
toQt(QtObject *object)
|
||||
{
|
||||
return [object qObject];
|
||||
return object.qObject;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,12 +34,12 @@ 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];
|
||||
|
||||
|
@ -106,21 +106,21 @@ using ObjQt::toQt;
|
|||
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
|
||||
|
@ -164,7 +164,7 @@ using ObjQt::toQt;
|
|||
|
||||
- (bool)inheritsClassWithName: (OFString *)className
|
||||
{
|
||||
return _qObject->inherits([className UTF8String]);
|
||||
return _qObject->inherits(className.UTF8String);
|
||||
}
|
||||
|
||||
- (void)installEventFilter: (QtObject *)filterObj
|
||||
|
@ -209,7 +209,7 @@ using ObjQt::toQt;
|
|||
|
||||
- (QVariant)propertyForName: (OFString *)name
|
||||
{
|
||||
return _qObject->property([name UTF8String]);
|
||||
return _qObject->property(name.UTF8String);
|
||||
}
|
||||
|
||||
- (void)removeEventFilter: (QtObject *)obj
|
||||
|
@ -220,7 +220,7 @@ using ObjQt::toQt;
|
|||
- (bool)setProperty: (QVariant &)value
|
||||
forName: (OFString *)name
|
||||
{
|
||||
return _qObject->setProperty([name UTF8String], value);
|
||||
return _qObject->setProperty(name.UTF8String, value);
|
||||
}
|
||||
|
||||
- (bool)signalsBlocked
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
@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;
|
||||
|
@ -59,7 +59,7 @@ toOF(QThread *qThread)
|
|||
static OF_INLINE QThread *
|
||||
toQt(QtThread *thread)
|
||||
{
|
||||
return [thread qThread];
|
||||
return thread.qThread;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
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];
|
||||
}
|
||||
|
|
|
@ -38,8 +38,9 @@
|
|||
@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;
|
||||
|
@ -61,7 +62,7 @@ toOF(QGuiApplication *qGuiApplication)
|
|||
static OF_INLINE QGuiApplication *
|
||||
toQt(QtGUIApplication *GUIApplication)
|
||||
{
|
||||
return [GUIApplication qGuiApplication];
|
||||
return GUIApplication.qGuiApplication;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,12 +29,12 @@ 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];
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ObjQt {
|
|||
static OF_INLINE QPaintDevice *
|
||||
toQt(id <QtPaintDevice> paintDevice)
|
||||
{
|
||||
return [paintDevice qPaintDevice];
|
||||
return paintDevice.qPaintDevice;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ using ObjQt::toQt;
|
|||
|
||||
- (QPaintDevice *)qPaintDevice
|
||||
{
|
||||
return dynamic_cast<QPaintDevice *>([self qObject]);
|
||||
return dynamic_cast<QPaintDevice *>(self.qObject);
|
||||
}
|
||||
|
||||
- (int)colorCount
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
@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
|
||||
|
||||
|
@ -59,7 +59,7 @@ toOF(QAbstractButton *qAbstractButton)
|
|||
static OF_INLINE QAbstractButton *
|
||||
toQt(QtAbstractButton *abstractButton)
|
||||
{
|
||||
return [abstractButton qAbstractButton];
|
||||
return abstractButton.qAbstractButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,12 +29,12 @@ 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];
|
||||
}
|
||||
|
|
|
@ -47,11 +47,11 @@
|
|||
@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<QGraphicsWidget *>)associatedGraphicsWidgets;
|
||||
|
@ -79,7 +79,7 @@ toOF(QAction *qAction)
|
|||
static OF_INLINE QAction *
|
||||
toQt(QtAction *action)
|
||||
{
|
||||
return [action qAction];
|
||||
return action.qAction;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,12 +28,12 @@ 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];
|
||||
}
|
||||
|
|
|
@ -36,8 +36,10 @@
|
|||
@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
|
||||
|
@ -57,7 +59,7 @@ toOF(QApplication *qApplication)
|
|||
static OF_INLINE QApplication *
|
||||
toQt(QtApplication *application)
|
||||
{
|
||||
return [application qApplication];
|
||||
return application.qApplication;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,12 +29,12 @@ 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];
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
@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;
|
||||
|
@ -107,7 +107,7 @@ toOF(QGraphicsWidget *qGraphicsWidget)
|
|||
static OF_INLINE QGraphicsWidget *
|
||||
toQt(QtGraphicsWidget *graphicsWidget)
|
||||
{
|
||||
return [graphicsWidget qGraphicsWidget];
|
||||
return graphicsWidget.qGraphicsWidget;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,19 +33,19 @@ using ObjQt::toQt;
|
|||
|
||||
@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<QGraphicsWidget *>([self qObject]);
|
||||
return dynamic_cast<QGraphicsWidget *>(self.qObject);
|
||||
}
|
||||
|
||||
- (bool)autoFillBackground
|
||||
|
|
|
@ -33,11 +33,13 @@
|
|||
@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 {
|
||||
|
@ -55,7 +57,7 @@ toOF(QPushButton *qPushButton)
|
|||
static OF_INLINE QPushButton *
|
||||
toQt(QtPushButton *pushButton)
|
||||
{
|
||||
return [pushButton qPushButton];
|
||||
return pushButton.qPushButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,17 +30,17 @@ 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:
|
||||
|
@ -56,8 +56,8 @@ using ObjQt::toQt;
|
|||
}
|
||||
}
|
||||
|
||||
- initWithIcon: (QIcon)icon
|
||||
text: (OFString *)text
|
||||
- (instancetype)initWithIcon: (QIcon)icon
|
||||
text: (OFString *)text
|
||||
{
|
||||
try {
|
||||
self = [self initWithQPushButton:
|
||||
|
|
|
@ -98,8 +98,8 @@
|
|||
@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;
|
||||
|
@ -238,7 +238,7 @@ toOF(QWidget *qWidget)
|
|||
static OF_INLINE QWidget *
|
||||
toQt(QtWidget *widget)
|
||||
{
|
||||
return [widget qWidget];
|
||||
return widget.qWidget;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ using ObjQt::toQt;
|
|||
[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];
|
||||
}
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
#include <QColor>
|
||||
|
||||
@interface OFColor (QColor)
|
||||
@property (readonly, nonatomic) QColor qColor;
|
||||
|
||||
+ (instancetype)colorWithQColor: (const QColor &)qColor;
|
||||
- (instancetype)initWithQColor: (const QColor &)qColor;
|
||||
- (QColor)qColor;
|
||||
@end
|
||||
|
||||
namespace ObjQt {
|
||||
|
@ -47,7 +48,7 @@ toQt(OFColor *color)
|
|||
if (color == nil)
|
||||
return QColor();
|
||||
|
||||
return [color qColor];
|
||||
return color.qColor;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
#include <QByteArray>
|
||||
|
||||
@interface OFData (QByteArray)
|
||||
@property (readonly, nonatomic) QByteArray qByteArray;
|
||||
|
||||
+ (instancetype)dataWithQByteArray: (const QByteArray &)qByteArray;
|
||||
- (instancetype)initWithQByteArray: (const QByteArray &)qByteArray;
|
||||
- (QByteArray)qByteArray;
|
||||
@end
|
||||
|
||||
namespace ObjQt {
|
||||
|
@ -47,7 +48,7 @@ toQt(OFData *data)
|
|||
if (data == nil)
|
||||
return QByteArray();
|
||||
|
||||
return [data qByteArray];
|
||||
return data.qByteArray;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
- (QByteArray)qByteArray
|
||||
{
|
||||
return QByteArray((const char *)[self items],
|
||||
[self count] * [self itemSize]);
|
||||
return QByteArray((const char *)self.items, self.count * self.itemSize);
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
#include <QString>
|
||||
|
||||
@interface OFString (QString)
|
||||
@property (readonly, nonatomic) QString qString;
|
||||
|
||||
+ (instancetype)stringWithQString: (const QString &)qString;
|
||||
- (instancetype)initWithQString: (const QString &)qString;
|
||||
- (QString)qString;
|
||||
@end
|
||||
|
||||
namespace ObjQt {
|
||||
|
@ -47,7 +48,7 @@ toQt(OFString *string)
|
|||
if (string == nil)
|
||||
return QString();
|
||||
|
||||
return [string qString];
|
||||
return string.qString;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
"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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue