]> Softwares of Agnibho - ddstorm.git/blob - _differentials.py
Added an exception handling
[ddstorm.git] / _differentials.py
1 # DDStorm
2 # -------
3 # Copyright (c) 2015 Agnibho Mondal
4 # All rights reserved
5
6 # This file is part of DDStorm.
7
8 # DDStorm is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12
13 # DDStorm is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with DDStorm. If not, see <http://www.gnu.org/licenses/>.
20
21 from PyQt4 import QtGui
22
23 class Differentials(QtGui.QFrame):
24 data=[]
25 def __init__(self):
26 super(Differentials, self).__init__()
27 self.initUI()
28 def initUI(self):
29 self.label=QtGui.QLabel("Differential Diagnosis")
30 self.label.setStyleSheet("font-size:18px")
31 self.listWidget=QtGui.QListWidget(self)
32 self.listWidget.setStyleSheet("font-size:14px")
33 self.listWidget.setSelectionMode(0)
34 box=QtGui.QVBoxLayout()
35 box.addWidget(self.label)
36 box.addWidget(self.listWidget)
37 self.setLayout(box)
38
39 def update(self, data):
40 self.data=data
41 self.listWidget.clear()
42 if(self.data):
43 for d in self.data:
44 QtGui.QListWidgetItem(d, self.listWidget)
45
46 def getList(self):
47 return self.data