Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.8.2
-
None
-
315a7c85a (dev), 2a2e65417 (6.8)
Description
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
Attachments
Issue Links
- is duplicated by
-
PYSIDE-3044 typing: QMessageBox.information() should have a default button
-
- Closed
-