self.setupUi (self)
def on_add_education (self):
- print "Education"
\ No newline at end of file
+ # check if the qualification title is set
+ if self.degree_name.text () == "":
+ PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "Some required fields are missing.")
+ else:
+ educationitem = PyQt4.QtGui.QTreeWidgetItem ([
+ self.degree_name.text (),
+ self.yearofpassing.date ().toString ("MMM, yyyy"),
+ self.institution.text (),
+ self.university.text (),
+ self.grade.text (),
+ str (self.percentage.value ())
+ ])
+ self.educationlist.addTopLevelItem (educationitem)
\ No newline at end of file
<item row="1" column="0" colspan="2">
<widget class="QTabWidget" name="pages">
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
</widget>
</item>
<item row="5" column="0" colspan="8">
- <widget class="QColumnView" name="educationlist">
+ <widget class="QTreeWidget" name="educationlist">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <column>
+ <property name="text">
+ <string>Degree</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Graduation date</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Institution</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>University</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Grade</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Percentage</string>
+ </property>
+ </column>
</widget>
</item>
</layout>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_New">
<property name="text">
- <string>&New...</string>
+ <string>&New</string>
</property>
</action>
<action name="action_Save">
<property name="text">
- <string>&Open</string>
+ <string>&Open...</string>
</property>
</action>
<action name="action_Save_2">
# Form implementation generated from reading ui file 'biacv_mainwindow.ui'
#
-# Created: Wed Nov 30 10:05:57 2011
+# Created: Wed Nov 30 10:52:18 2011
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
self.deleteeducation.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8))
self.deleteeducation.setObjectName(_fromUtf8("deleteeducation"))
self.gridLayout_3.addWidget(self.deleteeducation, 4, 7, 1, 1)
- self.educationlist = QtGui.QColumnView(self.tab_2)
+ self.educationlist = QtGui.QTreeWidget(self.tab_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.educationlist.sizePolicy().hasHeightForWidth())
self.educationlist.setSizePolicy(sizePolicy)
self.educationlist.setObjectName(_fromUtf8("educationlist"))
+ self.educationlist.headerItem().setText(0, QtGui.QApplication.translate("biacv_mainwindow", "Degree", None, QtGui.QApplication.UnicodeUTF8))
+ self.educationlist.headerItem().setText(1, QtGui.QApplication.translate("biacv_mainwindow", "Graduation date", None, QtGui.QApplication.UnicodeUTF8))
+ self.educationlist.headerItem().setText(2, QtGui.QApplication.translate("biacv_mainwindow", "Institution", None, QtGui.QApplication.UnicodeUTF8))
+ self.educationlist.headerItem().setText(3, QtGui.QApplication.translate("biacv_mainwindow", "University", None, QtGui.QApplication.UnicodeUTF8))
+ self.educationlist.headerItem().setText(4, QtGui.QApplication.translate("biacv_mainwindow", "Grade", None, QtGui.QApplication.UnicodeUTF8))
+ self.educationlist.headerItem().setText(5, QtGui.QApplication.translate("biacv_mainwindow", "Percentage", None, QtGui.QApplication.UnicodeUTF8))
self.gridLayout_3.addWidget(self.educationlist, 5, 0, 1, 8)
self.pages.addTab(self.tab_2, _fromUtf8(""))
self.tab_3 = QtGui.QWidget()
self.statusbar.setObjectName(_fromUtf8("statusbar"))
biacv_mainwindow.setStatusBar(self.statusbar)
self.action_New = QtGui.QAction(biacv_mainwindow)
- self.action_New.setText(QtGui.QApplication.translate("biacv_mainwindow", "&New...", None, QtGui.QApplication.UnicodeUTF8))
+ self.action_New.setText(QtGui.QApplication.translate("biacv_mainwindow", "&New", None, QtGui.QApplication.UnicodeUTF8))
self.action_New.setObjectName(_fromUtf8("action_New"))
self.action_Save = QtGui.QAction(biacv_mainwindow)
- self.action_Save.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Open", None, QtGui.QApplication.UnicodeUTF8))
+ self.action_Save.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Open...", None, QtGui.QApplication.UnicodeUTF8))
self.action_Save.setObjectName(_fromUtf8("action_Save"))
self.action_Save_2 = QtGui.QAction(biacv_mainwindow)
self.action_Save_2.setText(QtGui.QApplication.translate("biacv_mainwindow", "&Save", None, QtGui.QApplication.UnicodeUTF8))
self.menubar.addAction(self.menu_Help.menuAction())
self.retranslateUi(biacv_mainwindow)
- self.pages.setCurrentIndex(1)
+ self.pages.setCurrentIndex(0)
QtCore.QObject.connect(self.addeducation, QtCore.SIGNAL(_fromUtf8("clicked()")), biacv_mainwindow.on_add_education)
QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow)