CNodeSelection: Make use of QSignalBlocker
#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();
