Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8da0a4d

Browse files
committed
Merge remote-tracking branch 'pyqt5-stubs/master' into merge-pyqt5upstream-platform-code
2 parents ed1f96f + 4e0ed6b commit 8da0a4d

15 files changed

+857
-63
lines changed

PyQt5-stubs/QtBluetooth.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ from PyQt5 import QtCore
2727

2828
# Support for QDate, QDateTime and QTime.
2929
import datetime
30+
import enum
3031

3132
# Convenient type aliases.
3233
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -204,7 +205,7 @@ class QBluetoothDeviceDiscoveryAgent(QtCore.QObject):
204205

205206
class QBluetoothDeviceInfo(sip.wrapper):
206207

207-
class Field(int):
208+
class Field(enum.IntEnum):
208209
None_ = ... # type: QBluetoothDeviceInfo.Field
209210
RSSI = ... # type: QBluetoothDeviceInfo.Field
210211
ManufacturerData = ... # type: QBluetoothDeviceInfo.Field

PyQt5-stubs/QtCore.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ QtSystemMsg = ... # type: QtMsgType
128128
QtInfoMsg = ... # type: QtMsgType
129129

130130

131-
class QCborKnownTags(int):
131+
class QCborKnownTags(enum.IntEnum):
132132
DateTimeString = ... # type: QCborKnownTags
133133
UnixTime_t = ... # type: QCborKnownTags
134134
PositiveBignum = ... # type: QCborKnownTags
@@ -154,7 +154,7 @@ class QCborKnownTags(int):
154154
Signature = ... # type: QCborKnownTags
155155

156156

157-
class QCborSimpleType(int):
157+
class QCborSimpleType(enum.IntEnum):
158158
False_ = ... # type: QCborSimpleType
159159
True_ = ... # type: QCborSimpleType
160160
Null = ... # type: QCborSimpleType
@@ -163,7 +163,7 @@ class QCborSimpleType(int):
163163

164164
class Qt(sip.simplewrapper):
165165

166-
class HighDpiScaleFactorRoundingPolicy(int):
166+
class HighDpiScaleFactorRoundingPolicy(enum.IntEnum):
167167
Round = ... # type: Qt.HighDpiScaleFactorRoundingPolicy
168168
Ceil = ... # type: Qt.HighDpiScaleFactorRoundingPolicy
169169
Floor = ... # type: Qt.HighDpiScaleFactorRoundingPolicy
@@ -3521,7 +3521,7 @@ class QPersistentModelIndex(sip.simplewrapper):
35213521

35223522
class QAbstractItemModel(QObject):
35233523

3524-
class CheckIndexOption(int):
3524+
class CheckIndexOption(enum.IntEnum):
35253525
def __or__ (self, other: 'QAbstractItemModel.CheckIndexOption') -> int: ... # type: ignore[override]
35263526
def __ror__ (self, other: int) -> int: ...
35273527

@@ -3975,7 +3975,7 @@ class QBuffer(QIODevice):
39753975

39763976
class QByteArray(sip.simplewrapper):
39773977

3978-
class Base64DecodingStatus(int):
3978+
class Base64DecodingStatus(enum.IntEnum):
39793979
Ok = ... # type: QByteArray.Base64DecodingStatus
39803980
IllegalInputLength = ... # type: QByteArray.Base64DecodingStatus
39813981
IllegalCharacter = ... # type: QByteArray.Base64DecodingStatus
@@ -4197,7 +4197,7 @@ class QByteArrayMatcher(sip.simplewrapper):
41974197

41984198
class QCalendar(sip.simplewrapper):
41994199

4200-
class System(int):
4200+
class System(enum.IntEnum):
42014201
Gregorian = ... # type: QCalendar.System
42024202
Julian = ... # type: QCalendar.System
42034203
Milankovic = ... # type: QCalendar.System
@@ -5448,7 +5448,7 @@ class QTime(sip.simplewrapper):
54485448

54495449
class QDateTime(sip.simplewrapper):
54505450

5451-
class YearRange(int):
5451+
class YearRange(enum.IntEnum):
54525452
First = ... # type: QDateTime.YearRange
54535453
Last = ... # type: QDateTime.YearRange
54545454

PyQt5-stubs/QtGui.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ from PyQt5 import QtWidgets
3030

3131
# Support for QDate, QDateTime and QTime.
3232
import datetime
33+
import enum
3334

3435
# Convenient type aliases.
3536
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -1151,14 +1152,14 @@ class QClipboard(QtCore.QObject):
11511152

11521153
class QColorSpace(sip.simplewrapper):
11531154

