Problem 1959 - stand alone qt application not working
Summary: stand alone qt application not working
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization/OpenGL (show other problems)
Version: 10.3
Hardware: Apple All
: P4 normal
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2017-03-22 14:51 CET by ungaro
Modified: 2017-03-24 19:08 CET (History)
2 users (show)

See Also:


Attachments
screenshot1 (184.04 KB, image/png)
2017-03-22 15:34 CET, ungaro
Details
screenshot 2 (209.52 KB, image/png)
2017-03-22 15:36 CET, ungaro
Details

Note You need to log in before you can comment on or make changes to this problem.
Description ungaro 2017-03-22 14:51:22 CET
Starting with 10.3 and 10.3.p01 using a 

	QApplication *app = new QApplication(argc, argv);

in main() will cause the opengl window to be non-responsive.
For example, rotating the view will take effect only after I click on another window.

This can be easily checked by adding the above line at the top of any basic example (I was working with exampleB4a.cc).

Looking forward to feedback, this is preventing me to use 10.3.X, as 10.2.X is working properly (is this maybe due to the new opengl refresh?).

Mauri
Comment 1 John.Allison 2017-03-22 15:14:07 CET
Please explain why you need to add

	QApplication *app = new QApplication(argc, argv);

Why not use - or are you also using - G4UIExecutive?
Comment 2 ungaro 2017-03-22 15:34:19 CET
Created attachment 447 [details]
screenshot1

s
Comment 3 ungaro 2017-03-22 15:36:11 CET
We are running a custom Qt-interface, thus the need of a QApplication.

I'm attaching a couple of screenshots.

This is the application website. This is used by several experiments.

https://gemc.jlab.org/gemc/html/index.html

Laurent assisted us in the past to make sure QtGUI was working properly.

Thanks,
Comment 4 ungaro 2017-03-22 15:36:48 CET
Created attachment 448 [details]
screenshot 2
Comment 5 ungaro 2017-03-22 15:40:47 CET
To answer the G4UIExecutive question: using it or not using does not affect the problem. See for example exampleB4a.cc.

Thanks,
Mauri
Comment 6 garnier 2017-03-24 17:05:43 CET
Hi Maurizio, 

I could reproduce your problem, perhaps a openGL refresh problem in Qt with an external QApp. I'll investigate.

Laurent
Comment 7 garnier 2017-03-24 17:34:06 CET
Ok, I think I've got it :

I did a change to prevent extra repaints 6 months ago (10.3 version affected, but not 10.2)

G4OpenGLQtViewer.cc, around line 4643 :

Could you try the following patch:

bool G4OpenGLQtViewer::isCurrentWidget(){

// Add theses lines ==============
  G4Qt* interactorManager = G4Qt::getInstance ();
  if (!interactorManager->IsExternalApp()) {
// End of added lines ==============

    // Prevent from repainting a hidden tab (the current tab name has to be the one of th GL viewer)
    if ( GetName() != fUiQt->GetViewerTabWidget()->tabText(fUiQt->GetViewerTabWidget()->currentIndex()).toStdString().c_str()) {
      return false;
    }


// Add theses lines ==============
  }
// End of added line ==============


  return true;
}


Laurent
Comment 8 ungaro 2017-03-24 19:08:01 CET
Laurent's patch fixed the problem, thanks!