This may turn out to be a really stupid question, but here goes anyway… I just did a successful fresh install of Geant4 v11.0.0 and I am running some of the distribution examples to make sure everything is working properly. I installed with OpenGL ON and Qt ON.
When I compiled and ran example B4a, Qt did not launch and I just got the OpenGL window with output to the terminal. (In 10.7.2 and previous versions, I got the Qt window with terminal box and OpenGL pane inside it. I expected that this time too.) I then ran example B4b and I got the Qt window with terminal box and OpenGL pane inside it as per 10.7.2. The ‘Initialize visualization’ of the main program and the init_vis.mac and vis.mac files of the two examples are identical. So what gives with B4a?
I have also run example B1, which implements Qt correctly.
I am running Fedora 35 (Linux 5.15.6-200.fc35.x86_64 #1 SMP Wed Dec 1 13:41:10 UTC 2021 x86_64 GNU/Linux).
As a final question, all the README files for the examples are missing from the distribution. Does anyone know where they are?
I am using the tarballs from the 11.0.0 download page.
I just rebuilt the example from a fresh copy of B4a from the distribution examples. When I ran it, I get the same problem. I also noticed this error (I think it was there the last time too):
That would happen if you built with both X11 and Qt but started a terminal (tcsh) session. So it is possible that, say, B1 opens with Qt but B4a opens with tcsh if, for example, exampleB4a.cc requests it or the particular environment variables in the launch directory request it or you have a line in ~/.g4session that requires it - see How to Set Up an Interactive Session — Book For Application Developers 11.2 documentation.
Good news. I got Qt to work by specifically using the -u qt option, i.e., ./exampleB4a -u qt.
So on your suggestion, I checked my ~/.g4session file and it contains:
Qt # Default session
…
exampleB4a tcsh
So that’s the problem. In 10.7.2 and previous versions of 10.x, I did not need to specify the -u option to get Qt to work automatically. I suppose somewhere along the way, I unwittingly added the exampleB4a line to the .g4session file.