Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Constraining QGraphicsTextItem to a specified rectangle.
QtWS25 Last Chance

Constraining QGraphicsTextItem to a specified rectangle.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 667 Views
  • 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 Offline
    H Offline
    houzi
    wrote on last edited by
    #1

    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
    0
    • K Offline
      K Offline
      kenchan
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved