PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/os/qt/ftk_qt.cpp

http://ftk.googlecode.com/
C++ | 35 lines | 27 code | 8 blank | 0 comment | 0 complexity | a5f668857d96b1467a4e1edfecd85986 MD5 | raw file
 1
 2extern "C" {
 3#include "ftk_typedef.h"
 4}
 5#include "ftk_display_qt.h"
 6#include <QtGui/QApplication>
 7#include <QtGui/QWidget>
 8
 9extern "C" int FTK_MAIN(int argc, char* argv[]);
10
11static pthread_t thread;
12
13static void* thread_func(void* data)
14{
15	int argc = 1;
16	char* argv[] = { (char*)"ftk" };
17	FTK_MAIN(argc, argv);
18
19	QApplication::exit(0);
20	return NULL;
21}
22
23int main(int argc, char* argv[])
24{
25	int rc;
26	QApplication app(argc, argv);
27	QWidget* widget = (QWidget*)ftk_display_qt_create_win();
28	widget->show();
29
30	pthread_create(&thread, NULL, thread_func, NULL);
31	rc = app.exec();
32	pthread_join(thread, NULL);
33
34	return rc;
35}