Ignore:
Timestamp:
Nov 15, 2007, 7:41:15 PM (17 years ago)
Author:
garnier
Message:

r657@mac-90108: laurentgarnier | 2007-11-15 19:44:52 +0100
ajout d un flag pour debug

Location:
trunk/geant4/interfaces/basic
Files:
3 edited

Legend:

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

    r606 r608  
    2525//
    2626//
    27 // $Id: G4UIQt.hh,v 1.4 2007/11/13 17:48:51 lgarnier Exp $
     27// $Id: G4UIQt.hh,v 1.6 2007/11/15 18:24:27 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    144144
    145145private slots :
     146  void ExitSession();
    146147  void ClearButtonCallback();
    147148  void CommandEnteredCallback();
    148149  void ButtonCallback(const QString&);
    149150  void HelpTreeClicCallback();
    150 #if QT_VERSION < 0x040000
    151   void HelpTreeDoubleClicCallback( QListViewItem*, int);
    152 #else
    153151  void HelpTreeDoubleClicCallback( QTreeWidgetItem*, int);
    154 #endif
    155152  void ShowHelpCallback();
    156153  void CommandHistoryCallback();
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r607 r608  
    2525//
    2626//
    27 // $Id: G4UIQt.cc,v 1.9 2007/11/15 10:10:02 lgarnier Exp $
     27// $Id: G4UIQt.cc,v 1.12 2007/11/15 18:24:27 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6060#include <qsignalmapper.h>
    6161
     62#include <qmainwindow.h>
    6263#if QT_VERSION >= 0x040000
    6364#include <qmenu.h>
    6465#include <qlistwidget.h>
    6566#include <qtreewidget.h>
    66 #include <qmainwindow.h>
    6767#else
    6868#include <qaction.h>
     
    106106  :fHelpDialog(NULL)
    107107{
     108#ifdef GEANT4_QT_DEBUG
    108109  printf("G4UIQt::Initialise %d %s\n",argc,argv[0]);
     110#endif
    109111  G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt");
    110112  G4UImanager* UI = G4UImanager::GetUIpointer();
     
    113115  fMainWindow = new QMainWindow();
    114116
     117#ifdef GEANT4_QT_DEBUG
    115118  printf("G4UIQt::Initialise after main window creation\n");
     119#endif
    116120#if QT_VERSION < 0x040000
    117121  fMainWindow->setCaption( tr( "G4UI Session" ));
     
    132136  fCommandHistoryArea = new QListView();
    133137  fCommandHistoryArea->setSelectionMode(QListView::Single);
     138  connect(fCommandHistoryArea, SIGNAL(selectionChanged()), SLOT(CommandHistoryCallback()));
    134139#else
    135140  fCommandHistoryArea = new QListWidget();
    136141  fCommandHistoryArea->setSelectionMode(QAbstractItemView::SingleSelection);
    137 #endif
    138142  connect(fCommandHistoryArea, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback()));
     143#endif
    139144  fCommandHistoryArea->installEventFilter(this);
    140145  fCommandLabel = new QLabel("",fMainWindow);
     
    200205  // Add a quit subMenu
    201206  QPopupMenu *fileMenu = new QPopupMenu( fMainWindow);
    202   fileMenu->insertItem( "&Quitter",  this, SLOT(close()), CTRL+Key_Q );
     207  fileMenu->insertItem( "&Quitter",  this, SLOT(ExitSession()), CTRL+Key_Q );
    203208  fMainWindow->menuBar()->insertItem( QString("&File"), fileMenu );
    204209
     
    213218  // Add a quit subMenu
    214219  QMenu *fileMenu = fMainWindow->menuBar()->addMenu("File");
    215   fileMenu->addAction("Quitter", fMainWindow, SLOT(close()));
     220  fileMenu->addAction("Quitter", this, SLOT(ExitSession()));
    216221
    217222  // Add a Help menu
     
    261266
    262267#if QT_VERSION >= 0x040000
     268#if QT_VERSION >= 0x040200
    263269  fMainWindow->setVisible(true);
     270#else
     271  fMainWindow->show();
     272#endif
    264273#else
    265274  fMainWindow->show();
     
    269278
    270279
     280#ifdef GEANT4_QT_DEBUG
    271281  printf("disable secondary loop\n");
     282#endif
    272283  interactorManager->DisableSecondaryLoop (); // TO KEEP
    273284  ((QApplication*)interactorManager->GetMainInteractor())->exec();
     
    282293
    283294  interactorManager->EnableSecondaryLoop ();
     295#ifdef GEANT4_QT_DEBUG
    284296  printf("enable secondary loop\n");
     297#endif
    285298  return this;
    286299}
     
    326339  if (!aState) return;
    327340
     341#ifdef GEANT4_QT_DEBUG
    328342  printf("G4UIQt::PauseSessionStart\n");
     343#endif
    329344  if(aState=="G4_pause> ") {  // TO KEEP
    330345    SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP
     
    349364  if (!aPrompt) return;
    350365
     366#ifdef GEANT4_QT_DEBUG
    351367  printf("G4UIQt::SecondaryLoop\n");
     368#endif
    352369  G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
    353370  Prompt(aPrompt); // TO KEEP
     
    376393  if (!interactorManager) return 0;
    377394 
    378   //  printf(" **************** G4 Cout : %s\n",(char*)aString.data());
    379395#if QT_VERSION < 0x040000
    380396  fTextArea->append(QString((char*)aString.data()).simplifyWhiteSpace());
     
    895911)
    896912{
     913#ifdef GEANT4_QT_DEBUG
    897914  printf("G4UIQt::GetHelpChoice SHOULD NEVER GO HERE");
     915#endif
    898916  return true;
    899917}
     
    905923)
    906924{
     925#ifdef GEANT4_QT_DEBUG
    907926  printf("G4UIQt::ExitHelp SHOULD NEVER GO HERE");
     927#endif
    908928}
    909929
     
    10401060}
    10411061
     1062/**   Called when user exit session
     1063*/
     1064void G4UIQt::ExitSession (
     1065)
     1066{
     1067  SessionTerminate();
     1068}
     1069
    10421070
    10431071/**   Callback call when "click on a menu entry.<br>
     
    10711099      TerminalHelp(command);
    10721100    }
     1101#ifdef GEANT4_QT_DEBUG
    10731102    printf("after \n");
     1103#endif
    10741104    if(exitSession==true)
    10751105      SessionTerminate();
     
    11721202)
    11731203{
     1204#ifdef GEANT4_QT_DEBUG
    11741205  printf("G4UIQt::HelpTreeDoubleClicCallback");
     1206#endif
    11751207  HelpTreeClicCallback();
    11761208  fCommandArea->setText(item->text (1));
  • trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc

    r606 r608  
    33**
    44** Created: Tue Nov 13 18:13:09 2007
    5 **      by: The Qt MOC ($Id: G4UIQt_moc.cc,v 1.6 2007/11/14 10:38:49 lgarnier Exp $)
     5**      by: The Qt MOC ($Id: G4UIQt_moc.cc,v 1.8 2007/11/15 18:24:28 lgarnier Exp $)
    66**
    77** WARNING! All changes made in this file will be lost!
     
    1919#include <private/qucomextra_p.h>
    2020#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
    21 #error "This file was generated using the moc from 3.3.5. It"
     21#error "This file was generated using the moc from 3.3.8. It"
    2222#error "cannot be used with the include files from this version of Qt."
    2323#error "(The moc has changed too much.)"
     
    5757        return metaObj;
    5858    QMetaObject* parentObject = QObject::staticMetaObject();
    59     static const QUMethod slot_0 = {"ClearButtonCallback", 0, 0 };
    60     static const QUMethod slot_1 = {"CommandEnteredCallback", 0, 0 };
    61     static const QUParameter param_slot_2[] = {
     59    static const QUMethod slot_0 = {"ExitSession", 0, 0 };
     60    static const QUMethod slot_1 = {"ClearButtonCallback", 0, 0 };
     61    static const QUMethod slot_2 = {"CommandEnteredCallback", 0, 0 };
     62    static const QUParameter param_slot_3[] = {
    6263        { 0, &static_QUType_QString, 0, QUParameter::In }
    6364    };
    64     static const QUMethod slot_2 = {"ButtonCallback", 1, param_slot_2 };
    65     static const QUMethod slot_3 = {"HelpTreeClicCallback", 0, 0 };
    66     static const QUParameter param_slot_4[] = {
    67         { 0, &static_QUType_ptr, "QTreeWidgetItem", QUParameter::In },
     65    static const QUMethod slot_3 = {"ButtonCallback", 1, param_slot_3 };
     66    static const QUMethod slot_4 = {"HelpTreeClicCallback", 0, 0 };
     67    static const QUParameter param_slot_5[] = {
     68        { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In },
    6869        { 0, &static_QUType_int, 0, QUParameter::In }
    6970    };
    70     static const QUMethod slot_4 = {"HelpTreeDoubleClicCallback", 2, param_slot_4 };
    71     static const QUMethod slot_5 = {"ShowHelpCallback", 0, 0 };
    72     static const QUMethod slot_6 = {"CommandHistoryCallback", 0, 0 };
     71    static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 2, param_slot_5 };
     72    static const QUMethod slot_6 = {"ShowHelpCallback", 0, 0 };
     73    static const QUMethod slot_7 = {"CommandHistoryCallback", 0, 0 };
    7374    static const QMetaData slot_tbl[] = {
    74         { "ClearButtonCallback()", &slot_0, QMetaData::Private },
    75         { "CommandEnteredCallback()", &slot_1, QMetaData::Private },
    76         { "ButtonCallback(const QString&)", &slot_2, QMetaData::Private },
    77         { "HelpTreeClicCallback()", &slot_3, QMetaData::Private },
    78         { "HelpTreeDoubleClicCallback(QTreeWidgetItem*,int)", &slot_4, QMetaData::Private },
    79         { "ShowHelpCallback()", &slot_5, QMetaData::Private },
    80         { "CommandHistoryCallback()", &slot_6, QMetaData::Private }
     75        { "ExitSession()", &slot_0, QMetaData::Private },
     76        { "ClearButtonCallback()", &slot_1, QMetaData::Private },
     77        { "CommandEnteredCallback()", &slot_2, QMetaData::Private },
     78        { "ButtonCallback(const QString&)", &slot_3, QMetaData::Private },
     79        { "HelpTreeClicCallback()", &slot_4, QMetaData::Private },
     80        { "HelpTreeDoubleClicCallback(QListViewItem*,int)", &slot_5, QMetaData::Private },
     81        { "ShowHelpCallback()", &slot_6, QMetaData::Private },
     82        { "CommandHistoryCallback()", &slot_7, QMetaData::Private }
    8183    };
    8284    static const QUParameter param_signal_0[] = {
     
    8991    metaObj = QMetaObject::new_metaobject(
    9092        "G4UIQt", parentObject,
    91         slot_tbl, 7,
     93        slot_tbl, 8,
    9294        signal_tbl, 1,
    9395#ifndef QT_NO_PROPERTIES
     
    120122{
    121123    switch ( _id - staticMetaObject()->slotOffset() ) {
    122     case 0: ClearButtonCallback(); break;
    123     case 1: CommandEnteredCallback(); break;
    124     case 2: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break;
    125     case 3: HelpTreeClicCallback(); break;
    126 #if QT_VERSION < 0x040000
    127     case 4: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    128 #else
    129     case 4: HelpTreeDoubleClicCallback((QTreeWidgetItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    130 #endif
    131     case 5: ShowHelpCallback(); break;
    132     case 6: CommandHistoryCallback(); break;
     124    case 0: ExitSession(); break;
     125    case 1: ClearButtonCallback(); break;
     126    case 2: CommandEnteredCallback(); break;
     127    case 3: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break;
     128    case 4: HelpTreeClicCallback(); break;
     129    case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
     130    case 6: ShowHelpCallback(); break;
     131    case 7: CommandHistoryCallback(); break;
    133132    default:
    134133        return QObject::qt_invoke( _id, _o );
     
    155154bool G4UIQt::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
    156155#endif // QT_NO_PROPERTIES
     156
    157157
    158158#endif
     
    188188       0,       // classname
    189189       0,    0, // classinfo
    190        8,   10, // methods
     190       9,   10, // methods
    191191       0,    0, // properties
    192192       0,    0, // enums/sets
     
    197197 // slots: signature, parameters, type, tag, flags
    198198      32,   31,   31,   31, 0x08,
    199       54,   31,   31,   31, 0x08,
    200       79,   31,   31,   31, 0x08,
    201      103,   31,   31,   31, 0x08,
    202      126,  175,   31,   31, 0x08,
    203      177,   31,   31,   31, 0x08,
    204      196,   31,   31,   31, 0x08,
     199      46,   31,   31,   31, 0x08,
     200      68,   31,   31,   31, 0x08,
     201      93,   31,   31,   31, 0x08,
     202     117,   31,   31,   31, 0x08,
     203     140,  189,   31,   31, 0x08,
     204     191,   31,   31,   31, 0x08,
     205     210,   31,   31,   31, 0x08,
    205206
    206207       0        // eod
     
    209210static const char qt_meta_stringdata_G4UIQt[] = {
    210211    "G4UIQt\0myClicked(QString)\0text\0\0"
    211     "ClearButtonCallback()\0CommandEnteredCallback()\0"
     212    "ExitSession()\0ClearButtonCallback()\0"
     213    "CommandEnteredCallback()\0"
    212214    "ButtonCallback(QString)\0HelpTreeClicCallback()\0"
    213215    "HelpTreeDoubleClicCallback(QTreeWidgetItem*,int)\0"
     
    245247        switch (_id) {
    246248        case 0: myClicked((*reinterpret_cast< const QString(*)>(_a[1]))); break;
    247         case 1: ClearButtonCallback(); break;
    248         case 2: CommandEnteredCallback(); break;
    249         case 3: ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
    250         case 4: HelpTreeClicCallback(); break;
    251         case 5: HelpTreeDoubleClicCallback((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
    252         case 6: ShowHelpCallback(); break;
    253         case 7: CommandHistoryCallback(); break;
     249        case 1: ExitSession(); break;
     250        case 2: ClearButtonCallback(); break;
     251        case 3: CommandEnteredCallback(); break;
     252        case 4: ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
     253        case 5: HelpTreeClicCallback(); break;
     254        case 6: HelpTreeDoubleClicCallback((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
     255        case 7: ShowHelpCallback(); break;
     256        case 8: CommandHistoryCallback(); break;
    254257        }
    255         _id -= 8;
     258        _id -= 9;
    256259    }
    257260    return _id;
Note: See TracChangeset for help on using the changeset viewer.