Changeset 1232 for trunk/source
- Timestamp:
- Jan 28, 2010, 4:53:04 PM (15 years ago)
- Location:
- trunk/source/interfaces
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/interfaces/basic/include/G4UIQt.hh
r1228 r1232 100 100 // Ex : AddButton("my_menu","Run","/run/beamOn 1"); 101 101 102 voidAddTabWidget(QWidget*,QString,int,int);102 bool AddTabWidget(QWidget*,QString,int,int); 103 103 // To add a tab for vis openGL Qt driver 104 105 bool IsSplitterReleased(); 104 106 105 107 public: -
trunk/source/interfaces/basic/src/G4UIQt.cc
r1228 r1232 295 295 #endif 296 296 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 297 308 #ifdef G4DEBUG_INTERFACES_BASIC 298 309 printf("G4UIQt::G4UIQt END\n"); … … 478 489 Create the tab if it was not done 479 490 */ 480 voidG4UIQt::AddTabWidget(491 bool G4UIQt::AddTabWidget( 481 492 QWidget* aWidget 482 493 ,QString name … … 485 496 ) 486 497 { 498 487 499 #ifdef G4DEBUG_INTERFACES_BASIC 488 500 printf("G4UIQt::AddTabWidget %d %d\n",sizeX, sizeY); 489 501 #endif 490 if (!aWidget) return ;502 if (!aWidget) return false; 491 503 492 504 #ifdef G4DEBUG_INTERFACES_BASIC … … 499 511 aWidget->setParent(fTabWidget); 500 512 #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 502 523 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 564 printf("G4UIQt::AddTabWidget END\n"); 565 // // #endif 566 567 return true; 506 568 } 507 569 … … 555 617 ) 556 618 { 619 #ifdef G4DEBUG_INTERFACES_BASIC 620 printf("G4UIQt::G4UIQt SessionStart\n"); 621 #endif 557 622 558 623 G4Qt* interactorManager = G4Qt::getInstance (); 624 625 Prompt("Session :"); 626 exitSession = false; 559 627 560 628 #if QT_VERSION >= 0x040000 … … 567 635 fMainWindow->show(); 568 636 #endif 569 Prompt("Session :"); 570 exitSession = false; 571 572 637 638 #ifdef G4DEBUG_INTERFACES_BASIC 639 printf("G4UIQt::G4UIQt SessionStart2\n"); 640 #endif 573 641 interactorManager->DisableSecondaryLoop (); // TO KEEP 574 642 if ((QApplication*)interactorManager->GetMainInteractor()) … … 1764 1832 return commandResultMap; 1765 1833 } 1766 #endif 1834 1835 #endif -
trunk/source/interfaces/common/src/G4Qt.cc
r1228 r1232 240 240 { 241 241 if (fG4UI != NULL) { 242 fG4UI->AddTabWidget(vis,name,sizeX,sizeY); 243 return true; 242 return fG4UI->AddTabWidget(vis,name,sizeX,sizeY); 244 243 } 245 244 return false;
Note: See TracChangeset
for help on using the changeset viewer.