Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt 如何在QPlainTextEdit中绘制折叠块之间的线?_Qt_Pyqt_Pyside_Code Folding - Fatal编程技术网

Qt 如何在QPlainTextEdit中绘制折叠块之间的线?

Qt 如何在QPlainTextEdit中绘制折叠块之间的线?,qt,pyqt,pyside,code-folding,Qt,Pyqt,Pyside,Code Folding,我有一个挣扎,我甚至不知道在QPlainTextEdit中是否可能。 不知道如何在QPlainTextEdit中的折叠块之间画一条线: import sys from PySide.QtCore import * from PySide.QtGui import * app = QApplication(sys.argv) textEdit = QPlainTextEdit() textEdit.setViewportMargins( 50,0,0,0 ) textEdit.setPlai

我有一个挣扎,我甚至不知道在
QPlainTextEdit
中是否可能。 不知道如何在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_())

..现在两个块已折叠,但无法在两个可见块之间绘制线。我将感谢任何帮助。谢谢。

我不知道QPlainTextEdit是否允许根据需要进行如此多的定制。更好地使用QTextEdit进行高级格式化,否?您可以在行之间插入一个
,但您可以自己处理有效的文本内容TextCursor()。insertHtml(
)不起作用?-注意,我没有将Python与Qt结合使用,但C++没有!但大多数其他标签都能工作。