Quote Originally Posted by antialias_forum View Post
However, I was hoping to get rid of the 'invisible text'-hack somehow.
You could scale the Text based on how much it exceeds your width at the specified pixelSize:

Qt Code:
  1. import Qt 4.7
  2. Rectangle {
  3. width: 200
  4. height: 200
  5. Text {
  6. width: 200
  7. height: 100
  8. text: "Some sample text here"
  9. font.pixelSize: height / 4
  10. scale: paintedWidth > width ? (width / paintedWidth) : 1
  11. transformOrigin: Item.TopLeft
  12. }
  13. }
To copy to clipboard, switch view to plain text mode