35#include <qapplication.h>
41#ifdef G4VIS_USE_VTK_QT
42# include "QVTKOpenGLNativeWidget.h"
43# include <qsurfaceformat.h>
46#ifdef TOOLS_USE_GL_VERSION_3_2
47#if QT_VERSION < 0x060000
50 #ifndef G4VIS_USE_VTK_QT
51 #include <qsurfaceformat.h>
56G4Qt* G4Qt::instance =
nullptr;
58static G4bool QtInited =
false;
72 if (instance ==
nullptr) {
73 instance =
new G4Qt(a_argn, a_args, a_class);
78G4Qt::G4Qt(
int a_argn,
char** a_args,
char*
111 args = (
char**)
malloc(1 *
sizeof(
char*));
112 args[0] = (
char*)
malloc(10 *
sizeof(
char));
113 strncpy(args[0],
"my_app \0", 9);
116 int* p_argn = (
int*)
malloc(
sizeof(
int));
119 qApp->setAttribute(Qt::AA_UseDesktopOpenGL);
122#ifdef G4VIS_USE_VTK_QT
123 QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
126#ifdef TOOLS_USE_GL_VERSION_3_2
127 #if QT_VERSION < 0x060000
128 QGLFormat format = QGLFormat::defaultFormat();
129 format.setVersion(3,2);
130 format.setProfile(QGLFormat::CoreProfile);
131 QGLFormat::setDefaultFormat(format);
133 #ifndef G4VIS_USE_VTK_QT
134 QSurfaceFormat format = QSurfaceFormat::defaultFormat();
135 format.setVersion(3,2);
136 format.setProfile(QSurfaceFormat::CoreProfile);
137 QSurfaceFormat::setDefaultFormat(format);
142 new QApplication(*p_argn, args);
175 setlocale(LC_NUMERIC,
"C");
182 if (
this == instance) {
206 qApp->processEvents();
G4GLOB_DLL std::ostream G4cout
static G4Qt * getInstance()
void * GetEvent() override
void FlushAndWaitExecution() override
G4int GetVerboseLevel() const
static G4UImanager * GetUIpointer()
void SetMainInteractor(G4Interactor)
void SetArguments(int, char **)