Guest User

Untitled

a guest
Mar 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import datrie
  2.  
  3. from PyQt5 import QtCore, QtGui
  4. from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox
  5.  
  6. from ui_dict_form import UiDictForm
  7.  
  8.  
  9. class DictWindow(QWidget, UiDictForm):
  10. def __init__(self, parent=None):
  11. QWidget.__init__(self, parent)
  12. self.setup_ui(self)
  13. self.setLayout(self.gridLayout)
  14. self.dict = datrie.Trie.load('file_dict.dict')
  15.  
  16.  
  17. def closeEvent(self, event):
  18. reply = QMessageBox.question(self, 'Message',
  19. "Вы действительно хотите выйти?",
  20. QMessageBox.Yes |
  21. QMessageBox.No, QMessageBox.No)
  22. if reply == QMessageBox.Yes:
  23. self.close()
  24. else:
  25. event.ignore()
  26.  
  27.  
  28. if __name__ == '__main__':
  29. import sys
  30.  
  31. app = QApplication(sys.argv)
  32. window = DictWindow()
  33. window.show()
  34. sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment