Changeset 1329


Ignore:
Timestamp:
Jul 28, 2010, 4:57:46 PM (14 years ago)
Author:
garnier
Message:

bug fix 2?

File:
1 edited

Legend:

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

    r1325 r1329  
    506506)
    507507{
     508  bool shouldConnect = false;
     509
    508510#ifdef G4DEBUG_INTERFACES_BASIC
    509511  printf("G4UIQt::AddTabWidget %d %d\n",sizeX, sizeY);
     
    535537    fTabWidget->setSizePolicy(policy);
    536538   
    537 #if QT_VERSION >= 0x040500
    538     connect(fTabWidget,   SIGNAL(tabCloseRequested(int)), this, SLOT(TabCloseCallback(int)));
    539 #endif
    540     connect(fTabWidget, SIGNAL(currentChanged ( int ) ), SLOT(UpdateTabWidget(int)));
     539    shouldConnect = true;
    541540  }
    542541
     
    584583  printf("G4UIQt::AddTabWidget ADD %d %d + %d %d---------------------------------------------------\n",sizeX, sizeY,sizeX-fTabWidget->width(),sizeY-fTabWidget->height());
    585584#endif
    586  
     585
    587586  if (fMainWindow->isVisible()) {
    588587
     
    591590    int tabBarY = 0;
    592591    if (fTabWidget->count() >0) {
     592#ifdef G4DEBUG_INTERFACES_BASIC
     593  printf("G4UIQt::AddTabWidget -1-1-1\n");
     594#endif
     595
    593596#if QT_VERSION < 0x040000
    594597      tabBarX = fTabWidget->width()-fTabWidget->page(0)->width();
     
    600603    }
    601604
     605#ifdef G4DEBUG_INTERFACES_BASIC
     606  printf("G4UIQt::AddTabWidget 00000\n");
     607#endif
     608
    602609    fMainWindow->resize(tabBarX+fMainWindow->width()+sizeX-fTabWidget->width(),tabBarY+fMainWindow->height()+sizeY-fTabWidget->height());
    603610  }
    604611
     612#ifdef G4DEBUG_INTERFACES_BASIC
     613  printf("G4UIQt::AddTabWidget 1111111\n");
     614#endif
    605615  // Problems with resize. The widgets are not realy drawn at this step,
    606616  // then we have to force them on order to check the size
     
    612622#endif
    613623 
     624#ifdef G4DEBUG_INTERFACES_BASIC
     625  printf("G4UIQt::AddTabWidget 222222\n");
     626#endif
    614627#if QT_VERSION < 0x040000
    615628  fTabWidget->setCurrentPage(fTabWidget->count()-1);
     
    618631#endif
    619632
     633#ifdef G4DEBUG_INTERFACES_BASIC
     634  printf("G4UIQt::AddTabWidget 333333\n");
     635#endif
    620636  // Set visible
    621637#if QT_VERSION >= 0x040000
     
    629645#endif
    630646 
     647#ifdef G4DEBUG_INTERFACES_BASIC
     648  printf("G4UIQt::AddTabWidget -------\n");
     649#endif
     650  if (shouldConnect) {
     651#if QT_VERSION >= 0x040500
     652    connect(fTabWidget,   SIGNAL(tabCloseRequested(int)), this, SLOT(TabCloseCallback(int)));
     653#endif
     654    connect(fTabWidget, SIGNAL(currentChanged ( int ) ), SLOT(UpdateTabWidget(int)));
     655  }
    631656  return true;
    632657}
Note: See TracChangeset for help on using the changeset viewer.