QtSensors.pyi 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. # The PEP 484 type hints stub file for the QtSensors module.
  2. #
  3. # Generated by SIP 6.15.3
  4. #
  5. # Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. #
  7. # This file is part of PyQt6.
  8. #
  9. # This file may be used under the terms of the GNU General Public License
  10. # version 3.0 as published by the Free Software Foundation and appearing in
  11. # the file LICENSE included in the packaging of this file. Please review the
  12. # following information to ensure the GNU General Public License version 3.0
  13. # requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. #
  15. # If you do not wish to use this file under the terms of the GPL version 3.0
  16. # then you may purchase a commercial license. For more information contact
  17. # info@riverbankcomputing.com.
  18. #
  19. # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. import collections, re, typing, enum
  22. try:
  23. from warnings import deprecated
  24. except ImportError:
  25. pass
  26. import PyQt6.sip
  27. from PyQt6 import QtCore
  28. # Support for QDate, QDateTime and QTime.
  29. import datetime
  30. # Convenient type aliases.
  31. PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
  32. PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], QtCore.pyqtBoundSignal]
  33. class QSensorReading(QtCore.QObject):
  34. def value(self, index: int) -> typing.Any: ...
  35. def valueCount(self) -> int: ...
  36. def setTimestamp(self, timestamp: int) -> None: ...
  37. def timestamp(self) -> int: ...
  38. class QAccelerometerReading(QSensorReading):
  39. def setZ(self, z: float) -> None: ...
  40. def z(self) -> float: ...
  41. def setY(self, y: float) -> None: ...
  42. def y(self) -> float: ...
  43. def setX(self, x: float) -> None: ...
  44. def x(self) -> float: ...
  45. class QSensorFilter(PyQt6.sip.simplewrapper):
  46. @typing.overload
  47. def __init__(self) -> None: ...
  48. @typing.overload
  49. def __init__(self, a0: 'QSensorFilter') -> None: ...
  50. def filter(self, reading: QSensorReading|None) -> bool: ...
  51. class QAccelerometerFilter(QSensorFilter):
  52. @typing.overload
  53. def __init__(self) -> None: ...
  54. @typing.overload
  55. def __init__(self, a0: 'QAccelerometerFilter') -> None: ...
  56. def filter(self, reading: QAccelerometerReading|None) -> bool: ...
  57. class QSensor(QtCore.QObject):
  58. class AxesOrientationMode(enum.Enum):
  59. FixedOrientation = ... # type: QSensor.AxesOrientationMode
  60. AutomaticOrientation = ... # type: QSensor.AxesOrientationMode
  61. UserOrientation = ... # type: QSensor.AxesOrientationMode
  62. class Feature(enum.Enum):
  63. Buffering = ... # type: QSensor.Feature
  64. AlwaysOn = ... # type: QSensor.Feature
  65. GeoValues = ... # type: QSensor.Feature
  66. FieldOfView = ... # type: QSensor.Feature
  67. AccelerationMode = ... # type: QSensor.Feature
  68. SkipDuplicates = ... # type: QSensor.Feature
  69. AxesOrientation = ... # type: QSensor.Feature
  70. PressureSensorTemperature = ... # type: QSensor.Feature
  71. def __init__(self, type: QtCore.QByteArray|bytes|bytearray|memoryview, parent: QtCore.QObject|None = ...) -> None: ...
  72. identifierChanged: typing.ClassVar[QtCore.pyqtSignal]
  73. bufferSizeChanged: typing.ClassVar[QtCore.pyqtSignal]
  74. efficientBufferSizeChanged: typing.ClassVar[QtCore.pyqtSignal]
  75. maxBufferSizeChanged: typing.ClassVar[QtCore.pyqtSignal]
  76. userOrientationChanged: typing.ClassVar[QtCore.pyqtSignal]
  77. currentOrientationChanged: typing.ClassVar[QtCore.pyqtSignal]
  78. axesOrientationModeChanged: typing.ClassVar[QtCore.pyqtSignal]
  79. skipDuplicatesChanged: typing.ClassVar[QtCore.pyqtSignal]
  80. dataRateChanged: typing.ClassVar[QtCore.pyqtSignal]
  81. alwaysOnChanged: typing.ClassVar[QtCore.pyqtSignal]
  82. availableSensorsChanged: typing.ClassVar[QtCore.pyqtSignal]
  83. sensorError: typing.ClassVar[QtCore.pyqtSignal]
  84. readingChanged: typing.ClassVar[QtCore.pyqtSignal]
  85. activeChanged: typing.ClassVar[QtCore.pyqtSignal]
  86. busyChanged: typing.ClassVar[QtCore.pyqtSignal]
  87. def stop(self) -> None: ...
  88. def start(self) -> bool: ...
  89. def setBufferSize(self, bufferSize: int) -> None: ...
  90. def bufferSize(self) -> int: ...
  91. def setEfficientBufferSize(self, efficientBufferSize: int) -> None: ...
  92. def efficientBufferSize(self) -> int: ...
  93. def setMaxBufferSize(self, maxBufferSize: int) -> None: ...
  94. def maxBufferSize(self) -> int: ...
  95. def setUserOrientation(self, userOrientation: int) -> None: ...
  96. def userOrientation(self) -> int: ...
  97. def setCurrentOrientation(self, currentOrientation: int) -> None: ...
  98. def currentOrientation(self) -> int: ...
  99. def setAxesOrientationMode(self, axesOrientationMode: 'QSensor.AxesOrientationMode') -> None: ...
  100. def axesOrientationMode(self) -> 'QSensor.AxesOrientationMode': ...
  101. def isFeatureSupported(self, feature: 'QSensor.Feature') -> bool: ...
  102. @staticmethod
  103. def defaultSensorForType(type: QtCore.QByteArray|bytes|bytearray|memoryview) -> QtCore.QByteArray: ...
  104. @staticmethod
  105. def sensorsForType(type: QtCore.QByteArray|bytes|bytearray|memoryview) -> list[QtCore.QByteArray]: ...
  106. @staticmethod
  107. def sensorTypes() -> list[QtCore.QByteArray]: ...
  108. def reading(self) -> QSensorReading|None: ...
  109. def filters(self) -> list[QSensorFilter]: ...
  110. def removeFilter(self, filter: QSensorFilter|None) -> None: ...
  111. def addFilter(self, filter: QSensorFilter|None) -> None: ...
  112. def error(self) -> int: ...
  113. def description(self) -> str: ...
  114. def setOutputRange(self, index: int) -> None: ...
  115. def outputRange(self) -> int: ...
  116. def outputRanges(self) -> list['qoutputrange']: ...
  117. def setDataRate(self, rate: int) -> None: ...
  118. def dataRate(self) -> int: ...
  119. def availableDataRates(self) -> list[tuple[int, int]]: ...
  120. def setSkipDuplicates(self, skipDuplicates: bool) -> None: ...
  121. def skipDuplicates(self) -> bool: ...
  122. def setAlwaysOn(self, alwaysOn: bool) -> None: ...
  123. def isAlwaysOn(self) -> bool: ...
  124. def isActive(self) -> bool: ...
  125. def setActive(self, active: bool) -> None: ...
  126. def isBusy(self) -> bool: ...
  127. def isConnectedToBackend(self) -> bool: ...
  128. def connectToBackend(self) -> bool: ...
  129. def type(self) -> QtCore.QByteArray: ...
  130. def setIdentifier(self, identifier: QtCore.QByteArray|bytes|bytearray|memoryview) -> None: ...
  131. def identifier(self) -> QtCore.QByteArray: ...
  132. class QAccelerometer(QSensor):
  133. class AccelerationMode(enum.Enum):
  134. Combined = ... # type: QAccelerometer.AccelerationMode
  135. Gravity = ... # type: QAccelerometer.AccelerationMode
  136. User = ... # type: QAccelerometer.AccelerationMode
  137. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  138. accelerationModeChanged: typing.ClassVar[QtCore.pyqtSignal]
  139. def reading(self) -> QAccelerometerReading|None: ...
  140. def setAccelerationMode(self, accelerationMode: 'QAccelerometer.AccelerationMode') -> None: ...
  141. def accelerationMode(self) -> 'QAccelerometer.AccelerationMode': ...
  142. class QAmbientLightReading(QSensorReading):
  143. class LightLevel(enum.Enum):
  144. Undefined = ... # type: QAmbientLightReading.LightLevel
  145. Dark = ... # type: QAmbientLightReading.LightLevel
  146. Twilight = ... # type: QAmbientLightReading.LightLevel
  147. Light = ... # type: QAmbientLightReading.LightLevel
  148. Bright = ... # type: QAmbientLightReading.LightLevel
  149. Sunny = ... # type: QAmbientLightReading.LightLevel
  150. def setLightLevel(self, lightLevel: 'QAmbientLightReading.LightLevel') -> None: ...
  151. def lightLevel(self) -> 'QAmbientLightReading.LightLevel': ...
  152. class QAmbientLightFilter(QSensorFilter):
  153. @typing.overload
  154. def __init__(self) -> None: ...
  155. @typing.overload
  156. def __init__(self, a0: 'QAmbientLightFilter') -> None: ...
  157. def filter(self, reading: QAmbientLightReading|None) -> bool: ...
  158. class QAmbientLightSensor(QSensor):
  159. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  160. def reading(self) -> QAmbientLightReading|None: ...
  161. class QAmbientTemperatureReading(QSensorReading):
  162. def setTemperature(self, temperature: float) -> None: ...
  163. def temperature(self) -> float: ...
  164. class QAmbientTemperatureFilter(QSensorFilter):
  165. @typing.overload
  166. def __init__(self) -> None: ...
  167. @typing.overload
  168. def __init__(self, a0: 'QAmbientTemperatureFilter') -> None: ...
  169. def filter(self, reading: QAmbientTemperatureReading|None) -> bool: ...
  170. class QAmbientTemperatureSensor(QSensor):
  171. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  172. def reading(self) -> QAmbientTemperatureReading|None: ...
  173. class QCompassReading(QSensorReading):
  174. def setCalibrationLevel(self, calibrationLevel: float) -> None: ...
  175. def calibrationLevel(self) -> float: ...
  176. def setAzimuth(self, azimuth: float) -> None: ...
  177. def azimuth(self) -> float: ...
  178. class QCompassFilter(QSensorFilter):
  179. @typing.overload
  180. def __init__(self) -> None: ...
  181. @typing.overload
  182. def __init__(self, a0: 'QCompassFilter') -> None: ...
  183. def filter(self, reading: QCompassReading|None) -> bool: ...
  184. class QCompass(QSensor):
  185. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  186. def reading(self) -> QCompassReading|None: ...
  187. class QGyroscopeReading(QSensorReading):
  188. def setZ(self, z: float) -> None: ...
  189. def z(self) -> float: ...
  190. def setY(self, y: float) -> None: ...
  191. def y(self) -> float: ...
  192. def setX(self, x: float) -> None: ...
  193. def x(self) -> float: ...
  194. class QGyroscopeFilter(QSensorFilter):
  195. @typing.overload
  196. def __init__(self) -> None: ...
  197. @typing.overload
  198. def __init__(self, a0: 'QGyroscopeFilter') -> None: ...
  199. def filter(self, reading: QGyroscopeReading|None) -> bool: ...
  200. class QGyroscope(QSensor):
  201. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  202. def reading(self) -> QGyroscopeReading|None: ...
  203. class QHumidityReading(QSensorReading):
  204. def setAbsoluteHumidity(self, value: float) -> None: ...
  205. def absoluteHumidity(self) -> float: ...
  206. def setRelativeHumidity(self, percent: float) -> None: ...
  207. def relativeHumidity(self) -> float: ...
  208. class QHumidityFilter(QSensorFilter):
  209. @typing.overload
  210. def __init__(self) -> None: ...
  211. @typing.overload
  212. def __init__(self, a0: 'QHumidityFilter') -> None: ...
  213. def filter(self, reading: QHumidityReading|None) -> bool: ...
  214. class QHumiditySensor(QSensor):
  215. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  216. def reading(self) -> QHumidityReading|None: ...
  217. class QIRProximityReading(QSensorReading):
  218. def setReflectance(self, reflectance: float) -> None: ...
  219. def reflectance(self) -> float: ...
  220. class QIRProximityFilter(QSensorFilter):
  221. @typing.overload
  222. def __init__(self) -> None: ...
  223. @typing.overload
  224. def __init__(self, a0: 'QIRProximityFilter') -> None: ...
  225. def filter(self, reading: QIRProximityReading|None) -> bool: ...
  226. class QIRProximitySensor(QSensor):
  227. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  228. def reading(self) -> QIRProximityReading|None: ...
  229. class QLidReading(QSensorReading):
  230. frontLidChanged: typing.ClassVar[QtCore.pyqtSignal]
  231. backLidChanged: typing.ClassVar[QtCore.pyqtSignal]
  232. def setFrontLidClosed(self, closed: bool) -> None: ...
  233. def frontLidClosed(self) -> bool: ...
  234. def setBackLidClosed(self, closed: bool) -> None: ...
  235. def backLidClosed(self) -> bool: ...
  236. class QLidFilter(QSensorFilter):
  237. @typing.overload
  238. def __init__(self) -> None: ...
  239. @typing.overload
  240. def __init__(self, a0: 'QLidFilter') -> None: ...
  241. def filter(self, reading: QLidReading|None) -> bool: ...
  242. class QLidSensor(QSensor):
  243. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  244. def reading(self) -> QLidReading|None: ...
  245. class QLightReading(QSensorReading):
  246. def setLux(self, lux: float) -> None: ...
  247. def lux(self) -> float: ...
  248. class QLightFilter(QSensorFilter):
  249. @typing.overload
  250. def __init__(self) -> None: ...
  251. @typing.overload
  252. def __init__(self, a0: 'QLightFilter') -> None: ...
  253. def filter(self, reading: QLightReading|None) -> bool: ...
  254. class QLightSensor(QSensor):
  255. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  256. fieldOfViewChanged: typing.ClassVar[QtCore.pyqtSignal]
  257. def setFieldOfView(self, fieldOfView: float) -> None: ...
  258. def fieldOfView(self) -> float: ...
  259. def reading(self) -> QLightReading|None: ...
  260. class QMagnetometerReading(QSensorReading):
  261. def setCalibrationLevel(self, calibrationLevel: float) -> None: ...
  262. def calibrationLevel(self) -> float: ...
  263. def setZ(self, z: float) -> None: ...
  264. def z(self) -> float: ...
  265. def setY(self, y: float) -> None: ...
  266. def y(self) -> float: ...
  267. def setX(self, x: float) -> None: ...
  268. def x(self) -> float: ...
  269. class QMagnetometerFilter(QSensorFilter):
  270. @typing.overload
  271. def __init__(self) -> None: ...
  272. @typing.overload
  273. def __init__(self, a0: 'QMagnetometerFilter') -> None: ...
  274. def filter(self, reading: QMagnetometerReading|None) -> bool: ...
  275. class QMagnetometer(QSensor):
  276. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  277. returnGeoValuesChanged: typing.ClassVar[QtCore.pyqtSignal]
  278. def setReturnGeoValues(self, returnGeoValues: bool) -> None: ...
  279. def returnGeoValues(self) -> bool: ...
  280. def reading(self) -> QMagnetometerReading|None: ...
  281. class QOrientationReading(QSensorReading):
  282. class Orientation(enum.Enum):
  283. Undefined = ... # type: QOrientationReading.Orientation
  284. TopUp = ... # type: QOrientationReading.Orientation
  285. TopDown = ... # type: QOrientationReading.Orientation
  286. LeftUp = ... # type: QOrientationReading.Orientation
  287. RightUp = ... # type: QOrientationReading.Orientation
  288. FaceUp = ... # type: QOrientationReading.Orientation
  289. FaceDown = ... # type: QOrientationReading.Orientation
  290. def setOrientation(self, orientation: 'QOrientationReading.Orientation') -> None: ...
  291. def orientation(self) -> 'QOrientationReading.Orientation': ...
  292. class QOrientationFilter(QSensorFilter):
  293. @typing.overload
  294. def __init__(self) -> None: ...
  295. @typing.overload
  296. def __init__(self, a0: 'QOrientationFilter') -> None: ...
  297. def filter(self, reading: QOrientationReading|None) -> bool: ...
  298. class QOrientationSensor(QSensor):
  299. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  300. def reading(self) -> QOrientationReading|None: ...
  301. class QPressureReading(QSensorReading):
  302. def setTemperature(self, temperature: float) -> None: ...
  303. def temperature(self) -> float: ...
  304. def setPressure(self, pressure: float) -> None: ...
  305. def pressure(self) -> float: ...
  306. class QPressureFilter(QSensorFilter):
  307. @typing.overload
  308. def __init__(self) -> None: ...
  309. @typing.overload
  310. def __init__(self, a0: 'QPressureFilter') -> None: ...
  311. def filter(self, reading: QPressureReading|None) -> bool: ...
  312. class QPressureSensor(QSensor):
  313. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  314. def reading(self) -> QPressureReading|None: ...
  315. class QProximityReading(QSensorReading):
  316. def setClose(self, close: bool) -> None: ...
  317. def close(self) -> bool: ...
  318. class QProximityFilter(QSensorFilter):
  319. @typing.overload
  320. def __init__(self) -> None: ...
  321. @typing.overload
  322. def __init__(self, a0: 'QProximityFilter') -> None: ...
  323. def filter(self, reading: QProximityReading|None) -> bool: ...
  324. class QProximitySensor(QSensor):
  325. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  326. def reading(self) -> QProximityReading|None: ...
  327. class QRotationReading(QSensorReading):
  328. def setFromEuler(self, x: float, y: float, z: float) -> None: ...
  329. def z(self) -> float: ...
  330. def y(self) -> float: ...
  331. def x(self) -> float: ...
  332. class QRotationFilter(QSensorFilter):
  333. @typing.overload
  334. def __init__(self) -> None: ...
  335. @typing.overload
  336. def __init__(self, a0: 'QRotationFilter') -> None: ...
  337. def filter(self, reading: QRotationReading|None) -> bool: ...
  338. class QRotationSensor(QSensor):
  339. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  340. hasZChanged: typing.ClassVar[QtCore.pyqtSignal]
  341. def setHasZ(self, hasZ: bool) -> None: ...
  342. def hasZ(self) -> bool: ...
  343. def reading(self) -> QRotationReading|None: ...
  344. class qoutputrange(PyQt6.sip.simplewrapper):
  345. accuracy = ... # type: float
  346. maximum = ... # type: float
  347. minimum = ... # type: float
  348. @typing.overload
  349. def __init__(self) -> None: ...
  350. @typing.overload
  351. def __init__(self, a0: 'qoutputrange') -> None: ...
  352. class QTapReading(QSensorReading):
  353. class TapDirection(enum.Enum):
  354. Undefined = ... # type: QTapReading.TapDirection
  355. X = ... # type: QTapReading.TapDirection
  356. Y = ... # type: QTapReading.TapDirection
  357. Z = ... # type: QTapReading.TapDirection
  358. X_Pos = ... # type: QTapReading.TapDirection
  359. Y_Pos = ... # type: QTapReading.TapDirection
  360. Z_Pos = ... # type: QTapReading.TapDirection
  361. X_Neg = ... # type: QTapReading.TapDirection
  362. Y_Neg = ... # type: QTapReading.TapDirection
  363. Z_Neg = ... # type: QTapReading.TapDirection
  364. X_Both = ... # type: QTapReading.TapDirection
  365. Y_Both = ... # type: QTapReading.TapDirection
  366. Z_Both = ... # type: QTapReading.TapDirection
  367. def setDoubleTap(self, doubleTap: bool) -> None: ...
  368. def isDoubleTap(self) -> bool: ...
  369. def setTapDirection(self, tapDirection: 'QTapReading.TapDirection') -> None: ...
  370. def tapDirection(self) -> 'QTapReading.TapDirection': ...
  371. class QTapFilter(QSensorFilter):
  372. @typing.overload
  373. def __init__(self) -> None: ...
  374. @typing.overload
  375. def __init__(self, a0: 'QTapFilter') -> None: ...
  376. def filter(self, reading: QTapReading|None) -> bool: ...
  377. class QTapSensor(QSensor):
  378. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  379. returnDoubleTapEventsChanged: typing.ClassVar[QtCore.pyqtSignal]
  380. def setReturnDoubleTapEvents(self, returnDoubleTapEvents: bool) -> None: ...
  381. def returnDoubleTapEvents(self) -> bool: ...
  382. def reading(self) -> QTapReading|None: ...
  383. class QTiltReading(QSensorReading):
  384. def setXRotation(self, x: float) -> None: ...
  385. def xRotation(self) -> float: ...
  386. def setYRotation(self, y: float) -> None: ...
  387. def yRotation(self) -> float: ...
  388. class QTiltFilter(QSensorFilter):
  389. @typing.overload
  390. def __init__(self) -> None: ...
  391. @typing.overload
  392. def __init__(self, a0: 'QTiltFilter') -> None: ...
  393. def filter(self, reading: QTiltReading|None) -> bool: ...
  394. class QTiltSensor(QSensor):
  395. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  396. def calibrate(self) -> None: ...
  397. def reading(self) -> QTiltReading|None: ...