I'm trying to add a container for showing the line numbers of a QTextEdit. From what I have seen so far I need to add a QAbstractScrollArea at the first step.
The problem is that when I add the QAbstractScrollArea, the QTextEdit render read-only. Almost read-only, I can drag&drop text but I don't have any cursor to input text.
Any ideeas? Thanks!
mainWindow = QMainWindow()
textEdit = QTextEdit(mainWindow)
textDocument = QTextDocument(textEdit)
...
# adding some text do textEdit
...
scrollArea = QAbstractScrollArea()
scrollArea.setViewport(textEdit)
scrollArea.setViewportMargins(20, 0, 0, 0)
mainWindow.setCentralWidget(scrollArea)
mainWindow.show()