Initial commit
This commit is contained in:
commit
f38ff5fbc2
18 changed files with 1016 additions and 0 deletions
53
QtCore/QtChildEvent.mm
Normal file
53
QtCore/QtChildEvent.mm
Normal file
|
@ -0,0 +1,53 @@
|
|||
#import "QtChildEvent.h"
|
||||
#import "QtObject.h"
|
||||
|
||||
@implementation QtChildEvent
|
||||
- initWithQEvent: (QEvent*)event
|
||||
{
|
||||
OF_INVALID_INIT_METHOD
|
||||
}
|
||||
|
||||
- initWithQChildEvent: (QChildEvent*)event
|
||||
{
|
||||
return [super initWithQEvent: event];
|
||||
}
|
||||
|
||||
- initWithType: (QChildEvent::Type)type
|
||||
child: (QtObject*)child
|
||||
{
|
||||
try {
|
||||
return [self initWithQChildEvent:
|
||||
new QChildEvent(type, [child qObject])];
|
||||
} catch (const std::bad_alloc &e) {
|
||||
self = [super initWithQEvent: NULL];
|
||||
[self release];
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
- (QChildEvent*)qChildEvent
|
||||
{
|
||||
return dynamic_cast<QChildEvent*>(_qEvent);
|
||||
}
|
||||
|
||||
- (bool)isAdded
|
||||
{
|
||||
return [self qChildEvent]->added();
|
||||
}
|
||||
|
||||
- (QtObject*)child
|
||||
{
|
||||
return [[[QtObject alloc]
|
||||
initWithQObject: [self qChildEvent]->child()] autorelease];
|
||||
}
|
||||
|
||||
- (bool)isPolished
|
||||
{
|
||||
return [self qChildEvent]->polished();
|
||||
}
|
||||
|
||||
- (bool)isRemoved
|
||||
{
|
||||
return [self qChildEvent]->removed();
|
||||
}
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue