Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Creating Rich Text Documents > Creating QTextDocuments

Creating QTextDocuments

There are two techniques that can be used to populate a QTextDocument: give it a QString of HTML-formatted text, or use a QTextCursor. We will show both approaches in this section, starting with the use of HTML.

Of course, in some cases, we don’t need a document at all, but simply want to render our data into a file in a standard format or to print our data. In such cases—and providing we don’t need HTML or ODF output—we can avoid using a QTextDocument at all and simply use a QPainter; this is covered in this chapter’s last section ( 379).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint