Skip to content

Commit

Permalink
Merge pull request #56 from altendky/patch-2
Browse files Browse the repository at this point in the history
Improve bound and unbound signal hints
  • Loading branch information
altendky authored Oct 1, 2020
2 parents 3de7e7f + c4b9750 commit c764d7c
Show file tree
Hide file tree
Showing 46 changed files with 367 additions and 390 deletions.
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DAnimation.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ from PyQt5 import Qt3DCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DCore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DExtras.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ from PyQt5 import Qt3DCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DInput.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import Qt3DCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DLogic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from PyQt5 import Qt3DCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/Qt3DRender.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import Qt3DCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtBluetooth.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtChart.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
53 changes: 29 additions & 24 deletions PyQt5-stubs/QtCore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,26 @@ import enum # import was missing
# Support for QDate, QDateTime and QTime.
import datetime

# Support for new-style signals and slots.
class pyqtSignal: # add methods
def __init__(self, *types: typing.Any, name: str = ...) -> None: ...
class pyqtBoundSignal:
signal = ... # type: str

def __getitem__(self, key: object) -> "pyqtBoundSignal": ...

def emit(self, *args: typing.Any) -> None: ...
def connect(self, slot: "PYQT_SLOT") -> "QMetaObject.Connection": ...
def disconnect(self, slot: typing.Union["PYQT_SLOT", "QMetaObject.Connection"]=None) -> None: ...


class pyqtBoundSignal:
signal = ... # type: str
class pyqtSignal:
def __init__(self, *types: typing.Any, name: str = ...) -> None: ...

@typing.overload
def __get__(self, instance: None, owner: typing.Type["QObject"]) -> "pyqtSignal": ...
@typing.overload
def __get__(self, instance: "QObject", owner: typing.Type["QObject"]) -> pyqtBoundSignal: ...

def emit(self, *args: typing.Any) -> None: ...

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[pyqtSignal, pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., object], pyqtBoundSignal]


Expand Down Expand Up @@ -1769,13 +1774,13 @@ class QObject(sip.wrapper):
def customEvent(self, a0: 'QEvent') -> None: ...
def childEvent(self, a0: 'QChildEvent') -> None: ...
def timerEvent(self, a0: 'QTimerEvent') -> None: ...
def receivers(self, signal: PYQT_SIGNAL) -> int: ...
def receivers(self, signal: pyqtBoundSignal) -> int: ...
def sender(self) -> 'QObject': ...
def deleteLater(self) -> None: ...
def inherits(self, classname: str) -> bool: ...
def parent(self) -> 'QObject': ...
objectNameChanged: pyqtSignal
destroyed: pyqtSignal
objectNameChanged: typing.ClassVar[pyqtSignal]
destroyed: typing.ClassVar[pyqtSignal]
def property(self, name: str) -> typing.Any: ...
def setProperty(self, name: str, value: typing.Any) -> bool: ...
def dynamicPropertyNames(self) -> typing.List['QByteArray']: ...
Expand Down Expand Up @@ -2033,7 +2038,7 @@ class QAbstractItemModel(QObject):
def layoutChanged(self, parents: typing.Iterable[QPersistentModelIndex] = ..., hint: 'QAbstractItemModel.LayoutChangeHint' = ...) -> None: ...
def layoutAboutToBeChanged(self, parents: typing.Iterable[QPersistentModelIndex] = ..., hint: 'QAbstractItemModel.LayoutChangeHint' = ...) -> None: ...
def headerDataChanged(self, orientation: Qt.Orientation, first: int, last: int) -> None: ...
dataChanged = pyqtSignal()
dataChanged: typing.ClassVar[pyqtSignal]
def span(self, index: QModelIndex) -> 'QSize': ...
def match(self, start: QModelIndex, role: int, value: typing.Any, hits: int = ..., flags: typing.Union[Qt.MatchFlags, Qt.MatchFlag] = ...) -> typing.List[QModelIndex]: ...
def buddy(self, index: QModelIndex) -> QModelIndex: ...
Expand Down Expand Up @@ -2949,7 +2954,7 @@ class QCoreApplication(QObject):
@staticmethod
def setApplicationVersion(version: str) -> None: ...
def event(self, a0: 'QEvent') -> bool: ...
aboutToQuit: pyqtSignal
aboutToQuit: typing.ClassVar[pyqtSignal]
@staticmethod
def quit() -> None: ...
@staticmethod
Expand Down Expand Up @@ -3019,10 +3024,10 @@ class QCoreApplication(QObject):
def organizationDomain() -> str: ...
@staticmethod
def setOrganizationDomain(orgDomain: str) -> None: ...
applicationNameChanged: pyqtSignal
applicationVersionChanged: pyqtSignal
organizationDomainChanged: pyqtSignal
organizationNameChanged: pyqtSignal
applicationNameChanged: typing.ClassVar[pyqtSignal]
applicationVersionChanged: typing.ClassVar[pyqtSignal]
organizationDomainChanged: typing.ClassVar[pyqtSignal]
organizationNameChanged: typing.ClassVar[pyqtSignal]


