[SOLVED]iomanip in Qt: Manipulating displayed text
-
Title says it all. Is there one? Been looking around and haven't found one. I'm printing it all into a QTextEdit to show the user and I need to manipulate some of it to make it look pretty. For example:
@
cout << setw(15) << right << "Something.";
// But the Qt version of it...so like:
data->setw(15).insertPlainText(tr("Something"));
// data is a QTextEdit. Im sure that last statement is absolutely wrong but yeah...hope you understand what I am trying to do.
@ -
No, there is no such means for QTextEdit. You will have to use qsprintf or QString::arg() or something similar to prepare the string.
Also, make sure to set a fixed width font for the text edit, otherwise all that formatting will be useless.
-
QTextEdit supports a subset of HTML. Do you need more than that?
-
@Andre! Savior, completly forgot about the HTML. I'll use that which I'm pretty sure will work. Else I'll do it with strings. Thanks to both!
-
"please check this":http://developer.qt.nokia.com/doc/qt-4.8/QTextEdit.html