]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
refs #2881 Possibility of deleting shortcuts for the Search Tool added
authorsbh <sbh@opencascade.com>
Fri, 1 Feb 2013 11:42:04 +0000 (11:42 +0000)
committersbh <sbh@opencascade.com>
Fri, 1 Feb 2013 11:42:04 +0000 (11:42 +0000)
src/Qtx/QtxSearchTool.cxx
src/Qtx/QtxSearchTool.h

index 674a91e79699c2914533406e8a5abb36727308ff..0a58da5d34d972b4a874b308863c650d78472214 100644 (file)
@@ -472,6 +472,25 @@ void QtxSearchTool::setShortcuts( const QList<QKeySequence>& accels )
   initShortcuts( accels );
 }
 
+/*!
+  \brief Delete shortcut.
+  \param accel shortcut bindings to be deleted
+  \sa shortcuts()
+*/
+void QtxSearchTool::deleteShortcut( const QKeySequence& accel  )
+{
+  ShortcutList::Iterator it;
+  for ( it = myShortcuts.begin(); it != myShortcuts.end(); ++it )
+  {
+    if ( !(*it).isNull() )
+    {
+      QShortcut* sc = (*it);
+      if ( sc->key() == accel )
+        delete sc;
+    }
+  }
+}
+
 /*!
   \brief Add custom widget.
   \param w custom widget to be added
index cb2694f802907a7a1da254e3a354bc5ccabe3331..9e489b36d521017483b124358064d83ff1b457d9 100644 (file)
@@ -99,6 +99,7 @@ public:
   QList<QKeySequence> shortcuts() const;
   void                setShortcuts( const QKeySequence& );
   void                setShortcuts( const QList<QKeySequence>& );
+  void                deleteShortcut( const QKeySequence& );
 
   int                 addCustomWidget( QWidget*, int = -1 );
   QWidget*            customWidget( int ) const;