Results 1 to 9 of 9

Thread: Getting boundingRect of Text on QGraphicsWidget without drawing ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Qt products
    Qt4
    Thanks
    1

    Question Getting boundingRect of Text on QGraphicsWidget without drawing ?

    Hello !

    I'v got the following Situation:

    I use a QGraphicsView to display Items, so called ClassBoxes.

    So I derived a class ClassBox from QGraphicsItem , reimplemented :: paint(...) and everything is fine.

    I also have another Class LWidget which holds all the ClassBox items.

    I use LWidget->addClass(ClassBox* cb) to add new classes.

    Now i want to spread them equally over the width of my QGraphicsView. I know I can use setPos(), but my ClassBoxes contain Text, and without drawing this text i can't get the boundingBox of this text which is about the size of my Classbox. And when I draw it, I get the boundingBoxes, but the Classes are at the wrong positions becasue I can't set them without knowing the sizes of my ClassBoxes.

    Hope someone understands my cryptic text and can help me...

    TIA, Simon
    Attached Images Attached Images
    Last edited by skainz; 19th April 2007 at 18:28.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Replies: 2
    Last Post: 23rd July 2012, 08:42
  3. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  4. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  5. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02

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
  •  
Qt is a trademark of The Qt Company.