Changeset 617


Ignore:
Timestamp:
Nov 26, 2007, 6:10:35 PM (17 years ago)
Author:
garnier
Message:

r670@mac-90108: laurentgarnier | 2007-11-26 18:13:28 +0100
mise a jour pour Qt3 linux

Location:
trunk/geant4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r615 r617  
    109109  printf("G4UIQt::Initialise %d %s\n",argc,argv[0]);
    110110#endif
    111   printf("G4UIQt::Initialise ******\n");
    112111  G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt");
    113112  G4UImanager* UI = G4UImanager::GetUIpointer();
     
    129128#endif
    130129
    131   QSplitter *splitter = new QSplitter(Qt::Vertical);
     130  QSplitter *splitter = new QSplitter(Qt::Vertical,fMainWindow);
    132131
    133132  // Set layouts
     
    488487)
    489488{
     489#ifdef GEANT4_QT_DEBUG
     490  printf("G4UIQt::AddMenu 1\n");
     491#endif
    490492  if (aName == NULL) return;
    491493  if (aLabel == NULL) return;
    492494
     495#ifdef GEANT4_QT_DEBUG
     496  printf("G4UIQt::AddMenu 2 %s %s\n",aName,aLabel);
     497#endif
    493498#if QT_VERSION < 0x040000
    494499  QPopupMenu *fileMenu = new QPopupMenu( fMainWindow);
     
    529534  QSignalMapper *signalMapper = new QSignalMapper(this);
    530535#if QT_VERSION < 0x040000
     536#if QT_VERSION < 0x030200
     537  QAction *action = new QAction(QString(aLabel),QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map()));
     538#else
    531539  QAction *action = new QAction(QString(aLabel),QKeySequence::QKeySequence (),signalMapper, SLOT(map()));
     540#endif
    532541  action->addTo(parent);
    533542#else
     
    556565#if QT_VERSION < 0x040000
    557566    fHelpDialog = new QDialog(fMainWindow,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax );
    558 #else
     567    QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog);
     568    QWidget* global = new QWidget(fHelpDialog);
     569#else
     570    QVBoxLayout *vLayout = new QVBoxLayout();
    559571    fHelpDialog = new QDialog(fMainWindow,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
    560572#endif
    561     QSplitter *splitter = new QSplitter(Qt::Horizontal);
     573    QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog);
     574
    562575    QPushButton *exitButton = new QPushButton("Exit",fMainWindow);
    563576    connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close()));
     
    574587    fHelpTreeWidget->addColumn("Command");
    575588    fHelpTreeWidget->addColumn("Description");
    576     fHelpTreeWidget->hideColumn(1);
     589    fHelpTreeWidget->setColumnWidth (1,0);
    577590    fHelpTreeWidget->header()->setResizeEnabled(FALSE,1);
    578591    //    QList<QListViewItem *> items;
     
    643656    // Set layouts
    644657
    645 #if QT_VERSION < 0x040000
    646     QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog);
    647 #else
    648     QVBoxLayout *vLayout = new QVBoxLayout;
     658#if QT_VERSION >= 0x040000
    649659    splitter->addWidget(fHelpTreeWidget);
    650660    splitter->addWidget(fHelpArea);
     
    652662
    653663
     664#if QT_VERSION < 0x040000
     665    vLayout->addWidget(global);
     666#else
    654667    vLayout->addWidget(splitter);
     668#endif
    655669    vLayout->addWidget(exitButton);
    656670#if QT_VERSION >= 0x040000
     
    11861200)
    11871201{
    1188 #ifdef GEANT4_QT_DEBUG
    1189     printf("G4UIQt::HelpTreeClicCallback");
    1190 #endif
     1202  //  printf("G4UIQt::HelpTreeClicCallback");
    11911203#if QT_VERSION < 0x040000
    11921204  QListViewItem* item =  NULL;
     
    12541266QTreeWidgetItem* item
    12551267#endif
    1256  ,int nb
     1268 ,int
    12571269)
    12581270{
  • trunk/geant4/interfaces/common/src/G4Qt.cc

    r615 r617  
    2929//
    3030// L. Garnier
    31 
    32 #define GEANT4_QT_DEBUG
    3331
    3432#if defined(G4INTY_BUILD_QT) || defined(G4INTY_USE_QT)
     
    10199#endif
    102100#if QT_VERSION < 0x040000
    103     // EN TEST    qApp = new QApplication (a_argn, a_args);
     101    qApp = new QApplication (a_argn, a_args);
    104102    //    QApplication qApp(a_argn, a_args);
    105103    //    if(&qApp == NULL) {
     
    124122  }
    125123#ifdef GEANT4_QT_DEBUG
    126   //  if (qApp) {
     124  if (qApp) {
    127125    printf("G4Qt::qApp exist\n");
    128     //  =================== EN TEST ==============
    129     new QApplication ( a_argn, a_args );
    130 
    131     QPushButton hello( "Hello world!", 0 );
    132     hello.resize( 100, 30 );
    133 
    134     qApp->setMainWidget( &hello );
    135     hello.show();
    136     qApp->exec();
    137     printf("G4Qt::qApp exist END\n");
    138     //  =================== EN TEST ==============
    139     //  }  else {
    140     //    printf("G4Qt::qApp not exist\n");
    141     //  }
     126  }  else {
     127    printf("G4Qt::qApp not exist\n");
     128  }
    142129#endif
    143130  //  AddDispatcher     ((G4DispatchFunction)XtDispatchEvent);
  • trunk/geant4/specific-geant4-dev.sh

    r610 r617  
    2727  export G4RADIOACTIVEDATA=$G4DATA/RadiativeDecay
    2828  export G4LEDATA=$G4DATA/G4EMLOW3.0
    29   export QTHOME=/usr/local/Qt/3.3.8
     29#  export QTHOME=/usr/local/Qt/3.3.8
     30  export QTHOME=/usr/local/Qt/4.2.2
    3031  #//////////////////////////////////////////////////////////
    3132  # GUI, Visualization :
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r612 r617  
    320320  Q_CHECK_PTR( mMouseAction );
    321321
     322#if QT_VERSION < 0x030200
     323  QAction *rotate = new QAction("&Rotate scene","&Rotate scene",CTRL+Key_N,mMouseAction);
     324  QAction *move =  new QAction("&Move scene","&Move scene",CTRL+Key_M,mMouseAction);
     325#else
    322326  QAction *rotate = new QAction("&Rotate scene",CTRL+Key_N,mMouseAction);
    323327  QAction *move =  new QAction("&Move scene",CTRL+Key_M,mMouseAction);
     328#endif
    324329  rotate->addTo(mMouseAction);
    325330  move->addTo(mMouseAction);
     
    344349  QPopupMenu *mRepresentation = new QPopupMenu(fContextMenu);
    345350
     351#if QT_VERSION < 0x030200
     352  QAction *polyhedron = new QAction("&Polyhedron","&Polyhedron",CTRL+Key_P,mRepresentation);
     353  QAction *nurbs = new QAction("&NURBS","&NURBS",CTRL+Key_N,mRepresentation);
     354#else
    346355  QAction *polyhedron = new QAction("&Polyhedron",CTRL+Key_P,mRepresentation);
    347356  QAction *nurbs = new QAction("&NURBS",CTRL+Key_N,mRepresentation);
     357#endif
    348358  polyhedron->addTo(mRepresentation);
    349359  nurbs->addTo(mRepresentation);
     
    488498  mStyle->insertItem("&Background color",mBackground);
    489499
     500#if QT_VERSION < 0x030200
     501  QAction *white = new QAction("&White","&White",CTRL+Key_W,mBackground);
     502  QAction *black =  new QAction("&Black","&Black",CTRL+Key_B,mBackground);
     503#else
    490504  QAction *white = new QAction("&White",CTRL+Key_W,mBackground);
    491505  QAction *black =  new QAction("&Black",CTRL+Key_B,mBackground);
     506#endif
    492507  white->addTo(mBackground);
    493508  black->addTo(mBackground);
     
    513528  fContextMenu->insertItem("&Actions",mActions);
    514529
     530#if QT_VERSION < 0x030200
     531  QAction *controlPanels = new QAction("&Control panels","&Control panels",CTRL+Key_C,mActions);
     532  QAction *exitG4 =  new QAction("&Exit to G4Vis >","&Exit to G4Vis >",CTRL+Key_E,mActions);
     533  QAction *createEPS =  new QAction("&Save as ...","&Save as ...",CTRL+Key_S,mActions);
     534#else
    515535  QAction *controlPanels = new QAction("&Control panels",CTRL+Key_C,mActions);
    516536  QAction *exitG4 =  new QAction("&Exit to G4Vis >",CTRL+Key_E,mActions);
    517537  QAction *createEPS =  new QAction("&Save as ...",CTRL+Key_S,mActions);
     538#endif
    518539  controlPanels->addTo(mActions);
    519540  exitG4->addTo(mActions);
     
    562583  mSpecial->insertItem("Transparency",mTransparency);
    563584
     585#if QT_VERSION < 0x030200
     586  QAction *transparencyOn = new QAction("&On","&On",CTRL+Key_O,mTransparency);
     587  QAction *transparencyOff = new QAction("&Off","&Off",CTRL+Key_F,mTransparency);
     588#else
    564589  QAction *transparencyOn = new QAction("&On",CTRL+Key_O,mTransparency);
    565590  QAction *transparencyOff = new QAction("&Off",CTRL+Key_F,mTransparency);
     591#endif
    566592  transparencyOn->addTo(mTransparency);
    567593  transparencyOff->addTo(mTransparency);
     
    588614  mSpecial->insertItem("Antialiasing",mAntialiasing);
    589615
     616#if QT_VERSION < 0x030200
     617  QAction *antialiasingOn = new QAction("&On","&On",CTRL+Key_O,mAntialiasing);
     618  QAction *antialiasingOff = new QAction("&Off","&Off",CTRL+Key_F,mAntialiasing);
     619#else
    590620  QAction *antialiasingOn = new QAction("&On",CTRL+Key_O,mAntialiasing);
    591621  QAction *antialiasingOff = new QAction("&Off",CTRL+Key_F,mAntialiasing);
     622#endif
    592623  antialiasingOn->addTo(mAntialiasing);
    593624  antialiasingOff->addTo(mAntialiasing);
     
    611642  mSpecial->insertItem("Haloing",mHaloing);
    612643
     644#if QT_VERSION < 0x030200
     645  QAction *haloingOn = new QAction("&On","&On",CTRL+Key_O,mHaloing);
     646  QAction *haloingOff = new QAction("&Off","&Off",CTRL+Key_F,mHaloing);
     647#else
    613648  QAction *haloingOn = new QAction("&On",CTRL+Key_O,mHaloing);
    614649  QAction *haloingOff = new QAction("&Off",CTRL+Key_F,mHaloing);
     650#endif
    615651  haloingOn->addTo(mHaloing);
    616652  haloingOff->addTo(mHaloing);
     
    632668  mSpecial->insertItem("Auxiliairy edges",mAux);
    633669
     670#if QT_VERSION < 0x030200
     671  QAction *auxOn = new QAction("&On","&On",CTRL+Key_O,mAux);
     672  QAction *auxOff = new QAction("&Off","&Off",CTRL+Key_F,mAux);
     673#else
    634674  QAction *auxOn = new QAction("&On",CTRL+Key_O,mAux);
    635675  QAction *auxOff = new QAction("&Off",CTRL+Key_F,mAux);
     676#endif
    636677  auxOn->addTo(mAux);
    637678  auxOff->addTo(mAux);
     
    649690
    650691
     692#if QT_VERSION >= 0x030200
    651693#if QT_VERSION < 0x040000
    652694  QPopupMenu *mFullScreen = new QPopupMenu(mSpecial);
     
    663705#endif
    664706  createRadioAction(fullOn,fullOff,SLOT(toggleFullScreen(bool)),2);
     707#endif
    665708
    666709}
     
    9761019*/
    9771020void G4OpenGLQtViewer::toggleFullScreen(bool check) {
     1021#if QT_VERSION >= 0x030200
    9781022  GLWindow->setWindowState(GLWindow->windowState() ^ Qt::WindowFullScreen);
    979 
     1023#else
     1024  G4cerr << "This version of G4UI Could not generate the selected format" << G4endl;
     1025#endif
    9801026#ifdef GEANT4_QT_DEBUG
    9811027  printf("G4OpenGLQtViewer::toggleRepresentation %d\n",check);
  • trunk/geant4/visualization/management/src/G4VisCommandsSceneHandler.cc

    r593 r617  
    6868
    6969  G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
     70  printf("G4VisCommandSceneHandlerCreate::SetNewValue  2\n");
    7071
    7172  G4String& sceneName = newValue;
     
    209210  G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
    210211
     212  printf("G4VisCommandSceneHandlerCreate::SetNewValue  1\n");
     213
    211214  G4String graphicsSystem, newName;
    212215  std::istringstream is (newValue);
     
    326329                                                G4String newValue) {
    327330  G4String name, verbosityString;
     331  printf("G4VisCommandSceneHandlerCreate::SetNewValue  3\n");
    328332  std::istringstream is (newValue);
    329333  is >> name >> verbosityString;
     
    390394
    391395  G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
     396  printf("G4VisCommandSceneHandlerCreate::SetNewValue  4\n");
    392397
    393398  G4String& selectName = newValue;
Note: See TracChangeset for help on using the changeset viewer.