Well you can't put a normal QWidget into a QGraphicsScene unless you wrap
it in a QGraphicsProxyWidget
<http://doc.qt.io/archives/qt-4.8/qgraphicsproxywidget.html>. But if you
start doing this a lot then you are going to start reducing your
performance back towards a normal QWidget setup. It would be better to just
implement your own clickable icon item with a QGraphicsPixmapItem
<http://doc.qt.io/archives/qt-4.8/qgraphicspixmapitem.html>.

Best to avoid QWidget as much as possible if you are in a QGraphicsScene.
Usually they are only used in proxies when you really need to integrate
existing widgets.

Justin


On Fri, Dec 7, 2018 at 11:32 AM likage <[email protected]> wrote:

> Hi Justin,
>
> Thank you for getting back. I had thought using the above example may help
> me out but turns out not. :(
> And so, I have decided to paste the code here in hopes of some guidance/
> insights if any...
>
> BaseWidget <https://pastebin.com/raw/KD0CQ9Ud>
> GraphicsWidget <https://pastebin.com/raw/7KG9vkfT>
>
> [image: example_widget.jpg]
> The above 2 codes are used to created a widget (see attached) where I am
> trying to induce a 'clicked' connection towards that play icon.
>
> And it appears that I am unable to use either QPushButton or a QLabel to
> replace it, by doing so, it will cause an error.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/985acba2-be81-422b-bd51-b84e149f530f%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/985acba2-be81-422b-bd51-b84e149f530f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1_XdkAE9%2BU%2BD-dVWU%3DmZnFD%3DeGgotV_aW11JQBpwTKmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to