How to embed traitsgui as widget to existent PyQT application?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to embed traitsgui as widget to existent PyQT application?

Ali Tlisov
Hi!
I want to embed traitsgui as a widget to exisent PyQt application. Is it
possible?
Also I want to embed Chaco plot in the same application.
How it can be accomplished?
Thanks a lot!

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to embed traitsgui as widget to existent PyQT application?

Boiteux, Benoit
Hi,

Some weeks ago, I tried to include a child window (chaco plot) into a PyQt MDI application.

What I did:
- Added this import:
import sip
sip.setapi('QVariant', 2)

- then created chaco window:
container = PlotContainer()
plot_window = Window(None, -1, component=container)
plot_window.control.setWindowTitle('Chaco Plot')
plot_window.control.resize(400,400)
       
plot_window.control.setAttribute(QtCore.Qt.WA_DeleteOnClose)
       
self.mdiArea.addSubWindow(plot_window.control)
plot_window.control.show()

(fyi,
mdiArea = QtGui.QMdiArea()
PlotContainer is a OverlayPlotContainer with a basic line plot)

Please find attached a sc of the result.

My 2 cts.

Benoit

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ali Tlisov
Sent: Wednesday, June 16, 2010 10:06 AM
To: [hidden email]
Subject: [Enthought-Dev] How to embed traitsgui as widget to existent PyQT application?

Hi!
I want to embed traitsgui as a widget to exisent PyQt application. Is it
possible?
Also I want to embed Chaco plot in the same application.
How it can be accomplished?
Thanks a lot!

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

PyQt_chaco.PNG (52K) Download Attachment