ObjQt  QtChildEvent.mm at [e9fd43644a]

File QtCore/QtChildEvent.mm artifact 3e5461799b part of check-in e9fd43644a


#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