From 319401620f3d23f8259d5c5be692916b2765bd77 Mon Sep 17 00:00:00 2001 From: asv Date: Thu, 4 May 2006 08:11:23 +0000 Subject: [PATCH] Interface of action() virtual function and onAccelAction() has changed: now it returns bool. 'true' return value means that the event (key accelerator action) is handled and should NOT be passed further, 'false' -- event is NOT handled. --- src/SUIT/SUIT_Accel.cxx | 3 +-- src/SUIT/SUIT_ViewWindow.cxx | 7 ++++--- src/SUIT/SUIT_ViewWindow.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SUIT/SUIT_Accel.cxx b/src/SUIT/SUIT_Accel.cxx index a82219550..6d67893a0 100644 --- a/src/SUIT/SUIT_Accel.cxx +++ b/src/SUIT/SUIT_Accel.cxx @@ -120,8 +120,7 @@ bool SUIT_Accel::eventFilter( QObject *obj, QEvent *event ) if ( myMap.contains( type ) ) { IdActionMap idActionMap = myMap[type]; if ( idActionMap.contains( key ) ) { - vw->onAccelAction( idActionMap[key] ); - return true; + return vw->onAccelAction( idActionMap[key] ); } } } diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 0212bc8c9..a0e154a81 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -165,15 +165,16 @@ bool SUIT_ViewWindow::event( QEvent* e ) /*! Called by SUIT_Accel::onActivated() when a key accelerator was activated and this window was active */ -void SUIT_ViewWindow::onAccelAction( int _action ) +bool SUIT_ViewWindow::onAccelAction( int _action ) { - action( _action ); + return action( _action ); } /*! action handle standard action (zoom, pan) or custom action. to be redefined in successors. */ -void SUIT_ViewWindow::action( const int ) +bool SUIT_ViewWindow::action( const int ) { + return true; } /*! diff --git a/src/SUIT/SUIT_ViewWindow.h b/src/SUIT/SUIT_ViewWindow.h index 5be546b76..c32e6776a 100755 --- a/src/SUIT/SUIT_ViewWindow.h +++ b/src/SUIT/SUIT_ViewWindow.h @@ -49,7 +49,7 @@ public: virtual QImage dumpView(); virtual bool dumpViewToFormat( const QString& fileName, const QString& format ); - void onAccelAction( int ); + bool onAccelAction( int ); virtual QString getVisualParameters(); virtual void setVisualParameters( const QString& parameters ); @@ -72,7 +72,7 @@ protected: void closeEvent( QCloseEvent* ); virtual void contextMenuEvent( QContextMenuEvent* ); virtual QString filter() const; - virtual void action( const int ); + virtual bool action( const int ); SUIT_Desktop* myDesktop; SUIT_ViewManager* myManager; -- 2.39.2