Ignore:
Timestamp:
Nov 22, 2007, 6:07:00 PM (17 years ago)
Author:
garnier
Message:

r661@mac-90108: laurentgarnier | 2007-11-22 18:10:43 +0100
en debug

File:
1 edited

Legend:

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

    r608 r610  
    3030// L. Garnier
    3131
    32 //#define DEBUG
     32#define GEANT4_QT_DEBUG
    3333
    3434#ifdef G4UI_BUILD_QT_SESSION
     
    128128#endif
    129129
     130  // Set layouts
     131
     132#if QT_VERSION < 0x040000
    130133  QSplitter *splitter = new QSplitter(Qt::Vertical);
    131   fTextArea = new QTextEdit(fMainWindow);
    132   QPushButton *clearButton = new QPushButton("clear",fMainWindow);
     134
     135  QWidget* topWidget = new QWidget(splitter);
     136  QWidget* bottomWidget = new QWidget(splitter);
     137
     138  QVBoxLayout *layoutTop = new QVBoxLayout(topWidget);
     139  QVBoxLayout *layoutBottom = new QVBoxLayout(bottomWidget);
     140#else
     141  QWidget* topWidget = new QWidget();
     142  QWidget* bottomWidget = new QWidget();
     143
     144  QVBoxLayout *layoutTop = new QVBoxLayout;
     145  QVBoxLayout *layoutBottom = new QVBoxLayout;
     146#endif
     147
     148  // fill them
     149
     150  fTextArea = new QTextEdit(topWidget);
     151#ifdef GEANT4_QT_DEBUG
     152  printf("G4UIQt:: end\n");
     153#endif
     154#ifdef GEANT4_QT_DEBUG
     155  printf("G4UIQt::PushButton 1\n");
     156#endif
     157  QPushButton *clearButton = new QPushButton("clear",topWidget);
     158#ifdef GEANT4_QT_DEBUG
     159  printf("G4UIQt::end1\n");
     160#endif
    133161  connect(clearButton, SIGNAL(clicked()), SLOT(ClearButtonCallback()));
    134162
    135163#if QT_VERSION < 0x040000
    136   fCommandHistoryArea = new QListView();
     164  fCommandHistoryArea = new QListView(bottomWidget);
    137165  fCommandHistoryArea->setSelectionMode(QListView::Single);
    138166  connect(fCommandHistoryArea, SIGNAL(selectionChanged()), SLOT(CommandHistoryCallback()));
     
    143171#endif
    144172  fCommandHistoryArea->installEventFilter(this);
    145   fCommandLabel = new QLabel("",fMainWindow);
    146 
    147   fCommandArea = new QLineEdit(fMainWindow);
     173  fCommandLabel = new QLabel("",bottomWidget);
     174
     175  fCommandArea = new QLineEdit(bottomWidget);
    148176  fCommandArea->installEventFilter(this);
     177#ifdef GEANT4_QT_DEBUG
     178  printf("G4UIQt::   1\n");
     179#endif
    149180#if QT_VERSION < 0x040000
    150181  fCommandArea->setActiveWindow();
     
    163194
    164195
    165   // Set layouts
    166 
    167 #if QT_VERSION < 0x040000
    168   QWidget* topWidget = new QWidget(splitter);
    169   QWidget* bottomWidget = new QWidget(splitter);
    170 
    171   QVBoxLayout *layoutTop = new QVBoxLayout(topWidget);
    172   QVBoxLayout *layoutBottom = new QVBoxLayout(bottomWidget);
    173 #else
    174   QWidget* topWidget = new QWidget();
    175   QWidget* bottomWidget = new QWidget();
    176 
    177   QVBoxLayout *layoutTop = new QVBoxLayout;
    178   QVBoxLayout *layoutBottom = new QVBoxLayout;
    179 #endif
    180 
     196#ifdef GEANT4_QT_DEBUG
     197  printf("G4UIQt::   2\n");
     198#endif
     199
     200#ifdef GEANT4_QT_DEBUG
     201  printf("G4UIQt::   3\n");
     202#endif
    181203
    182204
     
    188210#endif
    189211
     212#ifdef GEANT4_QT_DEBUG
     213  printf("G4UIQt::   4\n");
     214#endif
    190215  layoutBottom->addWidget(fCommandHistoryArea);
    191216  layoutBottom->addWidget(fCommandLabel);
     
    199224
    200225
     226#ifdef GEANT4_QT_DEBUG
     227  printf("G4UIQt::   5\n");
     228#endif
    201229  fMainWindow->setCentralWidget(splitter);
    202230
     
    213241  fMainWindow->menuBar()->insertItem( QString("&Help"), helpMenu );
    214242
     243#ifdef GEANT4_QT_DEBUG
     244  printf("G4UIQt::   6\n");
     245#endif
    215246
    216247#else
     
    223254  QMenu *helpMenu = fMainWindow->menuBar()->addMenu("Help");
    224255  helpMenu->addAction("Show Help", this, SLOT(ShowHelpCallback()));
     256#endif
     257#ifdef GEANT4_QT_DEBUG
     258  printf("G4UIQt::   7\n");
    225259#endif
    226260
     
    236270    splitter->setSizes(vals);
    237271  }
     272#ifdef GEANT4_QT_DEBUG
     273  printf("G4UIQt::   8\n");
     274#endif
    238275
    239276  if(UI!=NULL) UI->SetCoutDestination(this);  // TO KEEP
     
    282319#endif
    283320  interactorManager->DisableSecondaryLoop (); // TO KEEP
    284   ((QApplication*)interactorManager->GetMainInteractor())->exec();
     321  if ((QApplication*)interactorManager->GetMainInteractor())
     322    ((QApplication*)interactorManager->GetMainInteractor())->exec();
     323
    285324  // on ne passe pas le dessous ? FIXME ????
    286325  // je ne pense pas 13/06
     
    548587
    549588#if QT_VERSION < 0x040000
     589#ifdef GEANT4_QT_DEBUG
     590  printf("G4UIQt::QTextEdit 1\n");
     591#endif
    550592    fHelpArea = new QTextEdit(splitter);
    551 #else
     593#ifdef GEANT4_QT_DEBUG
     594  printf("G4UIQt::end 1\n");
     595#endif
     596#else
     597#ifdef GEANT4_QT_DEBUG
     598  printf("G4UIQt::QTextEdit 2\n");
     599#endif
    552600    fHelpArea = new QTextEdit();
     601#ifdef GEANT4_QT_DEBUG
     602  printf("G4UIQt::end 2\n");
     603#endif
    553604#endif
    554605    fHelpArea->setReadOnly(true);
Note: See TracChangeset for help on using the changeset viewer.