diff --git a/CHANGELOG.md b/CHANGELOG.md index 394ea18f..e6a4f690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * [#184](https://github.com/python-qt-tools/PyQt5-stubs/pull/184) Fix missing module variable detected by latest mypy 0.930 * [#183](https://github.com/python-qt-tools/PyQt5-stubs/pull/183) Add missing operations on QSize +* [#187](https://github.com/python-qt-tools/PyQt5-stubs/pull/187) Allow `None` as argument for `QLineEdit.setText()` * [#189](https://github.com/python-qt-tools/PyQt5-stubs/pull/189) Fix QListWidget, QTreeWidget and QTableWidget so that their respective items are now optional in many places when used as argument or return value + + ## 5.15.2.0 ### Added diff --git a/PyQt5-stubs/QtWidgets.pyi b/PyQt5-stubs/QtWidgets.pyi index a03c8dcf..161f6e0b 100644 --- a/PyQt5-stubs/QtWidgets.pyi +++ b/PyQt5-stubs/QtWidgets.pyi @@ -7147,7 +7147,7 @@ class QLineEdit(QWidget): def undo(self) -> None: ... def selectAll(self) -> None: ... def clear(self) -> None: ... - def setText(self, a0: str) -> None: ... + def setText(self, a0: typing.Optional[str]) -> None: ... def hasAcceptableInput(self) -> bool: ... def setInputMask(self, inputMask: str) -> None: ... def inputMask(self) -> str: ... diff --git a/tests/qlineedit.py b/tests/qlineedit.py new file mode 100644 index 00000000..b269ec00 --- /dev/null +++ b/tests/qlineedit.py @@ -0,0 +1,9 @@ +import os + +from PyQt5.QtWidgets import QLineEdit, QApplication + +app = QApplication(['my_program', '-platform', 'offscreen']) + +le = QLineEdit() +le.setText(None) +