def set_selected(self, selected):
    ' Update the styling to reflect if the widget is selected or not '
    if selected:
        p = QtGui.QPalette()
        highlight_col = p.color(QtGui.QPalette.Active, QtGui.QPalette.Highlight)
        transp_highlight_str = ('rgba(%s, %s, %s, 25%%)' % (highlight_col.red(), highlight_col.green(), highlight_col.blue()))
        highlight_str = ('rgb(%s, %s, %s)' % (highlight_col.red(), highlight_col.green(), highlight_col.blue()))
        self.setStyleSheet(('#frame {\n                    border-width: 2px;\n                    border-color: %s;\n                    border-style: solid;\n                    background-color: %s;\n                   }\n                ' % (highlight_str, transp_highlight_str)))
    else:
        self.setStyleSheet('#frame {\n                      border-width: 2px;\n                      border-color: transparent;\n                      border-style: solid;\n                }')
Update the styling to reflect if the widget is selected or not
def set_selected(self, selected):
    '  '
    if selected:
        p = QtGui.QPalette()
        highlight_col = p.color(QtGui.QPalette.Active, QtGui.QPalette.Highlight)
        transp_highlight_str = ('rgba(%s, %s, %s, 25%%)' % (highlight_col.red(), highlight_col.green(), highlight_col.blue()))
        highlight_str = ('rgb(%s, %s, %s)' % (highlight_col.red(), highlight_col.green(), highlight_col.blue()))
        self.setStyleSheet(('#frame {\n                    border-width: 2px;\n                    border-color: %s;\n                    border-style: solid;\n                    background-color: %s;\n                   }\n                ' % (highlight_str, transp_highlight_str)))
    else:
        self.setStyleSheet('#frame {\n                      border-width: 2px;\n                      border-color: transparent;\n                      border-style: solid;\n                }')