From 0dc66049d55251362cbf4b330c6201225e156108 Mon Sep 17 00:00:00 2001 From: stv Date: Mon, 9 Apr 2012 12:41:54 +0000 Subject: [PATCH] Fix for ATLAS bug #1907. When Shortcut edit tree view lost input focus currently selected item returns the initial shortcut value. Now the focusOut() method checks the necessity of selected item resetting to initial state. --- src/Qtx/QtxShortcutEdit.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Qtx/QtxShortcutEdit.cxx b/src/Qtx/QtxShortcutEdit.cxx index 3578e8f29..e1aaf2b70 100755 --- a/src/Qtx/QtxShortcutEdit.cxx +++ b/src/Qtx/QtxShortcutEdit.cxx @@ -301,7 +301,7 @@ void QtxShortcutTree::setBindings( const QString& title, const ShortcutMap& theS } for( ShortcutMap::const_iterator it = theShortcutMap.constBegin(); it != theShortcutMap.constEnd(); ++it ) item->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) ); - myPrevBindings.insert( title, theShortcutMap); + myPrevBindings.insert( title, theShortcutMap ); } /*! @@ -333,7 +333,8 @@ ShortcutMap* QtxShortcutTree::bindings( const QString& sec ) const void QtxShortcutTree::focusOutEvent ( QFocusEvent* event ) { QWidget::focusOutEvent( event ); - if ( currentItem() && currentItem()->isSelected() ) + + if ( currentItem() && currentItem()->isSelected() && currentItem()->text( 1 ).endsWith( "+" ) ) currentItem()->setText( 1, myPrevBindings[ currentItem()->parent()->text( 0 ) ][ currentItem()->text( 0 ) ] ); } -- 2.39.2