Ignore:
Timestamp:
Aug 17, 2007, 5:27:44 PM (17 years ago)
Author:
garnier
Message:

r579@mac-90108: laurentgarnier | 2007-08-16 15:58:30 +0200
desormais le glWidget est accroche au mainWindow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r568 r569  
    4747
    4848#include "G4Qt.hh"
    49 #include "G4UIManager.hh"
     49#include "G4UIsession.hh"
     50#include "G4UImanager.hh"
    5051#include <QtGui/qboxlayout.h>
    5152#include <QtGui/qdialog.h>
     
    8687  //  fWindow->resize(100, 300);
    8788  glFlush ();
     89  GLWindow->show();
    8890  printf("G4OpenGLQtViewer::ShowView -----------------------\n");
    8991
     
    127129
    128130  // create window
    129   if (qApp) {
    130     GLWindow = new QDialog();//qApp->mainWidget());
     131  if (((QApplication*)interactorManager->GetMainInteractor())) {
     132    // look for the main window
     133    bool found = false;
     134    foreach (QWidget *widget, QApplication::allWidgets()) {
     135      if ((found== false) && (widget->inherits("QMainWindow"))) {
     136        GLWindow = new QDialog(widget);
     137        found = true;
     138      }
     139    }
     140    if (found==false) {
     141      GLWindow = new QDialog();
     142    }
    131143  } else {
    132144    GLWindow = new QDialog();
     
    176188{
    177189  printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n");
     190  delete GLWindow;
    178191  delete fContextMenu;   
    179192}
     
    618631
    619632void G4OpenGLQtViewer::actionCreateEPS() {
     633  //QString QFileDialog::getSaveFileName ( QWidget * parent = 0,
     634  //  const QString & caption = QString(),
     635  // const QString & dir = QString(),
     636  // const QString & filter = QString(),
     637  // QString * selectedFilter = 0, Options options = 0 )
    620638  QString nomFich = QFileDialog::getSaveFileName(GLWindow,
    621639                                                 "Choose a file",
    622                                                  ".", "Images (*.BMP *.GIF *.JPG *.JPEG *.PNG *.PBM *.PGM *.PPM *.TIFF *.XBM *.XPM)" );
     640                                                 ".", tr("Images (*.BMP *.GIF *.JPG *.JPEG *.PNG *.PBM *.PGM *.PPM *.TIFF *.XBM *.XPM)") );
    623641
    624642  if(!nomFich.endsWith(".eps")) {
Note: See TracChangeset for help on using the changeset viewer.