[PyQt] still problem with mdi and signal stucked :(

Hans-Peter Jansen hpj at urpla.net
Sat Oct 10 21:54:01 BST 2009


Am Samstag 10 Oktober 2009 schrieb Giorgio Luciano:
> Already tried :( with no luck,
> it gives me attribute error. since I wanted to keep the things simple I
> tried to remake the pyQT mdi example using the Qmdi.Area since the only
> difference was there (the pyQt example is old and use deprecated
> QWorkspace) and also I simplified things using q QtextEditor instead of a
> table. In just few words I cannot link the toolbar actions to the MDI
> subwindows.. There a small editor example.
> The windows arrangement work.. the method like copy and paste not :(

Giorgio, apart from the obvious problem, that Main.findMdiChild() is missing 
in your example :-|, and apart, that you didn't even tried to word your 
issue seriously, you simply should have given the error message a bit more 
attention:

Traceback (most recent call last):
  File "editor.py", line 102, in copy
    self.activeMdiChild().copy()
AttributeError: 'QMdiSubWindow' object has no attribute 'copy'

You see, the method self.activeMdiChild() returns a QMdiSubWindow instance 
[looking up QMdiSubWindow in assistant], that has a widget() method:

    def copy(self):
        self.activeMdiChild().widget().copy()

    def paste(self):
        self.activeMdiChild().widget().paste()

eh voila, tutto functionari. (Excuse my pidgin italian..)

> I'm getting crazy with this stupid thing while I've already coded the
> multivariate methods :( oh well...

You did NOT do your homework well - you're given a detention for this.

Pete


More information about the PyQt mailing list