don't create QApplication if there is already one there
Change-Id: Iaf9ebf6855992962abfb3452dc398149af15bbbc Reviewed-on: http://codereview.qt.nokia.com/2711 Reviewed-by: Charles Yin <charles.yin@nokia.com>
This commit is contained in:
parent
5a8de45440
commit
16fc17f9eb
|
@ -110,7 +110,10 @@ static inline QString stripQuotes(const QString &s)
|
|||
|
||||
int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QApplication* app = 0;
|
||||
if (!QCoreApplication::instance()) {
|
||||
app = new QApplication(argc, argv);
|
||||
}
|
||||
|
||||
// Look for QML-specific command-line options.
|
||||
// -import dir Specify an import directory.
|
||||
|
@ -287,6 +290,7 @@ int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport
|
|||
// Flush the current logging stream.
|
||||
QuickTestResult::setProgramName(0);
|
||||
|
||||
delete app;
|
||||
// Return the number of failures as the exit code.
|
||||
return QuickTestResult::exitCode();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue