Create a QFont from tuple: (family [string], size [int], italic [bool], bold [bool])
(tup)
| 136 | |
| 137 | |
| 138 | def 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 | |
| 158 | def qfont_to_tuple(font): |
no test coverage detected
searching dependent graphs…