Changeset 1340 for trunk/source/interfaces/basic/src
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- Location:
- trunk/source/interfaces/basic/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/interfaces/basic/src/CVS/Entries
r1337 r1340 7 7 /G4UIterminal.cc/1.28/Thu Sep 30 06:11:43 2010// 8 8 /G4VUIshell.cc/1.10/Thu Sep 30 06:11:43 2010// 9 /G4UIQt.cc/1. 49/Thu Sep 30 11:54:072010//9 /G4UIQt.cc/1.53/Tue Nov 2 15:38:51 2010// 10 10 D -
trunk/source/interfaces/basic/src/G4UIQt.cc
r1335 r1340 25 25 // 26 26 // 27 // $Id: G4UIQt.cc,v 1. 49 2010/06/23 13:06:16lgarnier Exp $27 // $Id: G4UIQt.cc,v 1.53 2010/11/02 15:38:51 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 31 31 32 32 #ifdef G4UI_BUILD_QT_SESSION 33 34 //#define QT_CONNECT_TEST 135 33 36 34 #include "G4Types.hh" … … 109 107 ,char** argv 110 108 ) 111 :fG4cout("") 109 :fHelpArea(NULL) 110 ,fG4cout("") 112 111 ,fHelpTreeWidget(NULL) 113 112 ,fHelpTBWidget(NULL) … … 116 115 ,fVisParametersTBWidget(NULL) 117 116 ,fViewComponentsTBWidget(NULL) 117 ,fHelpLine(NULL) 118 118 ,fTabWidget(NULL) 119 119 ,fCoutText("Output") … … 508 508 ) 509 509 { 510 #ifdef QT_CONNECT_TEST511 bool shouldConnect = false;512 #endif513 514 510 #ifdef G4DEBUG_INTERFACES_BASIC 515 511 printf("G4UIQt::AddTabWidget %d %d\n",sizeX, sizeY); … … 541 537 fTabWidget->setSizePolicy(policy); 542 538 543 #ifdef QT_CONNECT_TEST544 shouldConnect = true;545 #else546 539 #if QT_VERSION >= 0x040500 547 540 connect(fTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(TabCloseCallback(int))); 548 541 #endif 549 542 connect(fTabWidget, SIGNAL(currentChanged ( int ) ), SLOT(UpdateTabWidget(int))); 550 #endif551 552 543 } 553 544 … … 602 593 int tabBarY = 0; 603 594 if (fTabWidget->count() >0) { 604 #ifdef G4DEBUG_INTERFACES_BASIC605 printf("G4UIQt::AddTabWidget -1-1-1\n");606 #endif607 608 595 #if QT_VERSION < 0x040000 609 596 tabBarX = fTabWidget->width()-fTabWidget->page(0)->width(); … … 615 602 } 616 603 617 #ifdef G4DEBUG_INTERFACES_BASIC618 printf("G4UIQt::AddTabWidget 00000\n");619 #endif620 621 604 fMainWindow->resize(tabBarX+fMainWindow->width()+sizeX-fTabWidget->width(),tabBarY+fMainWindow->height()+sizeY-fTabWidget->height()); 622 605 } 623 606 624 #ifdef G4DEBUG_INTERFACES_BASIC625 printf("G4UIQt::AddTabWidget 1111111\n");626 #endif627 607 // Problems with resize. The widgets are not realy drawn at this step, 628 608 // then we have to force them on order to check the size … … 634 614 #endif 635 615 636 #ifdef G4DEBUG_INTERFACES_BASIC637 printf("G4UIQt::AddTabWidget 222222\n");638 #endif639 616 #if QT_VERSION < 0x040000 640 617 fTabWidget->setCurrentPage(fTabWidget->count()-1); … … 643 620 #endif 644 621 645 #ifdef G4DEBUG_INTERFACES_BASIC646 printf("G4UIQt::AddTabWidget 333333\n");647 #endif648 622 // Set visible 649 623 #if QT_VERSION >= 0x040000 … … 657 631 #endif 658 632 659 #ifdef G4DEBUG_INTERFACES_BASIC660 printf("G4UIQt::AddTabWidget -------\n");661 #endif662 #ifdef QT_CONNECT_TEST663 if (shouldConnect) {664 #if QT_VERSION >= 0x040500665 connect(fTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(TabCloseCallback(int)));666 #endif667 connect(fTabWidget, SIGNAL(currentChanged ( int ) ), SLOT(UpdateTabWidget(int)));668 }669 #endif670 633 return true; 671 634 } … … 755 718 visible = true; 756 719 } 757 }758 if (visible) {759 #if QT_VERSION >= 0x040000760 #if QT_VERSION >= 0x040200761 fEmptyViewerTabLabel->setVisible(false);762 #else763 fEmptyViewerTabLabel->hide();764 #endif765 #else766 fEmptyViewerTabLabel->hide();767 #endif768 } else {769 #if QT_VERSION >= 0x040000770 #if QT_VERSION >= 0x040200771 fEmptyViewerTabLabel->setVisible(true);772 #else773 fEmptyViewerTabLabel->show();774 #endif775 #else776 fEmptyViewerTabLabel->show();777 #endif778 720 } 779 721 } … … 1150 1092 if (! fHelpTreeWidget ) { 1151 1093 InitHelpTree(); 1094 } 1095 1096 QString searchText = fHelpLine->text(); 1097 1098 if (searchText =="") { 1099 // clear old help tree 1100 // fHelpTreeWidget->clear(); 1101 #if QT_VERSION < 0x040000 1102 fHelpTreeWidget->removeColumn(1); 1103 fHelpTreeWidget->removeColumn(0); 1104 #endif 1105 } else { 1106 return; 1107 } 1108 1109 if (fHelpArea) { 1110 #if QT_VERSION < 0x040200 1111 fHelpArea->clear(); 1112 #else 1113 fHelpArea->setText(""); 1114 #endif 1115 } 1116 1117 if (fHelpLine) { 1118 #if QT_VERSION < 0x040200 1119 fHelpLine->clear(); 1120 #else 1121 fHelpLine->setText(""); 1122 #endif 1152 1123 } 1153 1124 … … 1864 1835 ) 1865 1836 { 1866 1867 1837 // the help tree 1868 1838 G4UImanager* UI = G4UImanager::GetUIpointer(); … … 1986 1956 #if QT_VERSION < 0x040000 1987 1957 newItem = new QListViewItem(fHelpTreeWidget); 1988 newItem->setText(0,i.data().simplifyWhiteSpace());1958 QString commandStr = i.data().simplifyWhiteSpace(); 1989 1959 #else 1990 1960 newItem = new QTreeWidgetItem(fHelpTreeWidget); 1991 newItem->setText(0,i.value().trimmed()); 1992 #endif 1961 QString commandStr = i.value().trimmed(); 1962 #endif 1963 1964 #if QT_VERSION < 0x040000 1965 if (commandPath.find("/") == 0) { 1966 commandStr = commandStr.right(commandStr.length()-1); 1967 #else 1968 if (commandStr.indexOf("/") == 0) { 1969 commandStr = commandStr.right(commandStr.size()-1); 1970 #endif 1971 } 1972 1973 newItem->setText(0,commandStr); 1993 1974 newItem->setText(1,progressStr); 1994 1975
Note: See TracChangeset
for help on using the changeset viewer.