Problem 1097 - OGLXQt does not work on Qt 4.5
Summary: OGLXQt does not work on Qt 4.5
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization/OpenGL (show other problems)
Version: 9.3
Hardware: All All
: P3 normal
Assignee: garnier
URL:
Depends on:
Blocks:
 
Reported: 2010-01-19 07:45 CET by Koichi Murakami
Modified: 2011-02-23 18:00 CET (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Koichi Murakami 2010-01-19 07:45:46 CET
OGL(I/S)Qt visualization does not work on Qt 4.5. (my linux is openSUSE 11.2)
I believe it worked on Qt 4.4. 

There are some information that the OpenGL rendering  was  drastically changed in Qt 4.5.
I guess it affects the malfunction.

The problem is desired to be resolved.
Comment 1 Gabriele Cosmo 2010-01-19 10:40:24 CET
Qt (Qt-4.6) does not work on Snow-Leopard either in release 9.3.
Example N03 crashes if the visTutor macros 14 or 15 are executed at startup as arguments to the application; while it produces an empty blank render window if executed from the prompt with '/control/execute' UI command.
Comment 2 garnier 2010-01-19 17:45:11 CET
(In reply to comment #0)
> OGL(I/S)Qt visualization does not work on Qt 4.5. (my linux is openSUSE 11.2)
> I believe it worked on Qt 4.4. 
> 
> There are some information that the OpenGL rendering  was  drastically changed
> in Qt 4.5.
> I guess it affects the malfunction.
> 
> The problem is desired to be resolved.

What is your configuration ? geant4.9.3 ? 
What do you mean by "drastically changed"? Do you have some examples ?


(In reply to comment #1)
> Qt (Qt-4.6) does not work on Snow-Leopard either in release 9.3.
> Example N03 crashes if the visTutor macros 14 or 15 are executed at startup as
> arguments to the application; while it produces an empty blank render window if
> executed from the prompt with '/control/execute' UI command.

visTutor macro 15 works fine for me (mac 10.6 with Qt4.6). It does not crash, but return to quickly to prompt after reading macro file (nothing wrong from my point of view). try to add "/vis/ogl/printEPS" at end of script, you will see your detector.
Comment 3 Gabriele Cosmo 2010-01-20 16:26:30 CET
The kind of crash I get on the Mac is the following:

  :
  :
You have successfully registered the following graphics systems.
Current available graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRep (HepRepXML)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML1FILE (VRML1FILE)
  VRML2FILE (VRML2FILE)
  gMocrenFile (gMocrenFile)
  FukuiRenderer (DAWN)
  OpenGLImmediateX (OGLIX)
  OpenGLStoredX (OGLSX)
  OpenGLImmediateXm (OGLIXm)
  OpenGLStoredXm (OGLSXm)
  OpenGLImmediateQt (OGLIQt)
  OpenGLStoredQt (OGLSQt)
  OpenInventorXt (OIX)
  RayTracerX (RayTracerX)
  VRML1 (VRML1)
  VRML2 (VRML2)

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByCharge
  drawByParticleID
  drawByOriginVolume
  drawByAttribute

Registered filter factories:
  chargeFilter
  particleFilter
  originVolumeFilter
  attributeFilter

Segmentation fault
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   ???                           	000000000000000000 0 + 0
1   libG4OpenGL.dylib             	0x00000001001401d8 G4OpenGLStoredQtViewer::initializeGL() + 24
2   QtOpenGL                      	0x0000000102e12194 QGLWidget::glInit() + 68
3   QtOpenGL                      	0x0000000102e0e5fc QGLWidget::resizeEvent(QResizeEvent*) + 156
4   QtGui                         	0x00000001022ce4a6 QWidget::event(QEvent*) + 1990
5   QtOpenGL                      	0x0000000102e13752 QGLWidget::event(QEvent*) + 82
6   QtGui                         	0x000000010227688d QApplicationPrivate::notify_helper(QObject*, QEvent*) + 189
7   QtGui                         	0x000000010227d064 QApplication::notify(QObject*, QEvent*) + 1284
8   QtCore                        	0x0000000101f5b4cc QCoreApplication::notifyInternal(QObject*, QEvent*) + 124
9   QtGui                         	0x00000001022c76a7 QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) + 487
  :
  :

This happens if the macro is executed at startup, i.e. with:

$ exampleN03 visTutor/exN03Vis15.mac

Adding the command you mention makes no difference, since the problem happens at initialisation of the graphics driver, I believe...
My Qt installation has been made building from the source code of Qt-4.6 in 64 bits mode, using the following setup:
  ./configure -prefix=/opt/local -cocoa
  make
Comment 4 Koichi Murakami 2010-01-21 09:14:33 CET
Sorry. 

I have some confusion.

The combination of QtUI + OGL(I/S)Qt works fine with any versions of Qt (3.3/4.4/4.5).

But the combination of Terminal(TCSH) + OGL(I/S) Qt does not work. 

As Gabriele reports, a transparent window with tracks opens for OGLSQt,
nothing happens for OGLIQt with Qt4, or a program crashes with Qt3.

I suppose that the combination (terminal + OGLQt) is not supported so far.

I wish the support for that usage.
Comment 5 Gabriele Cosmo 2010-01-21 10:05:49 CET
I confirm that by leaving only G4UI_USE_QT set, and -unsetting- G4UI_USE_TCSH, G4UI_USE_XM and G4UI_USE_XAW, exampleN03 works fine when the visTutor macro is invoked from the prompt (i.e. with '/control/execute' command from the UI shell).
However, it still crashes with the same crash if the macro is given as argument to the application.
Comment 6 garnier 2010-01-21 10:32:01 CET
> But the combination of Terminal(TCSH) + OGL(I/S) Qt does not work. 
> 
> As Gabriele reports, a transparent window with tracks opens for OGLSQt,
> nothing happens for OGLIQt with Qt4, or a program crashes with Qt3.
> 
> I suppose that the combination (terminal + OGLQt) is not supported so far.
> 
> I wish the support for that usage.

UI Terminal with S/I Qt Vis should not crash but will not work as you think. When launching a Vis with Qt, in order to display and interact with Qt, you should be IN the Qt main loop. But if you have a "terminal" UI, you will be block on prompt, then you could not have a Qt vis BUT it should not crash...
Two ways to avoid that :
 - Hard code some cases and do nothing for this case, and mention it in the doc
 - Change the "getline" method in "terminal" in order to be NON BLOCKING
Comment 7 Gabriele Cosmo 2010-01-21 12:17:09 CET
More details about trials on N03 on Mac ...
- Having only G4VIS_USE_OPENGLQT and G4UI_USE_QT set in the
   environment for vis and UI; by changing to OGLIQt (or OGLSQt)
   in vis.mac and executing (from examples/novice/N03):
       $ exampleN03
   leads to the crash I reported.
- Having -also- G4VIS_USE_OPENGLX set as vis driver (and leaving
   vis.mac unchanged); by executing vistTutor/exN03Vis14.mac
   (or exN03Vis15.mac), the Qt GL render window opens and the
   detector is displayed; however no tracks are visualized when
   issuing /run/beamOn, even if I issue refreshing...
Comment 8 Gabriele Cosmo 2010-01-21 12:30:35 CET
Tracks (but not markers!?) are visualized only if the following statements
are added to the exN03Vis14.mac (or exN03Vis15.mac) before
'/control/verbose 2', as it is in vis.mac:

/vis/scene/add/trajectories smooth
/vis/modeling/trajectories/create/drawByCharge
/vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
/vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
/vis/scene/endOfEventAction accumulate

Macros should be corrected!
Comment 9 garnier 2011-02-23 18:00:49 CET
fixed