Guard: Make it possible to lock/unlock manually

Use it in some KitAspectWidget subclasses.

Change-Id: Ie683d5af6a44d0042456418af729a3d718396803
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-07-22 11:54:45 +02:00
parent 3f05594db1
commit 063efbe693
3 changed files with 25 additions and 8 deletions

View File

@@ -97,6 +97,17 @@ bool Guard::isLocked() const
return m_lockCount;
}
void Guard::lock()
{
++m_lockCount;
}
void Guard::unlock()
{
QTC_CHECK(m_lockCount > 0);
--m_lockCount;
}
GuardLocker::GuardLocker(Guard &guard)
: m_guard(guard)
{