from PyQt5.Qt import * from PyQt5.Qsci import QsciScintilla from PyQt5.Qsci import QsciLexerCPP from sip import SIP_VERSION_STR class Lexer(QsciLexerCPP): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def defaultPaper(self, style): return QColor(QColor("#272822")) if __name__ == '__main__': WANT_TO_EXPOSE_THE_BUG = False app = QApplication([]) w = QMainWindow() print(f"Qt version: {QT_VERSION_STR}") print(f"SIP version: {SIP_VERSION_STR}") print(f"PyQt version: {PYQT_VERSION_STR}") lexer = Lexer() widget1 = QsciScintilla() widget1.setText("Hello world\n" * 10) widget1.setLexer(lexer) dock1 = QDockWidget("dock1", w) dock1.setWidget(widget1) w.addDockWidget(Qt.BottomDockWidgetArea, dock1) if WANT_TO_EXPOSE_THE_BUG: widget2 = QOpenGLWidget() dock2 = QDockWidget("dock2", w) dock2.setWidget(widget2) w.addDockWidget(Qt.BottomDockWidgetArea, dock2) w.show() app.exec_()