class QEvent(sip.wrapper):
Expand Down Expand Up @@ -6703,12 +6708,12 @@ class QProcess(QIODevice):
def readData(self, maxlen: int) -> bytes: ...
def setupChildProcess(self) -> None: ...
def setProcessState(self, state: 'QProcess.ProcessState') -> None: ...
errorOccurred: pyqtSignal
readyReadStandardError: pyqtSignal
readyReadStandardOutput: pyqtSignal
stateChanged: pyqtSignal
finished: pyqtSignal
started: pyqtSignal
errorOccurred: typing.ClassVar[pyqtSignal]
readyReadStandardError: typing.ClassVar[pyqtSignal]
readyReadStandardOutput: typing.ClassVar[pyqtSignal]
stateChanged: typing.ClassVar[pyqtSignal]
finished: typing.ClassVar[pyqtSignal]
started: typing.ClassVar[pyqtSignal]
def kill(self) -> None: ...
def terminate(self) -> None: ...
def setStandardOutputProcess(self, destination: 'QProcess') -> None: ...
Expand Down Expand Up @@ -7471,7 +7476,7 @@ class QSignalMapper(QObject):
def mappedWidget(self, a0: QWidget) -> None: ...
def mappedString(self, a0: str) -> None: ...
def mappedInt(self, a0: int) -> None: ...
mapped: pyqtSignal
mapped: typing.ClassVar[pyqtSignal]
@typing.overload
def mapping(self, id: int) -> QObject: ...
@typing.overload
Expand Down Expand Up @@ -8356,7 +8361,7 @@ class QTimer(QObject):
def timerType(self) -> Qt.TimerType: ...
def setTimerType(self, atype: Qt.TimerType) -> None: ...
def timerEvent(self, a0: QTimerEvent) -> None: ...
timeout: pyqtSignal
timeout: typing.ClassVar[pyqtSignal]
def stop(self) -> None: ...
@typing.overload
def start(self, msec: int) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtDBus.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtDataVisualization.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtDesigner.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
45 changes: 22 additions & 23 deletions PyQt5-stubs/QtGui.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down Expand Up @@ -913,10 +912,10 @@ class QClipboard(QtCore.QObject):
Selection = ... # type: 'QClipboard.Mode'
FindBuffer = ... # type: 'QClipboard.Mode'

