def getCompoundedStylesheet(widget):
    """
    This will return the entire stylesheet which is affecting this widget. 
    The resulting stylesheet will be the widgets stylesheet, and the 
    stylesheet of all its parents.
    
    The order is such that the widgets style is last, and the root level
    widgets style is first - meaning you can apply the returned stylesheet
    to create the exact same result.
    
    :param widget: Widget to read the style from
    :type widget: QWidget
    
    :return: stylesheet data
    :rtype: str
    """
    all_data = [widget.styleSheet()]
    while widget.parentWidget():
        widget = widget.parentWidget()
        all_data.append('' or widget.styleSheet())
    all_data.reverse()
    all_data = '\n'.join(all_data)
    return all_data
