Bug: view.updated Event causes dialog to clear for PySide/PyQt4

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug: view.updated Event causes dialog to clear for PySide/PyQt4

Bergtholdt, Martin

Hi,

 

if I run this code in IPython (with proper event queue) I get a dialog update when running with WX backend, however with PySide (and PyQt4) the dialog clears completely after e.view.updated = True.

 

The example is minimal for demonstration. What I want to really achieve is quite a bit more complex, so please do not reply with "this can be achieved differently with ...". As another not if I add a menubar to the view, then the menubar is still active after e.view.updated even under PySide and I can actually change the menubar and that change is reflected.

 

from traits.etsconfig.api import ETSConfig

#ETSConfig.toolkit = 'qt4'

from traits.api import Str, HasTraits

from traitsui.api import View, Item

 

class Test(HasTraits):

    text1 = Str('text1')

    text2 = Str('text2')

 

    traits_view = View(

        Item('text1'),

        )

 

t = Test()

e = t.edit_traits()

 

# dialog is active in IPython

# change the view dynamically

e.view = View(

    Item('text1'),

    Item('text2'),

    )

 

# update/redraw the dialog

e.view.updated = True

e.updated = True

 

 

Martin Bergtholdt

Senior Scientist, Digital Imaging

Philips Technologie GmbH

Innovative Technologies

Research Laboratories
Röntgenstrasse 24-26; 22335 Hamburg/Germany
Tel: +49-40-5078-2139, Fax: +49-40-5078-2510


Geschäftsführung: Andreas Wente (Vorsitzender), Klaus Baumann, Dr. Thomas Piehler
Vorsitzender des Aufsichtsrates: Hans-Joachim Kamp
Sitz der Gesellschaft: Hamburg
Registergericht Hamburg, 66 HRB 35284,4419

 

Wordmark_email_footer

 



The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

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