def version_to_sip_tag(version):
    """ Convert a version number to a SIP tag.  version is the version number.
    """
    if version > 393216:
        version = 393216
    major = version >> 16 & 255
    minor = version >> 8 & 255
    patch = version & 255
    if (major, minor) >= (5, 13):
        patch = 0
    elif (major, minor) == (5, 12):
        if patch > 4:
            patch = 4
    return 'Qt_%d_%d_%d' % (major, minor, patch)
