Changeset 619 for trunk/geant4


Ignore:
Timestamp:
Nov 27, 2007, 6:04:59 PM (17 years ago)
Author:
garnier
Message:

modifs pour Qt3

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

Legend:

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

    r609 r619  
    150150  void HelpTreeClicCallback();
    151151#if QT_VERSION < 0x040000
    152   void HelpTreeDoubleClicCallback( QListViewItem*, int);
     152  void HelpTreeDoubleClicCallback( QListViewItem*);
    153153#else
    154   void HelpTreeDoubleClicCallback( QTreeWidgetItem*, int);
     154  void HelpTreeDoubleClicCallback( QTreeWidgetItem*,int);
    155155#endif
    156156  void ShowHelpCallback();
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r617 r619  
    171171  connect(fCommandHistoryArea, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback()));
    172172#endif
     173  fCommandHistoryArea->addColumn("");
     174  fCommandHistoryArea->header()->hide();
     175
    173176  fCommandHistoryArea->installEventFilter(this);
    174177  fCommandLabel = new QLabel("",bottomWidget);
     
    566569    fHelpDialog = new QDialog(fMainWindow,0,FALSE,Qt::WStyle_Title | Qt::WStyle_SysMenu | Qt::WStyle_MinMax );
    567570    QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog);
    568     QWidget* global = new QWidget(fHelpDialog);
     571    QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog);
    569572#else
    570573    QVBoxLayout *vLayout = new QVBoxLayout();
    571574    fHelpDialog = new QDialog(fMainWindow,Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
    572 #endif
    573     QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog);
    574 
    575     QPushButton *exitButton = new QPushButton("Exit",fMainWindow);
     575    QSplitter *splitter = new QSplitter(Qt::Horizontal);
     576#endif
     577    QPushButton *exitButton = new QPushButton("Exit",fHelpDialog);
    576578    connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close()));
    577579
     
    585587    fHelpTreeWidget = new QListView(splitter);
    586588    fHelpTreeWidget->setSelectionMode(QListView::Single);
     589    fHelpTreeWidget->setRootIsDecorated(true);
    587590    fHelpTreeWidget->addColumn("Command");
    588     fHelpTreeWidget->addColumn("Description");
    589     fHelpTreeWidget->setColumnWidth (1,0);
     591    fHelpTreeWidget->addColumn("Description",0);
     592    //    fHelpTreeWidget->setColumnWidth (1,0);
    590593    fHelpTreeWidget->header()->setResizeEnabled(FALSE,1);
    591594    //    QList<QListViewItem *> items;
     
    651654    }
    652655
     656#if QT_VERSION < 0x040000
     657    connect(fHelpTreeWidget, SIGNAL(selectionChanged ()),this, SLOT(HelpTreeClicCallback())); 
     658    connect(fHelpTreeWidget, SIGNAL(doubleClicked (QListViewItem*)),this, SLOT(HelpTreeDoubleClicCallback(QListViewItem*)));
     659#else
    653660    connect(fHelpTreeWidget, SIGNAL(itemSelectionChanged ()),this, SLOT(HelpTreeClicCallback())); 
    654     connect(fHelpTreeWidget, SIGNAL(itemDoubleClicked (QTreeWidgetItem*,int)),this, SLOT(HelpTreeDoubleClicCallback(QTreeWidgetItem*,int))); 
     661    connect(fHelpTreeWidget, SIGNAL(itemDoubleClicked (QTreeWidgetItem*,int)),this, SLOT(HelpTreeDoubleClicCallback(QTreeWidgetItem*))); 
     662#endif
    655663
    656664    // Set layouts
     
    662670
    663671
    664 #if QT_VERSION < 0x040000
    665     vLayout->addWidget(global);
    666 #else
     672#if QT_VERSION >= 0x040000
    667673    vLayout->addWidget(splitter);
    668 #endif
    669674    vLayout->addWidget(exitButton);
     675#else
     676    vLayout->add(splitter);
     677    vLayout->addWidget(exitButton);
     678#endif
     679
     680    // set the splitter size
     681#if QT_VERSION >= 0x040000
     682    QList<int> list;
     683#else
     684    QValueList<int> list;
     685#endif
     686    list.append( 400 );
     687    list.append( 400 );
     688    splitter->setSizes(list);
     689
    670690#if QT_VERSION >= 0x040000
    671691    fHelpDialog->setLayout(vLayout);
     
    11421162)
    11431163{
     1164#ifdef GEANT4_QT_DEBUG
     1165  printf("G4UIQt::CommandEnteredCallback\n");
     1166#endif
    11441167#if QT_VERSION < 0x040000
    11451168  G4String command (fCommandArea->text().ascii());
     
    11481171    QListViewItem *newItem = new QListViewItem(fCommandHistoryArea);
    11491172    newItem->setText(0,fCommandArea->text());
     1173    fCommandHistoryArea->insertItem(newItem);
     1174#ifdef GEANT4_QT_DEBUG
     1175  printf("G4UIQt::CommandEnteredCallback 2\n");
     1176#endif
    11501177#else
    11511178  G4String command (fCommandArea->text().toStdString().c_str());
     
    11661193      TerminalHelp(command);
    11671194    }
    1168 #ifdef GEANT4_QT_DEBUG
    1169     printf("after \n");
    1170 #endif
    11711195    if(exitSession==true)
    11721196      SessionTerminate();
     
    12001224)
    12011225{
    1202   //  printf("G4UIQt::HelpTreeClicCallback");
     1226#ifdef GEANT4_QT_DEBUG
     1227  printf("G4UIQt::HelpTreeClicCallback");
     1228#endif
     1229
    12031230#if QT_VERSION < 0x040000
    12041231  QListViewItem* item =  NULL;
     
    12651292#else
    12661293QTreeWidgetItem* item
    1267 #endif
    1268  ,int
    1269 )
    1270 {
    1271 #ifdef GEANT4_QT_DEBUG
    1272   printf("G4UIQt::HelpTreeDoubleClicCallback");
    1273 #endif
     1294,int
     1295#endif
     1296)
     1297{
    12741298  HelpTreeClicCallback();
    12751299  fCommandArea->setText(item->text (1));
  • trunk/geant4/interfaces/basic/src/G4UIQt_moc.cc

    r615 r619  
    1515#include <qapplication.h>
    1616
    17 #if QT_VERSION < 0x040000
     17#if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 26)
    1818
    1919#include <private/qucomextra_p.h>
     
    6666    static const QUMethod slot_4 = {"HelpTreeClicCallback", 0, 0 };
    6767    static const QUParameter param_slot_5[] = {
    68         { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In },
    69         { 0, &static_QUType_int, 0, QUParameter::In }
    70     };
    71     static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 2, param_slot_5 };
     68        { 0, &static_QUType_ptr, "QListViewItem", QUParameter::In }
     69    };
     70    static const QUMethod slot_5 = {"HelpTreeDoubleClicCallback", 1, param_slot_5 };
    7271    static const QUMethod slot_6 = {"ShowHelpCallback", 0, 0 };
    7372    static const QUMethod slot_7 = {"CommandHistoryCallback", 0, 0 };
     
    7877        { "ButtonCallback(const QString&)", &slot_3, QMetaData::Private },
    7978        { "HelpTreeClicCallback()", &slot_4, QMetaData::Private },
    80         { "HelpTreeDoubleClicCallback(QListViewItem*,int)", &slot_5, QMetaData::Private },
     79        { "HelpTreeDoubleClicCallback(QListViewItem*)", &slot_5, QMetaData::Private },
    8180        { "ShowHelpCallback()", &slot_6, QMetaData::Private },
    8281        { "CommandHistoryCallback()", &slot_7, QMetaData::Private }
     
    127126    case 3: ButtonCallback((const QString&)static_QUType_QString.get(_o+1)); break;
    128127    case 4: HelpTreeClicCallback(); break;
    129     case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
     128    case 5: HelpTreeDoubleClicCallback((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    130129    case 6: ShowHelpCallback(); break;
    131130    case 7: CommandHistoryCallback(); break;
     
    160159
    161160
    162 #if QT_VERSION < 0x040200
     161#if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 58)
     162
    163163/****************************************************************************
    164164** Meta object code from reading C++ file 'G4UIQt.hh'
     
    262262#else
    263263
    264 #if QT_VERSION >= 0x040000
     264#if defined(Q_MOC_OUTPUT_REVISION) && (Q_MOC_OUTPUT_REVISION = 59)
     265
    265266/****************************************************************************
    266267** Meta object code from reading C++ file 'G4UIQt.hh'
Note: See TracChangeset for help on using the changeset viewer.