QTextEdit simple question
Hi I'm new in QTDesigner, so my question is very simple.
I created a TextEdit box, where I'll write simple text, then I want to save it into a file.
the file stuff is done, I open a file and I can add data, but my problem is that I dont know how to get the text from the TextEdit box.
how can I get the string from the box?
or how can I put it into mi file ?
Is there something like: myFile<<textEditorBox.getString() ?
I guess this is very simple, but my F1 Help file is missing and tried looking into the forum but I could't find something usefull.
Thanks in advance.
Re: QTextEdit simple question
Re: QTextEdit simple question
thanks for your response
I soleved my problem
bassically I needed this:
myfile << cajaTexto->text();
where "cajaText" is my textEdit..
very simple...
thanks
Re: QTextEdit simple question
This works fine for Qt3, but doesn't for Qt4.2.3:(
I looked through the Trolltech Qt4 examples for QTextEdit, but found no examples where the edited information was saved to a file.
Re: QTextEdit simple question
Quote:
Originally Posted by
Carlton
This works fine for Qt3, but doesn't for Qt4.2.3
In Qt 4 you have to use QTextEdit::toPlainText() or QTextEdit::toHtml().
Quote:
Originally Posted by
Carlton
I looked through the Trolltech Qt4 examples for QTextEdit, but found no examples where the edited information was saved to a file.
See the demos/textedit.