Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Constraining QGraphicsTextItem to a specified rectangle.

    General and Desktop
    2
    2
    494
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      houzi last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • K
        kenchan last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post