1 # class for main window
4 import biacv_mainwindow_ui
as bui
6 class Biacv_mainwindow (PyQt4
.QtGui
.QMainWindow
, bui
.Ui_biacv_mainwindow
):
8 PyQt4
.QtGui
.QMainWindow
.__init
__ (self
)
11 def on_add_education (self
):
12 # check if the qualification title is set
13 if self
.degree_name
.text () == "":
14 PyQt4
.QtGui
.QMessageBox
.critical (self
, "Cannot add", "Some required fields are missing.")
16 educationitem
= PyQt4
.QtGui
.QTreeWidgetItem ([
17 self
.degree_name
.text (),
18 self
.yearofpassing
.date ().toString ("MMM, yyyy"),
19 self
.institution
.text (),
20 self
.university
.text (),
22 str (self
.percentage
.value ())
24 self
.educationlist
.addTopLevelItem (educationitem
)