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
qohospositioncommon.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
"qohospositioncommon.h"
5
#
include
<
QtCore
/
private
/
qohoscommon_p
.
h
>
6
#
include
<
QtCore
/
qcoreapplication
.
h
>
7
#
include
<
QtCore
/
qpermissions
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
QNapi::Object getGeoLocationManagerObject(QOhosJsState &jsState)
12
{
13
return
jsState.eval<QNapi::Object>(
"@ohos.geoLocationManager"
);
14
}
15
16
bool
checkLocationOrApproximatelyLocationPermissionGranted
()
17
{
18
if
(!qApp)
19
return
false
;
20
21
QLocationPermission perm;
22
return
qApp->checkPermission(perm) == Qt::PermissionStatus::Granted;
23
}
24
25
std
::
unique_ptr
<
QTimer
>
makeSingleShotUpdateTimeoutTimer
(
26
int
timeoutMs, std::function<
void
()> timeoutCallback)
27
{
28
auto
timer = std::make_unique<QTimer>();
29
timer->setSingleShot(
true
);
30
timer->setInterval(timeoutMs);
31
QObject::connect(timer.get(), &QTimer::timeout, timer.get(), std::move(timeoutCallback));
32
timer->start();
33
return
timer;
34
}
35
36
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
makeSingleShotUpdateTimeoutTimer
std::unique_ptr< QTimer > makeSingleShotUpdateTimeoutTimer(int timeoutMs, std::function< void()> timeoutCallback)
Definition
qohospositioncommon.cpp:25
checkLocationOrApproximatelyLocationPermissionGranted
bool checkLocationOrApproximatelyLocationPermissionGranted()
Definition
qohospositioncommon.cpp:16
qtpositioning
src
plugins
position
ohos
qohospositioncommon.cpp
Generated on
for Qt by
1.16.1