MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / tuple_to_qfont

Function tuple_to_qfont

lib/matplotlib/backends/qt_editor/_formlayout.py:138–155  ·  view source on GitHub ↗

Create a QFont from tuple: (family [string], size [int], italic [bool], bold [bool])

(tup)

Source from the content-addressed store, hash-verified

136
137
138def tuple_to_qfont(tup):
139 """
140 Create a QFont from tuple:
141 (family [string], size [int], italic [bool], bold [bool])
142 """
143 if not (isinstance(tup, tuple) and len(tup) == 4
144 and font_is_installed(tup[0])
145 and isinstance(tup[1], Integral)
146 and isinstance(tup[2], bool)
147 and isinstance(tup[3], bool)):
148 return None
149 font = QtGui.QFont()
150 family, size, italic, bold = tup
151 font.setFamily(family)
152 font.setPointSize(size)
153 font.setItalic(italic)
154 font.setBold(bold)
155 return font
156
157
158def qfont_to_tuple(font):

Callers 3

__init__Method · 0.85
setupMethod · 0.85
getMethod · 0.85

Calls 1

font_is_installedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…