def init_top_layout(self):
title = QtWidgets.QLabel('Mass Function Upload')
title.setStyleSheet('font: 16pt;')
description = QtWidgets.QLabel((
'Upload function prototype to server for others to access.\n'
'Select the functions you want to upload. Click to select a '
'function and click again to deselect the function. Once '
'uploaded you can manage prototypes you\'ve created in the '
'management window.'))
description.setWordWrap(True)
description.setLineWidth(200)
description.setStyleSheet('text-size: 90%')
vbox_text = QtWidgets.QVBoxLayout()
vbox_text.addWidget(title)
vbox_text.addWidget(description)
vbox_legend = QtWidgets.QVBoxLayout()
grid_legend = QtWidgets.QGridLayout()
style = 'background-color: #{0:06x}; border: 1px solid #c0c0c0;'
colors = [ FIRST.color_changed, FIRST.color_unchanged,
FIRST.color_default, FIRST.color_selected]
text = ['Changed', 'Unchanged', 'Default', 'Selected']
for i in xrange(len(colors)):
box = QtWidgets.QLabel()
box.setFixedHeight(10)
box.setFixedWidth(10)
box.setStyleSheet(style.format(colors[i].color().rgb() & 0xFFFFFF))
grid_legend.addWidget(box, i, 0)
grid_legend.addWidget(QtWidgets.QLabel(text[i]), i, 1)
vbox_legend.addLayout(grid_legend)
vbox_legend.setAlignment(Qt.AlignRight | Qt.AlignBottom)
self.top_layout.addLayout(vbox_text)
self.top_layout.addStretch()
self.top_layout.addLayout(vbox_legend)
评论列表
文章目录