def check_format_str(text):
    """
    Checks a QLineEdit string formatter

    Parameters
    ----------
    text : str
        a QLineEdit containing a string formatter like:
        {'%s', '%i', '%f', '%g', '%.3f', '%e'}

    Returns
    -------
    text : str / None
        str : the validated text of the QLineEdit
        None : the format is invalid
    is_valid : bool
        The str/None flag to indicate if the string formatter is valid
    """
    text = text.strip()
    is_valid = True
    if len(text) < 2:
        is_valid = False
    elif 's' in text.lower():
        is_valid = False
    elif '%' not in text[0]:
        is_valid = False
    elif text[-1].lower() not in ['g', 'f', 'i', 'e']:
        is_valid = False
    try:
        text % 1
        text % 0.2
        text % 1000.0
        text % -5.0
        text % -5
    except ValueError:
        is_valid = False
    try:
        text % 's'
        is_valid = False
    except TypeError:
        pass
    return text, is_valid
