C++ (Qt)class Thread : public QThread{private: int m_argc; char ** m_argv; public: Thread ( int argc, char ** argv ) : m_argc( argc ) , m_argv( argv ) { } protected: virtual void run () { QApplication app( m_argc, m_argv ); QWidget widget; widget.show(); app.exec(); }}; // Начало приложенияint main ( int narg, char ** varg ){ Thread thread( narg, varg ); thread.start(); thread.wait(); return 0;}