ACF $AcfVersion:0$
CSignalBlocker.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QObject>
7
8// ACF includes
9#include <iqt/iqt.h>
10
11
12namespace iqt
13{
14
15
131{
132public:
133
164 CSignalBlocker(QObject* objectPtr, bool blockChilds = false);
165
180
181private:
188 void BlockChilds(QObject* objectPtr, bool block);
189
190private:
191 QObject* m_objectPtr;
192 bool m_blockChilds;
193};
194
195
196} // namespace iqt
197
198
199
RAII helper class for temporarily blocking Qt signals from QObjects.
virtual ~CSignalBlocker()
Destroys the signal blocker and restores the previous signal blocking state.
CSignalBlocker(QObject *objectPtr, bool blockChilds=false)
Constructs a signal blocker and immediately blocks signals on the specified object.
This namespace contains non-UI utility classes based on Qt.