From 08016364e84b8915cb595ad1455ad0d559e52869 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sat, 26 Jul 2008 09:33:12 -0700 Subject: [PATCH] Fix configure hotkeys behaviour on keyboard seection. Close #1773 --- modules/gui/qt4/components/preferences_widgets.cpp | 8 +++++--- modules/gui/qt4/components/preferences_widgets.hpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index a72e7ea3db..7ff6aea516 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -1193,16 +1193,18 @@ void KeySelectorControl::finish() table->resizeColumnToContents( 0 ); - CONNECT( table, itemClicked( QTreeWidgetItem *, int ), - this, select1Key( QTreeWidgetItem * ) ); CONNECT( table, itemDoubleClicked( QTreeWidgetItem *, int ), this, selectKey( QTreeWidgetItem * ) ); + CONNECT( table, itemSelectionChanged (), + this, select1Key() ); + CONNECT( shortcutValue, pressed(), this, selectKey() ); } /* Show the key selected from the table in the keySelector */ -void KeySelectorControl::select1Key( QTreeWidgetItem *keyItem ) +void KeySelectorControl::select1Key() { + QTreeWidgetItem *keyItem = table->currentItem(); shortcutValue->setText( keyItem->text( 1 ) ); shortcutValue->setValue( keyItem->data( 1, Qt::UserRole ).toInt() ); } diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index 4e42cd2e07..715f26afd1 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -457,7 +457,7 @@ private: private slots: void setTheKey(); void selectKey( QTreeWidgetItem * = NULL ); - void select1Key( QTreeWidgetItem *); + void select1Key(); }; class KeyInputDialog : public QDialog -- 2.39.2