def qtName(name: str, lower: bool = True) -> str:
    """Transform a name into the Qt naming style (camelCase).
    """
    first, rest = name.split('_', maxsplit=1)
    if lower and not first[0].islower():
        first = first[0].lower() + first[1:]
    elif not lower and first[0].islower():
        first = first[0].upper() + first[1:]
    return (first if not rest else
            first + (''.join(s.capitalize() or '_' for s in rest.split('_'))))