def _reset_stylesheet(self):
        """ Resets stylesheet"""
        self.setFont(QtGui.QFont(self._font_family,
                                 self._font_size + self._zoom_level))
        flg_stylesheet = hasattr(self, '_flg_stylesheet')
        if QtWidgets.QApplication.instance().styleSheet() or flg_stylesheet:
            self._flg_stylesheet = True
            # On Window, if the application once had a stylesheet, we must
            # keep on using a stylesheet otherwise strange colors appear
            # see https://github.com/OpenCobolIDE/OpenCobolIDE/issues/65
            # Also happen on plasma 5
            try:
                plasma = os.environ['DESKTOP_SESSION'] == 'plasma'
            except KeyError:
                plasma = False
            if sys.platform == 'win32' or plasma:
                self.setStyleSheet('''QPlainTextEdit
                {
                    background-color: %s;
                    color: %s;
                }
                ''' % (self.background.name(), self.foreground.name()))
            else:
                # on linux/osx we just have to set an empty stylesheet to
                # cancel any previous stylesheet and still keep a correct
                # style for scrollbars
                self.setStyleSheet('')
        else:
            p = self.palette()
            p.setColor(QtGui.QPalette.Base, self.background)
            p.setColor(QtGui.QPalette.Text, self.foreground)
            p.setColor(QtGui.QPalette.Highlight,
                       self.selection_background)
            p.setColor(QtGui.QPalette.HighlightedText,
                       self.selection_foreground)
            self.setPalette(p)
        self.repaint()
def _reset_stylesheet ( self ) : self . setFont ( QtGui . QFont ( self . _font_family , self . _font_size + self . _zoom_level ) ) flg_stylesheet = hasattr ( self , '_flg_stylesheet' ) if QtWidgets . QApplication . instance ( ) . styleSheet ( ) or flg_stylesheet : self . _flg_stylesheet = True try : plasma = os . environ [ 'DESKTOP_SESSION' ] == 'plasma' except KeyError : plasma = False if sys . platform == 'win32' or plasma : self . setStyleSheet ( '''QPlainTextEdit
                {
                    background-color: %s;
                    color: %s;
                }
                ''' % ( self . background . name ( ) , self . foreground . name ( ) ) ) else : self . setStyleSheet ( '' ) else : p = self . palette ( ) p . setColor ( QtGui . QPalette . Base , self . background ) p . setColor ( QtGui . QPalette . Text , self . foreground ) p . setColor ( QtGui . QPalette . Highlight , self . selection_background ) p . setColor ( QtGui . QPalette . HighlightedText , self . selection_foreground ) self . setPalette ( p ) self . repaint ( )
Resets stylesheet