Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohoscloseeventcontext.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5#include <QtCore/qscopeguard.h>
6#include <QtGui/qevent.h>
7#include <stack>
8
9QT_BEGIN_NAMESPACE
10
11namespace {
12
18
20
21}
22
23void QOhosCloseEventContext::runWithCloseRootCauseSet(CloseRootCause rootCause, const std::function<void()> &task)
24{
25 runWithCloseRootCauseAndCloseResolutionConsumerSet(rootCause, makeQOhosNoOpConsumer(), task);
26}
27
28void QOhosCloseEventContext::runWithCloseRootCauseAndCloseResolutionConsumerSet(
29 CloseRootCause rootCause, QOhosConsumer<CloseResolution> closeResolutionConsumer, const std::function<void()> &task)
30{
33 .closeRootCause = rootCause,
34 .closeResolutionConsumer = std::move(closeResolutionConsumer),
35 });
36 auto popGuard = qScopeGuard(
37 [&]() {
39 });
40 task();
41}
42
43QOhosCloseEventContext::CloseRootCause QOhosCloseEventContext::getCloseRootCauseForEventOrDefault(QEvent *event)
44{
45 Q_UNUSED(event);
46 return CloseRootCause::NotSpecified;
47}
48
49void QOhosCloseEventContext::notifyCloseResolutionFromEventIfValid(QEvent *event)
50{
51 Q_UNUSED(event);
52}
53
54QT_END_NAMESPACE
std::stack< EventContextData > eventContextDataStack
QOhosConsumer< QOhosCloseEventContext::CloseResolution > closeResolutionConsumer
QOhosCloseEventContext::CloseRootCause closeRootCause