def setReadOnly(self, read_only):
        if read_only != self.isReadOnly():
            super().setReadOnly(read_only)
            from pyqode.core.panels import ReadOnlyPanel
            try:
                panel = self.panels.get(ReadOnlyPanel)
            except __HOLE__:
                self.panels.append(
                    ReadOnlyPanel(), ReadOnlyPanel.Position.TOP)
            else:
                panel.setVisible(read_only)
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/pyqode/core/api/code_edit.py/CodeEdit.setReadOnly