def tuple_to_qfont(tup):
 if (not (isinstance(tup, tuple) and (len(tup) == 4) and font_is_installed(tup[0]) and isinstance(tup[1], int) and isinstance(tup[2], bool) and isinstance(tup[3], bool))):
  return None
 font = QtGui.QFont()
 (family, size, italic, bold) = tup
 font.setFamily(family)
 font.setPointSize(size)
 font.setItalic(italic)
 font.setBold(bold)
 return font

def tuple_to_qfont ( tup ) : if ( not ( isinstance ( tup , tuple ) and ( len ( tup ) == 4 ) and font_is_installed ( tup [ 0 ] ) and isinstance ( tup [ 1 ] , int ) and isinstance ( tup [ 2 ] , bool ) and isinstance ( tup [ 3 ] , bool ) ) ) : return None font = QtGui . QFont ( ) ( family , size , italic , bold ) = tup font . setFamily ( family ) font . setPointSize ( size ) font . setItalic ( italic ) font . setBold ( bold ) return font
create a qfont from tuple: .