QtApplicationHandler.cpp
Go to the documentation of this file.
1 // ****************************************************************************
2 // Filename: QtApplicationHandler.cpp
3 // Author: Florian Hecht
4 // Date: 2008
5 // ****************************************************************************
6 
7 
8 #include "QtApplicationHandler.h"
9 
10 #include <qapplication.h>
11 
12 static char app_name[] = "IVT_APPLICATION\0";
13 static int my_argc = 1;
14 static char *my_argv[2] = { app_name, NULL};
15 
17 
19 {
20  m_pApplication = 0;
21  m_bExit = false;
22 
23  if (argc == 0 && argv == NULL)
24  {
25  m_pApplication = new QApplication(my_argc, my_argv);
26  }
27  else
28  {
29  my_argc = argc;
30  m_pApplication = new QApplication(my_argc, argv);
31  }
32 
33  m_pApplication->connect(m_pApplication, SIGNAL(lastWindowClosed()), this, SLOT(Exit()));
34 
36 
37  // undo the setting of the locale by Qt
38  // this makes dialogs appear in english on any system
39  // but it doesn't screw with sscanf and fscanf, which
40  // is more important to us
41  setlocale(LC_ALL, "C");
42 }
43 
45 {
46  if (m_pApplication)
47  delete m_pApplication;
48 
50 }
51 
53 {
54  #ifdef QT_THREAD_SUPPORT
55 
56  m_pApplication->lock();
57  m_pApplication->processEvents();
58  m_pApplication->unlock();
59 
60  #else
61 
62  m_pApplication->processEvents();
63 
64  #endif
65 
66  return m_bExit;
67 }
68 
70 {
71  if (!m_pApplication)
72  {
73  m_pApplication = new QApplication(my_argc, my_argv);
74  m_pApplication->connect(m_pApplication, SIGNAL(lastWindowClosed()), this, SLOT(Exit()));
75  }
76 
77  m_bExit = false;
78 }
static CQtApplicationHandler * m_pQtApplicationHandler
static int my_argc
CQtApplicationHandler(int argc=0, char **argv=0)
static char * my_argv[2]
static char app_name[]


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28