[Interest] emitting signals from UIApplication app delegate?

Nuno Santos nunosantos at imaginando.pt
Wed Feb 24 17:38:30 CET 2016


Jason,

A signal is a function. You just need to call it.

But first you need to have a valid object to call it.

Nuno

Em 24/02/2016 16:17, Jason H escreveu:
> I want a QObject class to emit a signal when a function in my app delegate is invoked. (Code follows) How can I do that? I don't know how to use QObjects in ObjectiveC
>
> --- PlatformShimImpl.cpp
> PlatformShimImpl::PlatformShimImpl(){
> 	qDebug() << Q_FUNC_INFO;
> 	QtAppDelegate *appDelegate = (QtAppDelegate *)[[UIApplication sharedApplication] delegate];
> 	[[UIApplication sharedApplication] setDelegate:[QtAppDelegate sharedQtAppDelegate]];
> 	//[[QtAppDelegate sharedQtAppDelegate] setWindow:appDelegate.window];
> }
>
>
> --- QtAppDelegate.mm
> - (void)applicationWillResignActive:(UIApplication *)application
> {
> 	[application setIdleTimerDisabled:NO];
> 	// emit resignActive()
> }
>
>
> Many thanks.
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list