-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.8.2
-
None
-
315a7c85a (dev), 2a2e65417 (6.8)
Essentially PYSIDE-2939 (Type hints: QMessageBox.warning misses default values for button0, button1) for QMessageBox.informatin. Example code runs fine yet mypy 1.14.1 errors:
from PySide6.QtWidgets import QApplication, QMessageBox, QWidget QApplication() QMessageBox.warning(QWidget(), "", "")
6.8.2
def information(parent: PySide6.QtWidgets.QWidget, title: str, text: str,
button0: PySide6.QtWidgets.QMessageBox.StandardButton, /,
button1: PySide6.QtWidgets.QMessageBox.StandardButton = ...) ->
PySide6.QtWidgets.QMessageBox.StandardButton: ...
@staticmethod
def question(parent: PySide6.QtWidgets.QWidget, title: str, text: str, /,
buttons: PySide6.QtWidgets.QMessageBox.StandardButton = ...,
defaultButton: PySide6.QtWidgets.QMessageBox.StandardButton = ...) ->
PySide6.QtWidgets.QMessageBox.StandardButton: ...
6.7.2
@staticmethod
def information(parent: PySide6.QtWidgets.QWidget, title: str, text: str,
button0: PySide6.QtWidgets.QMessageBox.StandardButton,
button1: PySide6.QtWidgets.QMessageBox.StandardButton = ...) ->
PySide6.QtWidgets.QMessageBox.StandardButton: ...
@overload
@staticmethod
def information(parent: PySide6.QtWidgets.QWidget, title: str, text: str,
buttons: PySide6.QtWidgets.QMessageBox.StandardButton = ...,
defaultButton: PySide6.QtWidgets.QMessageBox.StandardButton = ...) ->
PySide6.QtWidgets.QMessageBox.StandardButton: ...
from
static StandardButton information(QWidget *parent, const QString &title,
const QString &text, StandardButtons buttons = Ok,
StandardButton defaultButton = NoButton);
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) // needed as long as we have int overloads
inline static StandardButton information(QWidget *parent, const QString &title,
const QString& text,
StandardButton button0, StandardButton button1 = NoButton)
{ return information(parent, title, text, StandardButtons(button0), button1); }
#endif
static StandardButton question(QWidget *parent, const QString &title,
const QString &text, StandardButtons buttons = StandardButtons(Yes | No),
StandardButton defaultButton = NoButton);
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
inline static int question(QWidget *parent, const QString &title,
const QString& text,
StandardButton button0, StandardButton button1)
{ return question(parent, title, text, StandardButtons(button0), button1); }
#endif
- is duplicated by
-
PYSIDE-3044 typing: QMessageBox.information() should have a default button
-
- Closed
-
| For Gerrit Dashboard: PYSIDE-2997 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 624102,5 | type hints: Fix the removal heuristic in case of QMessageBox | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
| 624226,2 | type hints: Fix the removal heuristic in case of QMessageBox | 6.8 | pyside/pyside-setup | Status: MERGED | +2 | 0 |