CNodeSelection: Make use of QSignalBlocker
This commit is contained in:
parent
207a378c79
commit
978627d14e
|
@ -6,6 +6,7 @@
|
|||
#include <Core/Scene/CScriptNode.h>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QSignalBlocker>
|
||||
|
||||
class CNodeSelection : public QObject
|
||||
{
|
||||
|
@ -61,20 +62,23 @@ public:
|
|||
void ClearAndSelectNode(CSceneNode *pNode)
|
||||
{
|
||||
// Block signals for Clear so that Modified only emits once.
|
||||
blockSignals(true);
|
||||
{
|
||||
[[maybe_unused]] const QSignalBlocker blocker{this};
|
||||
Clear();
|
||||
blockSignals(false);
|
||||
}
|
||||
|
||||
SelectNode(pNode);
|
||||
}
|
||||
|
||||
void SetSelectedNodes(const QList<CSceneNode*>& rkList)
|
||||
{
|
||||
blockSignals(true);
|
||||
{
|
||||
[[maybe_unused]] const QSignalBlocker blocker{this};
|
||||
Clear();
|
||||
|
||||
for (CSceneNode* pNode : rkList)
|
||||
SelectNode(pNode);
|
||||
blockSignals(false);
|
||||
}
|
||||
|
||||
mBoundsDirty = true;
|
||||
emit Modified();
|
||||
|
|
Loading…
Reference in New Issue