diff --git a/CHANGELOG.md b/CHANGELOG.md index c134c64b..684009b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed * [#46](https://github.com/stlehmann/PyQt5-stubs/pull/46) fixes QCoreApplication and QObject signals * [#48](https://github.com/stlehmann/PyQt5-stubs/pull/48) fixes some signals for QClipBoard, QWindows, QQuickView and QQml{Application,}Engine +* [#49](https://github.com/stlehmann/PyQt5-stubs/pull/49) fixes QAbstractItemView.setModel to accept None ### Removed diff --git a/PyQt5-stubs/QtWidgets.pyi b/PyQt5-stubs/QtWidgets.pyi index 4dc8c64e..327032ee 100644 --- a/PyQt5-stubs/QtWidgets.pyi +++ b/PyQt5-stubs/QtWidgets.pyi @@ -786,7 +786,7 @@ class QAbstractItemView(QAbstractScrollArea): def selectionModel(self) -> QtCore.QItemSelectionModel: ... def setSelectionModel(self, selectionModel: QtCore.QItemSelectionModel) -> None: ... def model(self) -> QtCore.QAbstractItemModel: ... - def setModel(self, model: QtCore.QAbstractItemModel) -> None: ... + def setModel(self, model: typing.Optional[QtCore.QAbstractItemModel]) -> None: ... class QAbstractSlider(QWidget): @@ -1591,7 +1591,7 @@ class QColumnView(QAbstractItemView): def selectAll(self) -> None: ... def setRootIndex(self, index: QtCore.QModelIndex) -> None: ... def setSelectionModel(self, selectionModel: QtCore.QItemSelectionModel) -> None: ... - def setModel(self, model: QtCore.QAbstractItemModel) -> None: ... + def setModel(self, model: typing.Optional[QtCore.QAbstractItemModel]) -> None: ... def visualRect(self, index: QtCore.QModelIndex) -> QtCore.QRect: ... def sizeHint(self) -> QtCore.QSize: ... def scrollTo(self, index: QtCore.QModelIndex, hint: QAbstractItemView.ScrollHint = ...) -> None: ... @@ -5421,7 +5421,7 @@ class QHeaderView(QAbstractItemView): def length(self) -> int: ... def offset(self) -> int: ... def orientation(self) -> QtCore.Qt.Orientation: ... - def setModel(self, model: QtCore.QAbstractItemModel) -> None: ... + def setModel(self, model: typing.Optional[QtCore.QAbstractItemModel]) -> None: ... class QInputDialog(QDialog): @@ -8586,7 +8586,7 @@ class QTableView(QAbstractItemView): def horizontalHeader(self) -> QHeaderView: ... def setSelectionModel(self, selectionModel: QtCore.QItemSelectionModel) -> None: ... def setRootIndex(self, index: QtCore.QModelIndex) -> None: ... - def setModel(self, model: QtCore.QAbstractItemModel) -> None: ... + def setModel(self, model: typing.Optional[QtCore.QAbstractItemModel]) -> None: ... class QTableWidgetSelectionRange(sip.simplewrapper): @@ -9326,7 +9326,7 @@ class QTreeView(QAbstractItemView): def header(self) -> QHeaderView: ... def setSelectionModel(self, selectionModel: QtCore.QItemSelectionModel) -> None: ... def setRootIndex(self, index: QtCore.QModelIndex) -> None: ... - def setModel(self, model: QtCore.QAbstractItemModel) -> None: ... + def setModel(self, model: typing.Optional[QtCore.QAbstractItemModel]) -> None: ... class QTreeWidgetItem(sip.wrapper):