iOS: Use qFatal when detecting QApplication before UIApplicationMain
Gives a stack-trace at the point the error was caused, making it easier to debug what's going on. Change-Id: I0d65bb5061e9a97c142d41f6c99a1a1803cbe82d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
b0182069e5
commit
ddf09adeeb
@ -69,12 +69,10 @@ QIOSIntegration::QIOSIntegration()
|
|||||||
, m_accessibility(0)
|
, m_accessibility(0)
|
||||||
{
|
{
|
||||||
if (![UIApplication sharedApplication]) {
|
if (![UIApplication sharedApplication]) {
|
||||||
qWarning()
|
qFatal("Error: You are creating QApplication before calling UIApplicationMain.\n" \
|
||||||
<< "Error: You are creating QApplication before calling UIApplicationMain.\n"
|
"If you are writing a native iOS application, and only want to use Qt for\n" \
|
||||||
<< "If you are writing a native iOS application, and only want to use Qt for\n"
|
"parts of the application, a good place to create QApplication is from within\n" \
|
||||||
<< "parts of the application, a good place to create QApplication is from within\n"
|
"'applicationDidFinishLaunching' inside your UIApplication delegate.\n");
|
||||||
<< "'applicationDidFinishLaunching' inside your UIApplication delegate.\n";
|
|
||||||
exit(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set current directory to app bundle folder
|
// Set current directory to app bundle folder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user