1154-
class TransferFunction(int):
1155+
class TransferFunction(enum.IntEnum):
11551156
Custom = ... # type: QColorSpace.TransferFunction
11561157
Linear = ... # type: QColorSpace.TransferFunction
11571158
Gamma = ... # type: QColorSpace.TransferFunction
11581159
SRgb = ... # type: QColorSpace.TransferFunction
11591160
ProPhotoRgb = ... # type: QColorSpace.TransferFunction
11601161

1161-
class Primaries(int):
1162+
class Primaries(enum.IntEnum):
11621163
Custom = ... # type: QColorSpace.Primaries
11631164
SRgb = ... # type: QColorSpace.Primaries
11641165
AdobeRgb = ... # type: QColorSpace.Primaries
@@ -9657,7 +9658,7 @@ class QTextCharFormat(QTextFormat):
96579658

96589659
class QTextBlockFormat(QTextFormat):
96599660

9660-
class MarkerType(int):
9661+
class MarkerType(enum.IntEnum):
96619662
NoMarker = ... # type: QTextBlockFormat.MarkerType
96629663
Unchecked = ... # type: QTextBlockFormat.MarkerType
96639664
Checked = ... # type: QTextBlockFormat.MarkerType

PyQt5-stubs/QtNetwork.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ from PyQt5 import QtCore
2828

2929
# Support for QDate, QDateTime and QTime.
3030
import datetime
31+
import enum
3132

3233
# Convenient type aliases.
3334
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
3435

3536

36-
class QOcspRevocationReason(int):
37+
class QOcspRevocationReason(enum.IntEnum):
3738
None_ = ... # type: QOcspRevocationReason
3839
Unspecified = ... # type: QOcspRevocationReason
3940
KeyCompromise = ... # type: QOcspRevocationReason
@@ -45,7 +46,7 @@ class QOcspRevocationReason(int):
4546
RemoveFromCRL = ... # type: QOcspRevocationReason
4647

4748

48-
class QOcspCertificateStatus(int):
49+
class QOcspCertificateStatus(enum.IntEnum):
4950
Good = ... # type: QOcspCertificateStatus
5051
Revoked = ... # type: QOcspCertificateStatus
5152
Unknown = ... # type: QOcspCertificateStatus
@@ -2079,7 +2080,7 @@ class QSsl(sip.simplewrapper):
20792080

20802081
class QSslCertificate(sip.simplewrapper):
20812082

2082-
class PatternSyntax(int):
2083+
class PatternSyntax(enum.IntEnum):
20832084
RegularExpression = ... # type: QSslCertificate.PatternSyntax
20842085
Wildcard = ... # type: QSslCertificate.PatternSyntax
20852086
FixedString = ... # type: QSslCertificate.PatternSyntax

PyQt5-stubs/QtNetworkAuth.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,33 @@ from PyQt5 import QtCore
2828

2929
# Support for QDate, QDateTime and QTime.
3030
import datetime
31+
import enum
3132

3233
# Convenient type aliases.
3334
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
3435

3536

3637
class QAbstractOAuth(QtCore.QObject):
3738

38-
class ContentType(int):
39+
class ContentType(enum.IntEnum):
3940
WwwFormUrlEncoded = ... # type: QAbstractOAuth.ContentType
4041
Json = ... # type: QAbstractOAuth.ContentType
4142

42-
class Error(int):
43+
class Error(enum.IntEnum):
4344
NoError = ... # type: QAbstractOAuth.Error
4445
NetworkError = ... # type: QAbstractOAuth.Error
4546
ServerError = ... # type: QAbstractOAuth.Error
4647
OAuthTokenNotFoundError = ... # type: QAbstractOAuth.Error
4748
OAuthTokenSecretNotFoundError = ... # type: QAbstractOAuth.Error
4849
OAuthCallbackNotVerified = ... # type: QAbstractOAuth.Error
4950

50-
class Stage(int):
51+
class Stage(enum.IntEnum):
5152
RequestingTemporaryCredentials = ... # type: QAbstractOAuth.Stage
5253
RequestingAuthorization = ... # type: QAbstractOAuth.Stage
5354
RequestingAccessToken = ... # type: QAbstractOAuth.Stage
5455
RefreshingAccessToken = ... # type: QAbstractOAuth.Stage
5556

56-
class Status(int):
57+
class Status(enum.IntEnum):
5758
NotAuthenticated = ... # type: QAbstractOAuth.Status
5859
TemporaryCredentialsReceived = ... # type: QAbstractOAuth.Status
5960
Granted = ... # type: QAbstractOAuth.Status
@@ -161,7 +162,7 @@ class QAbstractOAuthReplyHandler(QtCore.QObject):
161162

