From f7bea3631dafefd4452f5284e4d38660839e7c0b Mon Sep 17 00:00:00 2001 From: dmv Date: Fri, 5 Feb 2010 09:27:30 +0000 Subject: [PATCH] IPAL21558 In Group creation dialog, selection of sub-shapes in OB, viewer and dialog is not well syncronized --- src/LightApp/LightApp_Selection.cxx | 21 +++++++++++++++++---- src/LightApp/LightApp_Selection.h | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/LightApp/LightApp_Selection.cxx b/src/LightApp/LightApp_Selection.cxx index b39d13121..6931c9585 100644 --- a/src/LightApp/LightApp_Selection.cxx +++ b/src/LightApp/LightApp_Selection.cxx @@ -101,8 +101,14 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr entries.insert( entry, 0 ); myEntries.insert( num, entry ); myIsReferences.insert( num, sowner->entry() != entry ); - processOwner( sowner ); - num++; + if (processOwner( sowner )) { + num++; + } + else { + entries.remove( entry ); + myEntries.remove( num ); + myIsReferences.remove( num ); + } } } } @@ -204,10 +210,17 @@ QVariant LightApp_Selection::parameter( const QString& p ) const } /*! - Do nothing. To be redefined by successors + Perform additional processing of the selected item (to be redefined by successors if necessary). + Returns \c true by default. + Note: if this method returns \c false, the item will be removed from the items list and + not taken into account when showing popup menu. + + \param owner a data owner being processed + \return \c true if the owner should be collected and \c false otherwise */ -void LightApp_Selection::processOwner( const LightApp_DataOwner* ) +bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ ) { + return true; } /*! diff --git a/src/LightApp/LightApp_Selection.h b/src/LightApp/LightApp_Selection.h index 4642a8793..5e2e17a19 100644 --- a/src/LightApp/LightApp_Selection.h +++ b/src/LightApp/LightApp_Selection.h @@ -50,7 +50,7 @@ public: virtual ~LightApp_Selection(); virtual void init( const QString&, LightApp_SelectionMgr* ); - virtual void processOwner( const LightApp_DataOwner* ); + virtual bool processOwner( const LightApp_DataOwner* ); virtual int count() const; virtual QVariant parameter( const int, const QString& ) const; -- 2.39.2