"Are you sure you want to exit" question dialog.

    If flag_changed, shows question dialog. If answer is not yes, calls evt.ignore()

    Arguments:
      flag_changed
      evt -- QCloseEvent instance
      parent=None -- parent form, used to centralize the question dialog at
      title -- title for question dialog
      msg -- text of question dialog

    Returns True or False. True means: "yes, I want to exit"

def are_you_sure(flag_changed, evt, parent=None, title="File has been changed",
                 msg="Are you sure you want to exit?"):
    """
    "Are you sure you want to exit" question dialog.

    If flag_changed, shows question dialog. If answer is not yes, calls evt.ignore()

    Arguments:
      flag_changed
      evt -- QCloseEvent instance
      parent=None -- parent form, used to centralize the question dialog at
      title -- title for question dialog
      msg -- text of question dialog

    Returns True or False. True means: "yes, I want to exit"
    """
    if flag_changed:
        r = QMessageBox.question(parent, title, msg,
             QMessageBox.Yes|QMessageBox.No, QMessageBox.Yes)
        if r != QMessageBox.Yes:
            evt.ignore()