How do I use QTextBlock?

前端 未结 3 910
夕颜
夕颜 2021-01-02 10:31

I\'m completely new to C++ and Qt.

I want to populate a QTextEdit object with QTextBlocks, how do I do that?

e.g. If I hav

3条回答
  •  情书的邮戳
    2021-01-02 11:27

    Keep them on the same line by using insertText without using insertBlock between.

    For instance, when I tried

    cursor.insertText("I will try ", textFormat);
    cursor.insertText("this for you.", textFormat);
    

    for you, the words all appeared on the same line.

    insertBlock inserts a paragraph.

提交回复
热议问题