Differences From Artifact [d103de14ea]:
- File QtCore/QtObject.mm — part of check-in [d43a881019] at 2017-04-15 02:16:34 on branch trunk — Add QtAction and add more methods to QtWidget (user: js, size: 5469) [annotate] [blame] [check-ins using]
To Artifact [c04c6365a3]:
- File QtCore/QtObject.mm — part of check-in [3ece549448] at 2017-04-15 17:18:52 on branch trunk — Make toOF/toQt more powerful and complete QtWidget (user: js, size: 5128) [annotate] [blame] [check-ins using]
- File
src/QtCore/QtObject.mm
— part of check-in
[baf52ea3b1]
at
2017-04-17 23:25:45
on branch trunk
— Add a proper build system
Also lowers the minimum required Qt version to 5.5. (user: js, size: 5128) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtObject.h" #import "QtEvent.h" #import "QtThread.h" | | | > > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtObject.h" #import "QtEvent.h" #import "QtThread.h" #import "OFString+QString.h" #import "OFDataArray+QByteArray.h" #include <QVariant> using ObjQt::toOF; using ObjQt::toQt; @implementation QtObject @synthesize qObject = _qObject; - init { OF_INVALID_INIT_METHOD |
︙ | ︙ | |||
84 85 86 87 88 89 90 | { const QObjectList &qChildren = _qObject->children(); OFMutableArray *children = [OFMutableArray arrayWithCapacity: qChildren.count()]; void *pool = objc_autoreleasePoolPush(); for (QObject *qChild: qChildren) | | < | | | | | | | < < | < | < | | | | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | { const QObjectList &qChildren = _qObject->children(); OFMutableArray *children = [OFMutableArray arrayWithCapacity: qChildren.count()]; void *pool = objc_autoreleasePoolPush(); for (QObject *qChild: qChildren) [children addObject: toOF(qChild)]; [children makeImmutable]; objc_autoreleasePoolPop(pool); return children; } - (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 { return _qObject->disconnect([signal UTF8String], toQt(receiver), [method UTF8String]); } - (bool)disconnectAllSignalsForReceiver: (QtObject*)receiver method: (OFString*)method { return _qObject->disconnect(toQt(receiver), [method UTF8String]); } - (void)dumpObjectInfo { _qObject->dumpObjectInfo(); } - (void)dumpObjectTree { _qObject->dumpObjectTree(); } - (OFArray OF_GENERIC(OFDataArray*)*)dynamicPropertyNames { const QList<QByteArray> &dynamicPropertyNames = _qObject->dynamicPropertyNames(); OFMutableArray *ret = [OFMutableArray arrayWithCapacity: dynamicPropertyNames.count()]; void *pool = objc_autoreleasePoolPush(); for (const QByteArray &dynamicPropertyName: dynamicPropertyNames) [ret addObject: toOF(dynamicPropertyName)]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (bool)handleEvent: (QtEvent*)event { return _qObject->event(toQt(event)); } - (bool)filterEvent: (QtEvent*)event forObject: (QtObject*)watched { return _qObject->eventFilter(toQt(watched), toQt(event)); } - (bool)inheritsClassWithName: (OFString*)className { return _qObject->inherits([className UTF8String]); } - (void)installEventFilter: (QtObject*)filterObj { _qObject->installEventFilter(toQt(filterObj)); } - (bool)isWidgetType { return _qObject->isWidgetType(); } |
︙ | ︙ | |||
192 193 194 195 196 197 198 | - (const QMetaObject*)metaObject { return _qObject->metaObject(); } - (void)moveToThread: (QtThread*)targetThread { | | < | | | | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - (const QMetaObject*)metaObject { return _qObject->metaObject(); } - (void)moveToThread: (QtThread*)targetThread { _qObject->moveToThread(toQt(targetThread)); } - (QtObject*)parent { return toOF(_qObject->parent()); } - (void)setParent: (QtObject*)parent { _qObject->setParent(toQt(parent)); } - (QVariant)propertyForName: (OFString*)name { return _qObject->property([name UTF8String]); } - (void)removeEventFilter: (QtObject*)obj { _qObject->removeEventFilter(toQt(obj)); } - (bool)setProperty: (QVariant&)value forName: (OFString*)name { return _qObject->setProperty([name UTF8String], value); } |
︙ | ︙ | |||
235 236 237 238 239 240 241 | type: (Qt::TimerType)type { return _qObject->startTimer(interval, type); } - (QtThread*)thread { | < | | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | type: (Qt::TimerType)type { return _qObject->startTimer(interval, type); } - (QtThread*)thread { return toOF(_qObject->thread()); } - (void)deleteLater { OF_ENSURE(!_ownsObject); _qObject->deleteLater(); } @end |