including a child window (chaco plot) into a PyQt MDI application.

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

including a child window (chaco plot) into a PyQt MDI application.

Ali Tlisov
Some weeks ago a question was rised in this list about incuding chaco
plot or traitsUI elements into existing PyQT application.

And there was one suggestion from Mr Boiteux Benoit on how to include
chaco plot as child window to PyQT application.
Because of lack of understanding I was unable to reproduce the working
example of code. I'm new to chaco and traits as well so working example
is highly appreciated. Dear Mr Boiteux Benoit could you pleace provide
me with a working example of code so I can study from it?


Hereafter the message with code description that was given. I can't get
it working. In particular I cant get where PlotContainer and Window
where defined.

The original message from Boiteux Benoit:
*****************************************
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.

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

Re: including a child window (chaco plot) into a PyQt MDI application.

Peter Wang
On Fri, Jul 2, 2010 at 7:19 AM, aliko <[hidden email]> wrote:
> Some weeks ago a question was rised in this list about incuding chaco
> plot or traitsUI elements into existing PyQT application.
>
> And there was one suggestion from Mr Boiteux Benoit on how to include
> chaco plot as child window to PyQT application.
> Because of lack of understanding I was unable to reproduce the working
> example of code. I'm new to chaco and traits as well so working example
> is highly appreciated. Dear Mr Boiteux Benoit could you pleace provide
> me with a working example of code so I can study from it?

Please see:
https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/qt_example.py

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

Re: including a child window (chaco plot) into a PyQt MDI application.

Ali Tlisov
Peter Wang пишет:

> On Fri, Jul 2, 2010 at 7:19 AM, aliko <[hidden email]> wrote:
>> Some weeks ago a question was rised in this list about incuding chaco
>> plot or traitsUI elements into existing PyQT application.
>>
>> And there was one suggestion from Mr Boiteux Benoit on how to include
>> chaco plot as child window to PyQT application.
>> Because of lack of understanding I was unable to reproduce the working
>> example of code. I'm new to chaco and traits as well so working example
>> is highly appreciated. Dear Mr Boiteux Benoit could you pleace provide
>> me with a working example of code so I can study from it?
>
> Please see:
> https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/qt_example.py
>
> -Peter
Thank you very much, Peter! That what I was looking for!

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

Re: including a child window (chaco plot) into a PyQt MDI application.

Ali Tlisov
In reply to this post by Peter Wang
Peter Wang пишет:

> On Fri, Jul 2, 2010 at 7:19 AM, aliko <[hidden email]> wrote:
>> Some weeks ago a question was rised in this list about incuding chaco
>> plot or traitsUI elements into existing PyQT application.
>>
>> And there was one suggestion from Mr Boiteux Benoit on how to include
>> chaco plot as child window to PyQT application.
>> Because of lack of understanding I was unable to reproduce the working
>> example of code. I'm new to chaco and traits as well so working example
>> is highly appreciated. Dear Mr Boiteux Benoit could you pleace provide
>> me with a working example of code so I can study from it?
>
> Please see:
> https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/qt_example.py
>
> -Peter

Could you please tell mee is there a chance to embed traitsUI elements
as easily as chaco plots into existing PyQT application?

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