Can I have single line sized QTextEdit with simple html?
问题 I need to display simple status row with text which will contain following styles: color bold italic QTextEdit can render simple HTML. But it also forcibly expands over multiple lines: Red background was added to emphasize the dimensions of the QTextEdit . Desired size is the size of one text line. How do I achieve that? 回答1: First of all, if you've simply used a QLabel , you'd not need to do anything special: it supports rich text format, and only takes as much space as necessary: #include