def __init__(self, value, parent=None): QGridLayout.__init__(self) if not font_is_installed(value[0]): print(f"Warning: Font `{value[0]}` is not installed", file=sys.stderr) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QComboBox(parent) self.size.setEditable(True) sizelist = list(range(6, 12)) + list(range(12, 30, 2)) + [36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
def __init__(self, graphs, parent=None): QGridLayout.__init__(self, parent) self.startTime = None self.graphs = [] for index, graph in enumerate(graphs): graph = QGraph(graph, parent) self.graphs.append(graph) self.addWidget(graph, int(index / constants.GRAPHS_PER_ROW), index % constants.GRAPHS_PER_ROW)
def __init__(self): QGridLayout.__init__(self)