You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



  • "Syntho" is male
  • "Syntho" started this thread

Posts: 3

Occupation: C++/C#/Python developer

  • Send private message


Friday, September 25th 2009, 6:27pm

How QTextLayout working with text

I've QLabel with width = 200 px and text string "Hello, world!\nNext line." When my application runs I see 2 text line: first "Hello, world!" and second "Next line.". It is right.

If I tried to lay out text manually (create QTextLayout then create QTextLine untill !line.isValid) I've got only 1 QTextLine with entire text. But I expect 2 QTextLine, like in first case. What's wrong? How could I use QTextLayout for string with line feeds or HTML line breaks tags???
in board we trust

This post has been edited 1 times, last edit by "Syntho" (Sep 25th 2009, 6:33pm)