ui/qt/toolkit.cpp

changeset 519
8884c7fbe4cb
parent 518
45ed276ba7a4
child 526
f6a6b0b08641
equal deleted inserted replaced
518:45ed276ba7a4 519:8884c7fbe4cb
43 static ui_callback open_func; 43 static ui_callback open_func;
44 void *open_data; 44 void *open_data;
45 static ui_callback exit_func; 45 static ui_callback exit_func;
46 void *exit_data; 46 void *exit_data;
47 47
48 static ui_callback appclose_fnc;
49 static void *appclose_udata;
50
51 static int is_toplevel_realized = 0; 48 static int is_toplevel_realized = 0;
52 49
53 int app_argc; 50 int app_argc;
54 char **app_argv; 51 char **app_argv;
55 QApplication *application = NULL; 52 QApplication *application = NULL;
85 exit_func = f; 82 exit_func = f;
86 exit_data = userdata; 83 exit_data = userdata;
87 } 84 }
88 85
89 void ui_main() { 86 void ui_main() {
87 if(startup_func) {
88 startup_func(NULL, startup_data);
89 }
90 application->exec(); 90 application->exec();
91 91 if(exit_func) {
92 if(appclose_fnc) { 92 exit_func(NULL, exit_data);
93 appclose_fnc(NULL, appclose_udata);
94 } 93 }
95 uic_store_app_properties(); 94 uic_store_app_properties();
96 95
97 delete application; 96 delete application;
98 } 97 }
99 98
100 void ui_show(UiObject *obj) { 99 void ui_show(UiObject *obj) {
101 //obj->widget->show(); 100 obj->widget->show();
102 } 101 }
103 102
104 void ui_close(UiObject *obj) { 103 void ui_close(UiObject *obj) {
105 QMainWindow *window = (QMainWindow*)obj->widget; 104 QMainWindow *window = (QMainWindow*)obj->widget;
106 window->close(); 105 window->close();

mercurial