Skip to content

Commit ed976e4

Browse files
committed
Improve dialog close buttons
1 parent 8149458 commit ed976e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import argparse
22
import sys
33
from PySide6.QtCore import QLibraryInfo, QLocale, QTranslator
4-
from PySide6.QtWidgets import QApplication, QDialog
4+
from PySide6.QtWidgets import QApplication, QDialog, QDialogButtonBox
55
from YearCalculator import YearCalculatorDialog
66

77

@@ -72,8 +72,9 @@ def main():
7272
calendar_type = YearCalculatorDialog.CALENDARS.DEFAULT
7373

7474
dlg = YearCalculatorDialog(gregorian_year, native_year, calendar_type)
75-
if dlg.exec() == QDialog.Accepted:
76-
print(dlg.year(), '=', dlg.nativeYear())
75+
dlg.buttonBox.clear()
76+
dlg.buttonBox.addButton(QDialogButtonBox.Close)
77+
dlg.exec()
7778

7879

7980
if __name__ == "__main__":

0 commit comments

Comments
 (0)