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
qautoresetevent_win32.cpp
Go to the documentation of this file.
1
// Copyright (C) 2024 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
4
#
include
"qautoresetevent_win32_p.h"
5
6
#
include
<
QtCore
/
qt_windows
.
h
>
7
#
include
<
QtCore
/
qdebug
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
namespace
QtPrivate
{
12
13
QAutoResetEventWin32
::
QAutoResetEventWin32
(
QObject
*
parent
)
14
:
QObject
{
15
parent
,
16
},
17
m_handle
{
18
nullptr
,
19
}
20
{
21
m_handle
= ::
CreateEventW
(
/*lpEventAttributes=*/
0,
22
/*bManualReset=*/
false
,
23
/*bInitialState=*/
false
,
24
/*lpName=*/
nullptr
);
25
26
if
(!
m_handle
) {
27
qCritical
() <<
"CreateEventW failed:"
<<
qt_error_string
(
GetLastError
());
28
return
;
29
}
30
31
connect
(&
m_notifier
, &
QWinEventNotifier
::
activated
,
this
, &
QAutoResetEventWin32
::
activated
);
32
33
m_notifier
.
setHandle
(
m_handle
);
34
m_notifier
.
setEnabled
(
true
);
35
}
36
37
QAutoResetEventWin32
::~
QAutoResetEventWin32
()
38
{
39
if
(
m_handle
)
40
::
CloseHandle
(
m_handle
);
41
}
42
43
bool
QAutoResetEventWin32
::
isValid
()
const
44
{
45
return
m_handle
;
46
}
47
48
void
QAutoResetEventWin32
::
set
()
49
{
50
Q_ASSERT
(
isValid
());
51
52
bool
status
= ::
SetEvent
(
m_handle
);
53
if
(!
status
)
54
qCritical
(
"QAutoResetEvent::set failed"
);
55
}
56
57
}
// namespace QtPrivate
58
59
QT_END_NAMESPACE
60
61
#
include
"moc_qautoresetevent_win32_p.cpp"
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QtPrivate
Definition
qcompare.h:25
qtmultimedia
src
multimedia
audio
qautoresetevent_win32.cpp
Generated on Mon Mar 10 2025 00:50:43 for Qt by
1.13.2