How to install my own application in QUnitTest
	
	
		Hi,
I need to create an application instance (which is derived from QApplication) in a QUnitTest. This application instace require argc/argv as given in main(). 
All single test steps of the QUnitTest will use this application instance.
Are there any ideas how to arrange that?
Thanks Artschi
	 
	
	
	
		Re: How to install my own application in QUnitTest
	
	
		What is QUnitTest? Why do you want to subclass QApplication? QApplication already has support for argc and argv...
	 
	
	
	
		Re: How to install my own application in QUnitTest
	
	
		QUnitTest is the Qt's UnitTest framework, right? And it is definitly not my problem, if it is a good decission to subclass QApplication. That is given to me.
To be more precise: 
There is a
     class XApplication : public QApplication 
that has to be instantiated at the very beginning of main() in the same way as a QApplication instance has to be created:
    main(int argc, char *argv[]) {
        Xapplication  appl(argc, argv);
        // ...
    }
In the Qt UnitTest framework the main() is not accessable and the question is:
 How to create an XAppliation instance in the Qt UnitTest application.
	 
	
	
	
		Re: How to install my own application in QUnitTest
	
	
		
	Quote:
	
		
		
			
				Originally Posted by Artschi
				
			
			QUnitTest is the Qt's UnitTest framework, right?
			
		
	 
 You mean QTestLib?
 
	Quote:
	
		
		
			In the Qt UnitTest framework the main() is not accessable and the question is:
 How to create an XAppliation instance in the Qt UnitTest application.
			
		
	
 This is not true. You may skip using QTEST_MAIN() macro and implement your own main(). The macro is only for convenience. It is defined as:
	Code:
	
#define QTEST_MAIN(TestObject) \
int main(int argc, char *argv[]) \
{ \
    TestObject tc; \
    return QTest::qExec(&tc, argc, argv); \
}