Vispy canvas as a widget in a non-vispy Qt application.

866 views
Skip to first unread message

Yuri Spitsyn

unread,
Dec 20, 2014, 12:33:16 AM12/20/14
to vi...@googlegroups.com
I have a Qt application (non-vispy) that needs to use some visualization. The search led me to vispy.
From glancing over documentation it seems like vispy Canvas requires vispy Application. Is it so or there is a way to embed Canvas into a non-vispy Qt application?

Almar Klein

unread,
Dec 20, 2014, 3:27:52 PM12/20/14
to vi...@googlegroups.com
Hi Yuri,

Yes, a canvas needs an Application, but each Application is just a
wrapper around a real application object, which with Qt, is a genuine Qt
application. Actually, if you first import PySide/PyQy4, and then create
a vispy.app.Canvas(), the Canvas will use Qt, and you can embed the
widget in your application, without worrying about the Application
object. For example:

canvas = app.Canvas(parent=widget)
widget.layout().addWidget(canvas.native)


For an example see e.g.
https://github.com/vispy/vispy/blob/master/examples/tutorial/app/shared_context.py

Regards,
Almar
> --
> You received this message because you are subscribed to the Google
> Groups "vispy" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to vispy+un...@googlegroups.com
> <mailto:vispy+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Yuri Spitsyn

unread,
Dec 20, 2014, 4:18:22 PM12/20/14
to vi...@googlegroups.com

Nice!

Thanks, Almar.
Reply all
Reply to author
Forward
0 new messages