Results 1 to 5 of 5

Thread: How do you embed a widget in a graphics item?

  1. #1
    Join Date
    Oct 2009
    Posts
    47
    Thanks
    10

    Lightbulb How do you embed a widget in a graphics item?

    Hi guys,

    So I was wondering if anyone can point me to a resource that shows me how to embed a Widget into a graphic items.

    I'm currently doing animation to the graphics item and want the widget to also see these effects.

    Thanks

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How do you embed a widget in a graphics item?

    QGraphicsProxyWidget.

    You can use the QGraphicsScene's AddWidget function, to get one..

    HIH

    Joh

  3. #3
    Join Date
    Oct 2009
    Posts
    47
    Thanks
    10

    Default Re: How do you embed a widget in a graphics item?

    Hi thanks, I used the add widget function, and that adds the widget in the graphics scene. I then can manipulate the widget with the proxy widget.

    But my question is...is this really embedding the Widget into a graphics item? or is it simply putting a widget on the graphic scene?

    Can I transform the widget just like a graphics item once its in the scene or do I have to some how combine a graphic item with the widget?

  4. #4
    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 do you embed a widget in a graphics item?

    You can use QGraphicsScene::addWidget to add a widget to a scene.
    This returns a QGraphicsProxyWidget* which is inherited from QGraphicsWidget which in turn is inherited from QGraphicsItem.
    So you can use it to transform purposes as you do on a graphics item.

  5. The following user says thank you to aamer4yu for this useful post:

    technoViking (10th November 2009)

  6. #5
    Join Date
    Oct 2009
    Posts
    47
    Thanks
    10

    Default Re: How do you embed a widget in a graphics item?

    ah!! thanks so much for the explanation. Makes perfect sense

Similar Threads

  1. Replies: 8
    Last Post: 1st October 2015, 07:23
  2. Replies: 22
    Last Post: 14th October 2010, 17:44
  3. how to you send signals to a graphics item?
    By technoViking in forum Qt Programming
    Replies: 4
    Last Post: 6th November 2009, 19:40
  4. Graphics item position after drag
    By Miihkali in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2009, 10:01
  5. Graphics widget with background
    By ad5xj in forum Newbie
    Replies: 2
    Last Post: 24th August 2007, 16:29

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.