Results 1 to 2 of 2

Thread: QGraphicsTextItem size

  1. #1
    Join Date
    Jan 2007
    Location
    Rome
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Cool QGraphicsTextItem size

    Hello everybody!

    I try to use the QGraphics framework to create a custom QGraphicsItem that contain some
    text and images. The custom widget is created and contains some QGraphicsTextItem as a child to manage the textual areas.

    I have a problem to set the size of the textual editable areas.
    I currently use a QGraphicsTextItem. I can set the width of the item (respect to the parent Item) using the setTextWidth() method.
    I try to create a QTextDocument with a fixed size (to be used for the QGraphicsTextItem) using setPageSize() to specify the document size but with no good result.

    What is the best way to limit the size of a QGraphicsTextItem (if exist one) ?

    I have also a problem of refresh. I put, in the paint method of the custom item, a rounded rect . When I edited the text in the QGraphicsItem the background seems to doesn't repaint, near the edited text a white rect is painted and only when I refresh the entire window the QGraphicsItem is repainted well. Any suggestions ?

    Thanks in advance,

    Angelo

  2. #2
    Join Date
    Jan 2007
    Location
    Rome
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QGraphicsTextItem size

    Just a quick notification !

    The refresh issue has been resolved (I paint something outside the bounding rect ), this
    cause a lot of problems also when I moved the Item in the scene.

Similar Threads

  1. Replies: 3
    Last Post: 30th January 2007, 07:35
  2. Replies: 1
    Last Post: 24th October 2006, 16:40
  3. QTreeView font size not being set
    By forrestfsu in forum Qt Tools
    Replies: 2
    Last Post: 12th October 2006, 13:53
  4. Size of remote package ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2006, 01:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.