Skip to content

Commit a3b2eeb

Browse files
authored
Merge pull request #125 from stlehmann/altendky-patch-1
QtWidgets.QMessageBox enumerations are available in two places...
2 parents 5ddd8cc + a0f46e0 commit a3b2eeb

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77
## 5.15.2.0 [unreleased]
88

99
### Added
10+
* [#125](https://github.com/stlehmann/PyQt5-stubs/pull/125) on `QtWidgets.QMessageBox`, enumerators are also attributes of their enumerations
1011
* [#99](https://github.com/stlehmann/PyQt5-stubs/pull/99) enable mypy's strict mode
1112
* [#92](https://github.com/stlehmann/PyQt5-stubs/pull/92) add `Sequence` methods and `.__setitem__()` to `sip.array`
1213
* [#94](https://github.com/stlehmann/PyQt5-stubs/pull/94) add several operators to `QIODevice.OpenMode` and `QIODevice.OpenModeFlag`

PyQt5-stubs/QtWidgets.pyi

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6477,7 +6477,35 @@ class QMenuBar(QWidget):
64776477

64786478
class QMessageBox(QDialog):
64796479

6480-
class StandardButton(int): ...
6480+
class StandardButton(int):
6481+
NoButton = ... # type: 'QMessageBox.StandardButton'
6482+
Ok = ... # type: 'QMessageBox.StandardButton'
6483+
Save = ... # type: 'QMessageBox.StandardButton'
6484+
SaveAll = ... # type: 'QMessageBox.StandardButton'
6485+
Open = ... # type: 'QMessageBox.StandardButton'
6486+
Yes = ... # type: 'QMessageBox.StandardButton'
6487+
YesToAll = ... # type: 'QMessageBox.StandardButton'
6488+
No = ... # type: 'QMessageBox.StandardButton'
6489+
NoToAll = ... # type: 'QMessageBox.StandardButton'
6490+
Abort = ... # type: 'QMessageBox.StandardButton'
6491+
Retry = ... # type: 'QMessageBox.StandardButton'
6492+
Ignore = ... # type: 'QMessageBox.StandardButton'
6493+
Close = ... # type: 'QMessageBox.StandardButton'
6494+
Cancel = ... # type: 'QMessageBox.StandardButton'
6495+
Discard = ... # type: 'QMessageBox.StandardButton'
6496+
Help = ... # type: 'QMessageBox.StandardButton'
6497+
Apply = ... # type: 'QMessageBox.StandardButton'
6498+
Reset = ... # type: 'QMessageBox.StandardButton'
6499+
RestoreDefaults = ... # type: 'QMessageBox.StandardButton'
6500+
FirstButton = ... # type: 'QMessageBox.StandardButton'
6501+
LastButton = ... # type: 'QMessageBox.StandardButton'
6502+
YesAll = ... # type: 'QMessageBox.StandardButton'
6503+
NoAll = ... # type: 'QMessageBox.StandardButton'
6504+
Default = ... # type: 'QMessageBox.StandardButton'
6505+
Escape = ... # type: 'QMessageBox.StandardButton'
6506+
FlagMask = ... # type: 'QMessageBox.StandardButton'
6507+
ButtonMask = ... # type: 'QMessageBox.StandardButton'
6508+
64816509
NoButton = ... # type: 'QMessageBox.StandardButton'
64826510
Ok = ... # type: 'QMessageBox.StandardButton'
64836511
Save = ... # type: 'QMessageBox.StandardButton'
@@ -6506,14 +6534,31 @@ class QMessageBox(QDialog):
65066534
FlagMask = ... # type: 'QMessageBox.StandardButton'
65076535
ButtonMask = ... # type: 'QMessageBox.StandardButton'
65086536

6509-
class Icon(int): ...
6537+
class Icon(int):
6538+
NoIcon = ... # type: 'QMessageBox.Icon'
6539+
Information = ... # type: 'QMessageBox.Icon'
6540+
Warning = ... # type: 'QMessageBox.Icon'
6541+
Critical = ... # type: 'QMessageBox.Icon'
6542+
Question = ... # type: 'QMessageBox.Icon'
6543+
65106544
NoIcon = ... # type: 'QMessageBox.Icon'
65116545
Information = ... # type: 'QMessageBox.Icon'
65126546
Warning = ... # type: 'QMessageBox.Icon'
65136547
Critical = ... # type: 'QMessageBox.Icon'
65146548
Question = ... # type: 'QMessageBox.Icon'
65156549

6516-
class ButtonRole(int): ...
6550+
class ButtonRole(int):
6551+
InvalidRole = ... # type: 'QMessageBox.ButtonRole'
6552+
AcceptRole = ... # type: 'QMessageBox.ButtonRole'
6553+
RejectRole = ... # type: 'QMessageBox.ButtonRole'
6554+
DestructiveRole = ... # type: 'QMessageBox.ButtonRole'
6555+
ActionRole = ... # type: 'QMessageBox.ButtonRole'
6556+
HelpRole = ... # type: 'QMessageBox.ButtonRole'
6557+
YesRole = ... # type: 'QMessageBox.ButtonRole'
6558+
NoRole = ... # type: 'QMessageBox.ButtonRole'
6559+
ResetRole = ... # type: 'QMessageBox.ButtonRole'
6560+
ApplyRole = ... # type: 'QMessageBox.ButtonRole'
6561+
65176562
InvalidRole = ... # type: 'QMessageBox.ButtonRole'
65186563
AcceptRole = ... # type: 'QMessageBox.ButtonRole'
65196564
RejectRole = ... # type: 'QMessageBox.ButtonRole'

0 commit comments

Comments
 (0)