Constraining QGraphicsTextItem to a specified rectangle.



  • I am trying to write a WYSIWYG word processor and I'm trying to find the best way to use Qt for this task.

    Using a QGraphicsTextItem in a QGraphicsScene/View seems like a good idea, but I am constantly finding new hurdles to jump through. Most of them seem to be related to the fact that this is my beginner Qt project.

    My current problem is that I am unable to confine the text within given a vertical boundary and the text just go on until it hits the bottom of the QGraphicsScene/View.
    !http://i.imgur.com/NfkvmvS.png(problem)!
    "My code":https://gist.github.com/ironhouzi/909721619d3584f25136

    The idea is that the boundary represents a virtual page which the user can flip through, like you would do when previewing a document in MS Word or Libre Office.



  • Why not just use a text browser widget(s) in a normal window?
    I think using a QGraphicsScene just complicates matters...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.