162163
class QOAuth1(QAbstractOAuth):
163164

164-
class SignatureMethod(int):
165+
class SignatureMethod(enum.IntEnum):
165166
Hmac_Sha1 = ... # type: QOAuth1.SignatureMethod
166167
Rsa_Sha1 = ... # type: QOAuth1.SignatureMethod
167168
PlainText = ... # type: QOAuth1.SignatureMethod
@@ -219,7 +220,7 @@ class QOAuth1(QAbstractOAuth):
219220

220221
class QOAuth1Signature(sip.simplewrapper):
221222

222-
class HttpRequestMethod(int):
223+
class HttpRequestMethod(enum.IntEnum):
223224
Head = ... # type: QOAuth1Signature.HttpRequestMethod
224225
Get = ... # type: QOAuth1Signature.HttpRequestMethod
225226
Put = ... # type: QOAuth1Signature.HttpRequestMethod

PyQt5-stubs/QtNfc.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ from PyQt5 import QtCore
2727

2828
# Support for QDate, QDateTime and QTime.
2929
import datetime
30+
import enum
3031

3132
# Convenient type aliases.
3233
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -235,7 +236,7 @@ class QNdefNfcUriRecord(QNdefRecord):
235236

236237
class QNearFieldManager(QtCore.QObject):
237238

238-
class AdapterState(int):
239+
class AdapterState(enum.IntEnum):
239240
Offline = ... # type: QNearFieldManager.AdapterState
240241
TurningOn = ... # type: QNearFieldManager.AdapterState
241242
Online = ... # type: QNearFieldManager.AdapterState

PyQt5-stubs/QtTest.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ from PyQt5 import QtGui # add import of QtGui
3030

3131
# Support for QDate, QDateTime and QTime.
3232
import datetime
33+
import enum
3334

3435
# Convenient type aliases.
3536
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -43,7 +44,7 @@ PYQT_OPENGL_BOUND_ARRAY = typing.Union[typing.Sequence[int],
4344

4445
class QAbstractItemModelTester(QtCore.QObject):
4546

46-
class FailureReportingMode(int):
47+
class FailureReportingMode(enum.IntEnum):
4748
QtTest = ... # type: QAbstractItemModelTester.FailureReportingMode
4849
Warning = ... # type: QAbstractItemModelTester.FailureReportingMode
4950
Fatal = ... # type: QAbstractItemModelTester.FailureReportingMode

PyQt5-stubs/QtWebEngineCore.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ from PyQt5 import QtCore
2929

3030
# Support for QDate, QDateTime and QTime.
3131
import datetime
32+
import enum
3233

3334
# Convenient type aliases.
3435
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -291,7 +292,7 @@ class QWebEngineUrlScheme(sip.simplewrapper):
291292

292293
PortUnspecified = ... # type: QWebEngineUrlScheme.SpecialPort
293294

294-
class Syntax(int):
295+
class Syntax(enum.IntEnum):
295296
HostPortAndUserInformation = ... # type: QWebEngineUrlScheme.Syntax
296297
HostAndPort = ... # type: QWebEngineUrlScheme.Syntax
297298
Host = ... # type: QWebEngineUrlScheme.Syntax

PyQt5-stubs/QtWebEngineWidgets.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ from PyQt5 import QtCore
3333

3434
# Support for QDate, QDateTime and QTime.
3535
import datetime
36+
import enum
3637

3738
# Convenient type aliases.
3839
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]
@@ -402,7 +403,7 @@ class QWebEngineHistory(sip.simplewrapper):
402403

403404
class QWebEnginePage(QtCore.QObject):
404405

405-
class LifecycleState(int):
406+
class LifecycleState(enum.IntEnum):
406407
Active = ... # type: QWebEnginePage.LifecycleState
407408
Frozen = ... # type: QWebEnginePage.LifecycleState
408409
Discarded = ... # type: QWebEnginePage.LifecycleState

PyQt5-stubs/QtWidgets.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#
1919
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
2020
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21-
22-
21+
import enum
2322
import typing
2423
import sys
2524

@@ -1199,7 +1198,7 @@ class QAction(QtCore.QObject):
11991198

12001199
class QActionGroup(QtCore.QObject):
12011200

1202-
class ExclusionPolicy(int):
1201+
class ExclusionPolicy(enum.IntEnum):
12031202
None_ = ... # type: QActionGroup.ExclusionPolicy
12041203
Exclusive = ... # type: QActionGroup.ExclusionPolicy
12051204
ExclusiveOptional = ... # type: QActionGroup.ExclusionPolicy

0 commit comments

Comments
 (0)