Results 1 to 2 of 2

Thread: How to be notified when a child changes?

  1. #1

    Default How to be notified when a child changes?

    If I have a parent object who has a child that is a QGraphicsTextItem, is there a way for a notification to be sent to the parent when the QGraphicsTextItem is changed?

    I'm looking at itemChange but don't see a way to do this.

    Basically I'm trying to keep the text centered to my object as I type. Right now I don't even get a notification that the text is changed so it won't stay centered.

    Also I'm looking for a way to force single line. Is this possible? If not what is the best way to keep it centered. This text object is the "label" for my node, and thats why I want it centered on my parent object which is the node.

    I tried this originally without the QGraphicsTextItem, but I want the user to be able to edit it and I didn't want to reimplement everything that QGraphicsTextItem already implemented.
    Last edited by mooreaa; 3rd July 2008 at 11:07.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to be notified when a child changes?


Similar Threads

  1. child label alignment problem
    By ht1 in forum Qt Programming
    Replies: 9
    Last Post: 21st November 2007, 20:50
  2. removing child widget
    By db in forum Newbie
    Replies: 1
    Last Post: 16th August 2007, 12:19
  3. Replies: 14
    Last Post: 19th March 2007, 08:48
  4. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:00
  5. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 15:13

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.