]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for ATLAS bug #1907.
authorstv <stv@opencascade.com>
Mon, 9 Apr 2012 12:41:54 +0000 (12:41 +0000)
committerstv <stv@opencascade.com>
Mon, 9 Apr 2012 12:41:54 +0000 (12:41 +0000)
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

index 3578e8f296f134ab438054b4d416b9d17d52acef..e1aaf2b70770a55fc3462f96560b0c307866a295 100755 (executable)
@@ -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 ) ] );
 }