QPlaintTextEdit and setFont to selected Char
Hi, how can setFont() to selected char in QPlainTextEdit (no to all QPlainTextEdit) ???
9 replies
it’s didnt work ;(
Save
- void PageItem::save()
- {
- if( haveFile )
- {
- if( !isSaved )
- {
- {
- t_Stream << PlainTextEdit->toPlainText();
- File->close();
- }
- isSaved = true;
- }
- }else
- {
- saveAs(t_Dialog.getSaveFileName(0,"Save"));
- }
- }
Open
- {
- PlainTextEdit->setPlainText(stream.readAll());
- File->close();
- }
if i save with font after open font is default (not like after save)
Pablik2005 , I thi* nk you want to save your QPlainTextEdit content with format to rtf file!
but,rtf files and it’s formats just for Microsoft ;Not Standard For All Platforms!
if you want to save your custom text format, you can save it and open it by HTML tags.
Convert it to HTML or use QTextEdit as this :
- //for open
- ui->textEdit->setHtml("<b>Bold Text</b>");
- //for save
- ui->textEdit->toHtml();
and if you want to design a text editor , see this link [qt-apps.org]
You must log in to post a reply. Not a member yet? Register here!

