How to draw line between folded blocks in QPlainTextEdit?

跟風遠走 提交于 2019-12-12 03:35:03

问题


I have a struggle and I even don't know is it possible in QPlainTextEdit. Have no idea how to draw a line between to folded blocks in QPlainTextEdit :

import sys
from PySide.QtCore import *
from PySide.QtGui import *

app = QApplication(sys.argv)

textEdit = QPlainTextEdit()
textEdit.setViewportMargins( 50,0,0,0 )

textEdit.setPlainText( 
'''There is a house in New Orleans
They call the Rising Sun
And it's been the ruin of many a poor boy
And God, I know I'm one'
''')

for n in [1,2] :
    textEdit.document().findBlockByNumber(n).setVisible( False )

textEdit.setGeometry( 600, 600, 400, 250 )
textEdit.show()
sys.exit(app.exec_())

....now two blocks are folded, but can't draw the line between two visible. I would appreciate any help. Thanks.

来源:https://stackoverflow.com/questions/35349138/how-to-draw-line-between-folded-blocks-in-qplaintextedit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!