def initUI(self):
self.chosen = []
self.grid = QtGui.QGridLayout()
self.checkbox = []
self.checkbox.append(QtGui.QCheckBox('Check / Uncheck all', self))
self.grid.addWidget(self.checkbox[-1], 0, 0)
i = 0
c = 0
icons = Icons()
for stn in sorted(self.stations, key=lambda station: station.name):
if stn.technology[:6] == 'Fossil' and not self.actual:
continue
if stn.technology == 'Rooftop PV' and stn.scenario == 'Existing' and not self.gross_load:
continue
self.checkbox.append(QtGui.QCheckBox(stn.name, self))
icon = icons.getIcon(stn.technology)
if icon != '':
self.checkbox[-1].setIcon(QtGui.QIcon(icon))
i += 1
self.grid.addWidget(self.checkbox[-1], i, c)
if i > 25:
i = 0
c += 1
self.grid.connect(self.checkbox[0], QtCore.SIGNAL('stateChanged(int)'), self.check_all)
show = QtGui.QPushButton('Choose', self)
self.grid.addWidget(show, i + 1, c)
show.clicked.connect(self.showClicked)
self.setLayout(self.grid)
self.setWindowTitle('SIREN - Power Stations dialog')
QtGui.QShortcut(QtGui.QKeySequence('q'), self, self.quitClicked)
self.show_them = False
self.show()
评论列表
文章目录