How to align QTextEdit text
问题 How can I align this text? \t is not good. What I see (image) Expected result (image) 回答1: I had this problem once in the past. To solve the issue I used monospace font. To get everything aligned (fixed font width) I used these lines: // Use "monospaced" font: // ->insure left column alignment, as for the terminal // QFont font("monospace"); font.setPointSize(10); myQTextEdit->setCurrentFont(font); from my parent widget containing a QTextEdit child widget. 回答2: this line: QString str =