[solved] plainTextEdit vs textEdit and .setText()
-
I have these three lines
//ui->plainTextEditLeft->setText(in.readAll()); //ui->plainTextEditLeft->toPlainText(in.readAll()); ui->textEditLeft->setText(in.readAll());
only the last uncommented one works when I use a textEdit.
If I try a plainTextEdit... I can't using the setText() function.
Is there an equivalent function to load a plainTextEdit that accepts qstring?
Is there a different way that I should be loading my plainTextEdit? I only have a desire to be working with .txt files, so I want to see ascii formatting. I assumed that's what this plainTextEdit object was.
http://qt-project.org/doc/qt-5/QPlainTextEdit.html
Update
Found it:
ui->plainTextEditLeft->setPlainText(in.readAll());derp:
"The text is set or replaced using setPlainText() which deletes the existing text and replaces it with the text passed to setPlainText()."and... it's not ascii
-
What do you mean by ascii formatting?
Plain text is literally just plain text. Nothing fancy like formatting. No bold, no italics, no colors, etc. I.e. not rich text.
So like my comment here would be plain text. Whereas if I included code and wanted coloring and different looks to some text it would be a rich text thing.
-
yeah, the issue was I needed to use the
.toLatin1() function I believe.
As
.toAscii() was depreciated.
as to the ascii formatting.
I assumed it did ascii formatting vs non courier font, but I figured a way to set the font already using a ui-> call.