From b8e0a2b482de03a97b74af33006ffa13e13965de Mon Sep 17 00:00:00 2001 From: Tilman Krummeck Date: Wed, 6 Jan 2021 13:02:00 +0100 Subject: [PATCH 1/2] Corrected annotations for signal in QThread and QNetworkAccessManager --- PyQt5-stubs/QtCore.pyi | 4 ++-- PyQt5-stubs/QtNetwork.pyi | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PyQt5-stubs/QtCore.pyi b/PyQt5-stubs/QtCore.pyi index ff6c012a..6e7f25a5 100644 --- a/PyQt5-stubs/QtCore.pyi +++ b/PyQt5-stubs/QtCore.pyi @@ -8247,8 +8247,8 @@ class QThread(QObject): def exec(self) -> int: ... def exec_(self) -> int: ... def run(self) -> None: ... - def finished(self) -> None: ... - def started(self) -> None: ... + finished: typing.ClassVar[pyqtSignal] + started: typing.ClassVar[pyqtSignal] @typing.overload def wait(self, msecs: int = ...) -> bool: ... @typing.overload diff --git a/PyQt5-stubs/QtNetwork.pyi b/PyQt5-stubs/QtNetwork.pyi index 903a61f0..0a0a42c0 100644 --- a/PyQt5-stubs/QtNetwork.pyi +++ b/PyQt5-stubs/QtNetwork.pyi @@ -764,13 +764,13 @@ class QNetworkAccessManager(QtCore.QObject): def setProxyFactory(self, factory: 'QNetworkProxyFactory') -> None: ... def proxyFactory(self) -> 'QNetworkProxyFactory': ... def createRequest(self, op: 'QNetworkAccessManager.Operation', request: 'QNetworkRequest', device: typing.Optional[QtCore.QIODevice] = ...) -> 'QNetworkReply': ... - def preSharedKeyAuthenticationRequired(self, reply: 'QNetworkReply', authenticator: 'QSslPreSharedKeyAuthenticator') -> None: ... + preSharedKeyAuthenticationRequired = typing.ClassVar[QtCore.pyqtSignal] def networkAccessibleChanged(self, accessible: 'QNetworkAccessManager.NetworkAccessibility') -> None: ... - def sslErrors(self, reply: 'QNetworkReply', errors: typing.Iterable['QSslError']) -> None: ... - def encrypted(self, reply: 'QNetworkReply') -> None: ... - def finished(self, reply: 'QNetworkReply') -> None: ... - def authenticationRequired(self, reply: 'QNetworkReply', authenticator: QAuthenticator) -> None: ... - def proxyAuthenticationRequired(self, proxy: 'QNetworkProxy', authenticator: QAuthenticator) -> None: ... + sslErrors: typing.ClassVar[QtCore.pyqtSignal] + encrypted: typing.ClassVar[QtCore.pyqtSignal] + finished: typing.ClassVar[QtCore.pyqtSignal] + authenticationRequired: typing.ClassVar[QtCore.pyqtSignal] + proxyAuthenticationRequired: typing.ClassVar[QtCore.pyqtSignal] @typing.overload def put(self, request: 'QNetworkRequest', data: QtCore.QIODevice) -> 'QNetworkReply': ... @typing.overload From 9ee81500525b1fd4b0660a8d07bcbdd718dbe433 Mon Sep 17 00:00:00 2001 From: Tilman Krummeck Date: Thu, 7 Jan 2021 05:50:26 +0100 Subject: [PATCH 2/2] Added changelog entry. Added annotation for deprecated signal QNetworkAccessManager.networkAccessibleChanged --- CHANGELOG.md | 1 + PyQt5-stubs/QtNetwork.pyi | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 380eb7ba..5d03f94b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * [#51](https://github.com/stlehmann/PyQt5-stubs/pull/51) adds `pyqtBoundSignal.signal` hinted as `str` ### Changed +* [#129](https://github.com/stlehmann/PyQt5-stubs/pull/129) fixes `QThread` and `QNetworkAccessManager` signals * [#109](https://github.com/stlehmann/PyQt5-stubs/pull/109) `.__or__()` for `QMessageBox.StandardButton` and `QMessageBox.StandardButtons` * [#126](https://github.com/stlehmann/PyQt5-stubs/pull/126) fix `QCoreApplication.instance()` return type to be optional * [#102](https://github.com/stlehmann/PyQt5-stubs/pull/102) fix `pyqtSlot` parameter typing and overloads diff --git a/PyQt5-stubs/QtNetwork.pyi b/PyQt5-stubs/QtNetwork.pyi index 0a0a42c0..fb5e4d8c 100644 --- a/PyQt5-stubs/QtNetwork.pyi +++ b/PyQt5-stubs/QtNetwork.pyi @@ -765,7 +765,7 @@ class QNetworkAccessManager(QtCore.QObject): def proxyFactory(self) -> 'QNetworkProxyFactory': ... def createRequest(self, op: 'QNetworkAccessManager.Operation', request: 'QNetworkRequest', device: typing.Optional[QtCore.QIODevice] = ...) -> 'QNetworkReply': ... preSharedKeyAuthenticationRequired = typing.ClassVar[QtCore.pyqtSignal] - def networkAccessibleChanged(self, accessible: 'QNetworkAccessManager.NetworkAccessibility') -> None: ... + networkAccessibleChanged = typing.ClassVar[QtCore.pyqtSignal] sslErrors: typing.ClassVar[QtCore.pyqtSignal] encrypted: typing.ClassVar[QtCore.pyqtSignal] finished: typing.ClassVar[QtCore.pyqtSignal]