Changeset 1232


Ignore:
Timestamp:
Jan 28, 2010, 4:53:04 PM (14 years ago)
Author:
garnier
Message:

debug visu

Location:
trunk/source/interfaces
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/interfaces/basic/include/G4UIQt.hh

    r1228 r1232  
    100100  // Ex : AddButton("my_menu","Run","/run/beamOn 1");
    101101
    102   void AddTabWidget(QWidget*,QString,int,int);
     102  bool AddTabWidget(QWidget*,QString,int,int);
    103103  // To add a tab for vis openGL Qt driver
     104 
     105  bool IsSplitterReleased();
    104106
    105107public:
  • trunk/source/interfaces/basic/src/G4UIQt.cc

    r1228 r1232  
    295295#endif
    296296
     297  // Set visible
     298#if QT_VERSION >= 0x040000
     299#if QT_VERSION >= 0x040200
     300  fMainWindow->setVisible(true);
     301#else
     302  fMainWindow->show();
     303#endif
     304#else
     305  fMainWindow->show();
     306#endif
     307
    297308#ifdef G4DEBUG_INTERFACES_BASIC
    298309  printf("G4UIQt::G4UIQt END\n");
     
    478489  Create the tab if it was not done
    479490*/
    480 void G4UIQt::AddTabWidget(
     491bool G4UIQt::AddTabWidget(
    481492 QWidget* aWidget
    482493,QString name
     
    485496)
    486497{
     498
    487499#ifdef G4DEBUG_INTERFACES_BASIC
    488500  printf("G4UIQt::AddTabWidget %d %d\n",sizeX, sizeY);
    489501#endif
    490   if (!aWidget) return;
     502  if (!aWidget) return false;
    491503 
    492504#ifdef G4DEBUG_INTERFACES_BASIC
     
    499511  aWidget->setParent(fTabWidget);
    500512#endif
    501    
     513#ifdef G4DEBUG_INTERFACES_BASIC
     514  printf("G4UIQt::AddTabWidget resize VVVVVVVVVVVG4UIQt G4UIQt G4UIQt G4UIQt G4UIQt G4UIQt G4UIQt G4UIQt \n");
     515  printf("G4UIQt::AddTabWidget resize 22222222222 W---:%d + sx:%d -fwx:%d   H---:%d + sy:%d -fwy:%d    TabW:%d TabH:%d G4UIQt G4UIQt aWX:%d aWY:%d\n",fMainWindow->width(),sizeX,fTabWidget->width(),fMainWindow->height(),sizeY,fTabWidget->height(),fTabWidget->width(),fTabWidget->height(),aWidget->size().height(),aWidget->size().width());
     516#endif
     517
     518  fMainWindow->resize(fMainWindow->width()+sizeX-fTabWidget->width(),fMainWindow->height()+sizeY-fTabWidget->height());
     519
     520  // Problems with resize. The widgets are not realy drawn at this step,
     521  // then we have to force them on order to check the size
     522
    502523  fTabWidget->insertTab(fTabWidget->count()-1,aWidget,name);
    503  
    504   fMainWindow->resize(fMainWindow->width()+sizeX-fTabWidget->width(),
    505                       fMainWindow->height()+sizeY-fTabWidget->height());
     524 
     525  // Set visible
     526#if QT_VERSION >= 0x040000
     527#if QT_VERSION >= 0x040200
     528  fMainWindow->setVisible(true);
     529#else
     530  fMainWindow->show();
     531#endif
     532#else
     533  fMainWindow->show();
     534 #endif
     535 
     536 
     537
     538// //   // Check size
     539// //   int offX = (sizeX-aWidget->size().width());
     540// //   int offY = (sizeY-aWidget->size().height());
     541
     542// // #ifdef G4DEBUG_INTERFACES_BASIC
     543// //   printf("G4UIQt::AddTabWidget resize AFTER FIRST W:%d + sx:%d -fwx:%d   H:%d + sy:%d -fwy:%d    TabW:%d TabH:%d G4UIQt G4UIQt offX:%d  offY:%d aWX:%d aWY:%d\n",fMainWindow->width(),sizeX,fTabWidget->width(),fMainWindow->height(),sizeY,fTabWidget->height(),fTabWidget->width(),fTabWidget->height(),offX,offY,aWidget->size().height(),aWidget->size().width());
     544// // #endif
     545
     546// //   // and correct if necessairy
     547// //   if ((offX != 0) ||(offY != 0)) {
     548// //     fMainWindow->resize(fMainWindow->width()+offX,fMainWindow->height()+offY);
     549// //     // Re-Set visible
     550// // #if QT_VERSION >= 0x040000
     551// // #if QT_VERSION >= 0x040200
     552// //     fMainWindow->setVisible(true);
     553// // #else
     554// //     fMainWindow->show();
     555// // #endif
     556// // #else
     557// //     fMainWindow->show();
     558// // #endif
     559// //   }
     560
     561// // #ifdef G4DEBUG_INTERFACES_BASIC
     562// //   printf("G4UIQt::AddTabWidget resize ^^^^^^^^^^^^ W:%d + sx:%d -fwx:%d   H:%d + sy:%d -fwy:%d    TabW:%d TabH:%d G4UIQt G4UIQt offX:%d  offY:%d aWX:%d aWY:%d\n",fMainWindow->width(),sizeX,fTabWidget->width(),fMainWindow->height(),sizeY,fTabWidget->height(),fTabWidget->width(),fTabWidget->height(),offX,offY,aWidget->size().height(),aWidget->size().width());
     563// // #endif
     564printf("G4UIQt::AddTabWidget  END\n");
     565// // #endif
     566 
     567  return true;
    506568}
    507569
     
    555617)
    556618{
     619#ifdef G4DEBUG_INTERFACES_BASIC
     620  printf("G4UIQt::G4UIQt SessionStart\n");
     621#endif
    557622
    558623  G4Qt* interactorManager = G4Qt::getInstance ();
     624
     625  Prompt("Session :");
     626  exitSession = false;
    559627
    560628#if QT_VERSION >= 0x040000
     
    567635  fMainWindow->show();
    568636#endif
    569   Prompt("Session :");
    570   exitSession = false;
    571 
    572 
     637
     638#ifdef G4DEBUG_INTERFACES_BASIC
     639  printf("G4UIQt::G4UIQt SessionStart2\n");
     640#endif
    573641  interactorManager->DisableSecondaryLoop (); // TO KEEP
    574642  if ((QApplication*)interactorManager->GetMainInteractor())
     
    17641832  return commandResultMap;
    17651833}
    1766 #endif
     1834
     1835#endif
  • trunk/source/interfaces/common/src/G4Qt.cc

    r1228 r1232  
    240240{
    241241  if (fG4UI != NULL) {
    242     fG4UI->AddTabWidget(vis,name,sizeX,sizeY);
    243     return true;
     242    return fG4UI->AddTabWidget(vis,name,sizeX,sizeY);
    244243  }
    245244  return false;
Note: See TracChangeset for help on using the changeset viewer.