if ( mySelection )
mySelection->setParent( this );
+ connect( mySelection, SIGNAL( destroyed( QObject* ) ),
+ this, SLOT( onSelectionDestroyed( QObject* ) ) );
QtxActionMgr::triggerUpdate();
}
return val;
}
+/*!
+ \brief Called when selection is destroyed.
+
+ Prevents crashes when the selection object is destroyed outside the
+ popup manager.
+
+ \param o selection object being destroyed
+*/
+void QtxPopupMgr::onSelectionDestroyed( QObject* o )
+{
+ if ( o == mySelection )
+ mySelection = 0;
+}
+
/*!
\class QtxPopupSelection
\brief This class is a part of the popup menu management system.
bool result( QtxEvalParser* p ) const;
QVariant parameter( const QString&, const int = -1 ) const;
+private slots:
+ void onSelectionDestroyed( QObject* );
+
private:
typedef QMap<RuleType, QtxEvalExpr*> ExprMap;
typedef QMap<QAction*, ExprMap> RuleMap;