From 93a0803827911b93c9fc40ff82b965f4b6ad1a3f Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 9 Dec 2008 13:56:25 +0000 Subject: [PATCH] Qt4 porting: Registry Dialog regression --- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 18 ++++++++++-------- src/TOOLSGUI/ToolsGUI_RegWidget.h | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index 47d48a94e..8c7fca354 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -543,8 +543,8 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent ) _tabWidget->addTab( _clients, tr( "Running" ) ); _tabWidget->addTab( _history, tr( "History" ) ); connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) ); - connect( _clients, SIGNAL( clicked( QTreeWidgetItem* ) ), this, SLOT( slotClientChanged( QTreeWidgetItem* ) ) ); - connect( _history, SIGNAL( clicked( QTreeWidgetItem* ) ), this, SLOT( slotHistoryChanged( QTreeWidgetItem* ) ) ); + connect( _clients, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( slotClientChanged( QTreeWidgetItem* , int ) ) ); + connect( _history, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( slotHistoryChanged( QTreeWidgetItem* , int ) ) ); setCentralWidget( _tabWidget ); // Timer definition (used to automaticaly refresh the display area) @@ -560,6 +560,8 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent ) setGeometry( xpos, ypos, largeur, hauteur ) ; setWindowTitle( tr( "Registry" ) ) ; statusBar()->showMessage(" "); + + slotListeSelect(); } /*! @@ -592,13 +594,13 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event ) else if ( object == _clients && event->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)event; if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) { - slotClientChanged( _clients->currentItem() ); + slotClientChanged( _clients->currentItem(), 0 ); } } else if ( object == _history && event->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)event; if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) { - slotHistoryChanged( _history->currentItem() ); + slotHistoryChanged( _history->currentItem(), 0 ); } } } @@ -883,9 +885,9 @@ void ToolsGUI_RegWidget::slotHelp() \brief Called when user clicks on item in \c Running list \param item item clicked by the user */ -void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item ) +void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item, int col ) { - if ( item <= 0) + if ( !item || col < 0 ) return; blockSignals( true ); // for sure that item will not be deleted when refreshing @@ -917,9 +919,9 @@ void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item ) \brief Called when user clicks on item in \c History list \param item item clicked by the user */ -void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item ) +void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item, int col ) { - if ( item <= 0) + if ( !item || col < 0 ) return; blockSignals( true ); // for sure that item will not be deleted when refreshing diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.h b/src/TOOLSGUI/ToolsGUI_RegWidget.h index c11b214ab..1c9b3d549 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.h +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.h @@ -69,8 +69,8 @@ public: public slots: void slotHelp(); void slotListeSelect(); - void slotClientChanged( QTreeWidgetItem* ); - void slotHistoryChanged( QTreeWidgetItem* ); + void slotClientChanged( QTreeWidgetItem*, int ); + void slotHistoryChanged( QTreeWidgetItem*, int ); void slotSelectRefresh(); void slotIntervalOk(); -- 2.39.2