System freezes while rotating the geometry in QT

Hi all!!
I’m super new to Geant4 Simulation. I’m learning by watching a YouTube tutorial. I’m just making a simple box with some simple physics with it. While running that program in visualisation software my laptop freezes. I can’t rotate that plot. When I try to run an example (exampleB1) provided by Geant4 official it runs smoothly. So I guess something is wrong with my code maybe.

#include <iostream>
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VisManager.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"

#include "construction.hh"
#include "physics.hh"

int main(int argc, char** argv)
{

	G4RunManager *runManager = new G4RunManager();
	runManager->SetUserInitialization(new MyDetectorConstruction());
	runManager->SetUserInitialization(new MyPhysicsList());
	
	runManager->Initialize();

	G4UIExecutive *ui = new G4UIExecutive(argc, argv);

	G4VisManager *visManager = new G4VisExecutive();
	visManager->Initialize();
	
	G4UImanager *UImanager = G4UImanager::GetUIpointer();
	UImanager->ApplyCommand("/vis/open OGL");
	UImanager->ApplyCommand("/vis/viewer/set/viewpointVector 1 1 1");
	UImanager->ApplyCommand("/vis/drawVolume");
	
	ui->SessionStart();
	
	return 0;
}

Here I’m showing image how it looks.

Below I have also attached my cmake file. I have other files like physics.cc, physics.hh, construction.cc, construction.hh but forum doesn’t allow to upload more than 2 links so if it’s needed I can provide it. maybe I haven’t installed alll pre-requisites. any help will be appreciated a lot.

Thank you

CMakeLists.txt (566 Bytes)

Geant4 Version: 11.2.1
Operating System: Ubuntu 22
Compiler/Version: gcc 11.4.0
CMake Version: 3.22.1
OpenGL Version: OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.2.1-1


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.