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
qohosinternalwindowid.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
4
#
include
"qohosinternalwindowid_p.h"
5
6
QT_BEGIN_NAMESPACE
7
8
namespace
QtOhos
{
9
10
InternalWindowId
InternalWindowId
::
generate
()
11
{
12
static
QAtomicInt
winIdGenerator
(
MainWindowId
);
13
return
InternalWindowId
(
winIdGenerator
.
fetchAndAddRelaxed
(1));
14
}
15
16
InternalWindowId
InternalWindowId
::
fromNapiValue
(
QNapi
::
Number
napiWindowId
)
17
{
18
return
InternalWindowId
(
napiWindowId
.
Int32Value
());
19
}
20
21
constexpr
InternalWindowId
::
InternalWindowId
(
int
value
)
22
:
m_value
(
value
)
23
{
24
}
25
26
bool
InternalWindowId
::
operator
==(
const
InternalWindowId
&
other
)
const
27
{
28
return
m_value
==
other
.
m_value
;
29
}
30
31
bool
InternalWindowId
::
operator
!=(
const
InternalWindowId
&
other
)
const
32
{
33
return
m_value
!=
other
.
m_value
;
34
}
35
36
bool
InternalWindowId
::
operator
<(
const
InternalWindowId
&
other
)
const
37
{
38
return
m_value
<
other
.
m_value
;
39
}
40
41
bool
InternalWindowId
::
isMainWindowId
()
const
42
{
43
return
m_value
==
MainWindowId
;
44
}
45
46
bool
InternalWindowId
::
isValid
()
const
47
{
48
return
m_value
!=
InvalidWindowId
;
49
}
50
51
InternalWindowId
InternalWindowId
::
invalidWindowId
()
52
{
53
static
constexpr
InternalWindowId
invalidWindowId
(
InvalidWindowId
);
54
return
invalidWindowId
;
55
}
56
57
QNapi
::
Number
InternalWindowId
::
toNapiValue
(
napi_env
env
)
const
58
{
59
return
QNapi
::
Number
::
New
(
env
,
m_value
);
60
}
61
62
QString
InternalWindowId
::
toString
()
const
63
{
64
return
QString
::
fromUtf8
(
"WIID_%1"
)
65
.
arg
(
66
isValid
()
67
?
isMainWindowId
()
68
?
QString
::
fromUtf8
(
"MainWindow"
)
69
:
QString
::
number
(
m_value
)
70
:
QString
::
fromUtf8
(
"Invalid"
));
71
}
72
73
std
::
string
InternalWindowId
::
toStdString
()
const
74
{
75
return
toString
().
toStdString
();
76
}
77
78
}
79
80
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtOhos
Definition
qcore_ohos.cpp:52
qtbase
src
plugins
platforms
ohos
qohosinternalwindowid.cpp
Generated on
for Qt by
1.16.1