selectionChanged: PYQT_SIGNAL
findBufferChanged: PYQT_SIGNAL
dataChanged: PYQT_SIGNAL
changed: PYQT_SIGNAL
selectionChanged: typing.ClassVar[QtCore.pyqtSignal]
findBufferChanged: typing.ClassVar[QtCore.pyqtSignal]
dataChanged: typing.ClassVar[QtCore.pyqtSignal]
changed: typing.ClassVar[QtCore.pyqtSignal]
def setPixmap(self, a0: QPixmap, mode: 'QClipboard.Mode' = ...) -> None: ...
def setImage(self, a0: 'QImage', mode: 'QClipboard.Mode' = ...) -> None: ...
def pixmap(self, mode: 'QClipboard.Mode' = ...) -> QPixmap: ...
Expand Down Expand Up @@ -4452,9 +4451,9 @@ class QWindow(QtCore.QObject, QSurface):
def setWindowStates(self, states: typing.Union[QtCore.Qt.WindowStates, QtCore.Qt.WindowState]) -> None: ...
def windowStates(self) -> QtCore.Qt.WindowStates: ...
def setFlag(self, a0: QtCore.Qt.WindowType, on: bool = ...) -> None: ...
opacityChanged: PYQT_SIGNAL
activeChanged: PYQT_SIGNAL
visibilityChanged: PYQT_SIGNAL
opacityChanged: typing.ClassVar[QtCore.pyqtSignal]
activeChanged: typing.ClassVar[QtCore.pyqtSignal]
visibilityChanged: typing.ClassVar[QtCore.pyqtSignal]
@staticmethod
def fromWinId(id: sip.voidptr) -> 'QWindow': ...
def mask(self) -> 'QRegion': ...
Expand All @@ -4479,21 +4478,21 @@ class QWindow(QtCore.QObject, QSurface):
def moveEvent(self, a0: QMoveEvent) -> None: ...
def resizeEvent(self, a0: QResizeEvent) -> None: ...
def exposeEvent(self, a0: QExposeEvent) -> None: ...
windowTitleChanged: PYQT_SIGNAL
focusObjectChanged: PYQT_SIGNAL
contentOrientationChanged: PYQT_SIGNAL
visibleChanged: PYQT_SIGNAL
maximumHeightChanged: PYQT_SIGNAL
maximumWidthChanged: PYQT_SIGNAL
minimumHeightChanged: PYQT_SIGNAL
minimumWidthChanged: PYQT_SIGNAL
heightChanged: PYQT_SIGNAL
widthChanged: PYQT_SIGNAL
yChanged: PYQT_SIGNAL
xChanged: PYQT_SIGNAL
windowStateChanged: PYQT_SIGNAL
modalityChanged: PYQT_SIGNAL
screenChanged: PYQT_SIGNAL
windowTitleChanged: typing.ClassVar[QtCore.pyqtSignal]
focusObjectChanged: typing.ClassVar[QtCore.pyqtSignal]
contentOrientationChanged: typing.ClassVar[QtCore.pyqtSignal]
visibleChanged: typing.ClassVar[QtCore.pyqtSignal]
maximumHeightChanged: typing.ClassVar[QtCore.pyqtSignal]
maximumWidthChanged: typing.ClassVar[QtCore.pyqtSignal]
minimumHeightChanged: typing.ClassVar[QtCore.pyqtSignal]
minimumWidthChanged: typing.ClassVar[QtCore.pyqtSignal]
heightChanged: typing.ClassVar[QtCore.pyqtSignal]
widthChanged: typing.ClassVar[QtCore.pyqtSignal]
yChanged: typing.ClassVar[QtCore.pyqtSignal]
xChanged: typing.ClassVar[QtCore.pyqtSignal]
windowStateChanged: typing.ClassVar[QtCore.pyqtSignal]
modalityChanged: typing.ClassVar[QtCore.pyqtSignal]
screenChanged: typing.ClassVar[QtCore.pyqtSignal]
def requestUpdate(self) -> None: ...
def alert(self, msec: int) -> None: ...
def setMaximumHeight(self, h: int) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtHelp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtLocation.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtMultimedia.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtMultimediaWidgets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtNetwork.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtNetworkAuth.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtNfc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtOpenGL.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtPositioning.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
7 changes: 3 additions & 4 deletions PyQt5-stubs/QtPrintSupport.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]

# Convenient aliases for complicated OpenGL types.
Expand Down Expand Up @@ -383,7 +382,7 @@ class QPrintPreviewDialog(QtWidgets.QDialog):
@typing.overload
def __init__(self, printer: QPrinter, parent: typing.Optional[QtWidgets.QWidget] = ..., flags: typing.Union[QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...) -> None: ...

paintRequested: QtCore.pyqtSignal
paintRequested: typing.ClassVar[QtCore.pyqtSignal]

def done(self, result: int) -> None: ...
def printer(self) -> QPrinter: ...
Expand Down Expand Up @@ -412,8 +411,8 @@ class QPrintPreviewWidget(QtWidgets.QWidget):
def __init__(self, parent: typing.Optional[QtWidgets.QWidget] = ..., flags: typing.Union[QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...) -> None: ...

def pageCount(self) -> int: ...
previewChanged: QtCore.pyqtSignal
paintRequested: QtCore.pyqtSignal
previewChanged: typing.ClassVar[QtCore.pyqtSignal]
paintRequested: typing.ClassVar[QtCore.pyqtSignal]
def updatePreview(self) -> None: ...
def setAllPagesViewMode(self) -> None: ...
def setFacingPagesViewMode(self) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion PyQt5-stubs/QtPurchasing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ from PyQt5 import QtCore
import datetime

# Convenient type aliases.
PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
PYQT_SLOT = typing.Union[typing.Callable[..., None], QtCore.pyqtBoundSignal]


Expand Down
Loading

0 comments on commit c764d7c

Please sign in to comment.