def qstr(text):
    """
    Convert text (QVariant, QString, string) or numeric object to plain string.

    In Python 3, python Qt objects are automatically converted to QVariant
    when stored as "data" e.g. in a QComboBox and converted back when
    retrieving. In Python 2, QVariant is returned when itemData is retrieved.
    This is first converted from the QVariant container format to a
    QString, next to a "normal" non-unicode string.

    Parameter:
    ----------
    
    text: QVariant, QString, string or numeric data type that can be converted
      to string
    
    Returns:
    --------
    
    The current `text` data as a string
    """
    if "QString" in str(type(text)):
        # Python 3: convert QString -> str
        string = str(text)
#    elif not isinstance(text, six.text_type):
    elif "QVariant" in str(type(text)):
        # Python 2: convert QVariant -> QString -> str
        string = str(text.toString())
    else:
        # `text` is numeric or of type str
        string = str(text)
    return string