From: stv Date: Fri, 15 Jun 2007 07:58:00 +0000 (+0000) Subject: no message X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5fb553c7b535a75b6208cc1fcb1efface5720591;p=modules%2Fgui.git no message --- diff --git a/src/Qtx/QtxPopupMgr.cxx b/src/Qtx/QtxPopupMgr.cxx index 018f205e5..accc7ee18 100644 --- a/src/Qtx/QtxPopupMgr.cxx +++ b/src/Qtx/QtxPopupMgr.cxx @@ -282,8 +282,13 @@ void QtxPopupMgr::setSelection( QtxPopupSelection* sel ) if ( mySelection == sel ) return; + delete mySelection; + mySelection = sel; + if ( mySelection ) + mySelection->setParent( this ); + QtxActionMgr::triggerUpdate(); } @@ -488,18 +493,18 @@ bool QtxPopupMgr::isSatisfied( QAction* act, const RuleType ruleType ) const for ( int i = 0; i < mySelection->count() && !res; i++ ) { QList c; - for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 ) + for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 ) c.append( parameter( *anIt1, i ) ); aCorteges.insert( c, 0 ); } for ( QMap, int>::const_iterator anIt = aCorteges.begin(); anIt != aCorteges.end(); ++anIt ) { - const QList& aCortege = anIt.key(); - QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end(); - QList::const_iterator anIt2 = aCortege.begin(); - for ( ; anIt1 != aLast1; anIt1++, anIt2++ ) - p->setParameter( *anIt1, *anIt2 ); - res = res || result( p ); + const QList& aCortege = anIt.key(); + QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end(); + QList::const_iterator anIt2 = aCortege.begin(); + for ( ; anIt1 != aLast1; anIt1++, anIt2++ ) + p->setParameter( *anIt1, *anIt2 ); + res = res || result( p ); } } else @@ -635,6 +640,7 @@ QVariant QtxPopupMgr::parameter( const QString& name, const int idx ) const \brief Constructor. */ QtxPopupSelection::QtxPopupSelection() +: QObject( 0 ) { } diff --git a/src/Qtx/QtxPopupMgr.h b/src/Qtx/QtxPopupMgr.h index 1d79acae3..97188b1cb 100644 --- a/src/Qtx/QtxPopupMgr.h +++ b/src/Qtx/QtxPopupMgr.h @@ -95,8 +95,10 @@ private: QtxPopupSelection* mySelection; }; -class QTX_EXPORT QtxPopupSelection +class QTX_EXPORT QtxPopupSelection : public QObject { + Q_OBJECT + public: QtxPopupSelection(); virtual ~QtxPopupSelection();