[PyQt] FW: cascadeSubWindows oversized--Conclusion

2011-05-24 Thread Pietro Moras

There is a Conclusion to this enquiry. 

C1) With PyQt (4), support from collaborative colleagues is particularly 
valuable. So that to find out the “right” place where to share experiences and 
tech.info is particularly relevant. 
C2) The other side of this same coin is that you cannot entirely rely only upon 
the available PyQt (4) documentation. 

Therefore my Operative conclusion is: 
O1) To rely upon the “RiverbankComputing.com PyQt Mailing List”, as in this 
actual “cascade” case. 
O2) To share in that List my possibly useful s/w fragments as a reward and to 
the benefit of other fellow colleagues. 

-- I'd appreciate your thoughts, especially if in some disagreement with my 
Conclusions. 
See you.
- P.M.
  ___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] FW: cascadeSubWindows oversized--Conclusion

2011-05-24 Thread David Boddie
On Tuesday 24 May 2011, Pietro Moras wrote:

 Therefore my Operative conclusion is:
 O1) To rely upon the “RiverbankComputing.com PyQt Mailing List”, as in this
 actual “cascade” case.
 O2) To share in that List my possibly useful s/w fragments as a reward and
 to the benefit of other fellow colleagues.

You can also look at the PyQt and PyKDE Wiki for code samples:

  http://www.diotavelli.net/PyQtWiki/

Really, I should have added the example I wrote to the SampleCode page on
that Wiki, but I didn't really consider it to be complete enough for that.

  http://www.diotavelli.net/PyQtWiki/SampleCode

David
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] FW: cascadeSubWindows oversized

2011-05-23 Thread Pietro Moras

 
No David, 
   It wouldn't do, in the sense that: 
-- “.tileSubWindows” method works fine, whereas 
-- “.cascadeSubWindows” doesn't, on exactly the very same situation. 
And that is the problem. 
- P.M.
 
 
Date: Mon, 23 May 2011 01:50:00 +0200 
From: David Boddie da...@boddie.org.uk 
To: pyqt@riverbankcomputing.com 
Subject: Re: [PyQt] FW: cascadeSubWindows oversized 
Message-ID: 201105230150.00845.da...@boddie.org.uk 

Would tileSubWindows() do what you want?

David

 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
Subject: FW: cascadeSubWindows oversized
Date: Sat, 21 May 2011 11:41:43 +




Let me ask this same question this other way: 
   Is there a method to reset the size of all MDI SubWindows so that to fit 
them at once exactly on the space available on the host MDI window? Thanks!

- P.M.
 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
Subject: cascadeSubWindows oversized
Date: Thu, 19 May 2011 18:16:01 +



Dear Sir,
   In debugging an existing application based on PyQt4 (4.8.3), while 
“.tileSubWindows” method works ok, with all sub-windows correctly dimensioned 
to fit into the host window, the “.cascadeSubWindows” generates child windows 
by far too large for the available room.



(?) Any idea what / where to look, so to fix this odd behaviour? 


Plus, I must confess that documentation I've got so far: 
-- PyQt 4.8.3 Reference Guide and Class Reference
-- M. Summerfield “Rapid GUI Programming with Python and Qt”
resulted of very little help, so far. My fault, probably...
Thanks.
- P.M.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] FW: cascadeSubWindows oversized

2011-05-23 Thread David Boddie
On Mon May 23 14:26:27 BST 2011, Pietro Moras wrote:

It wouldn't do, in the sense that: 
 -- “.tileSubWindows” method works fine, whereas 
 -- “.cascadeSubWindows” doesn't, on exactly the very same situation. 
 And that is the problem.

OK, so you really need a way to cascade all the windows across the MDI area,
but it resizes them so that they are too big?

Can you describe more accurately what you want to see?

David
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] FW: cascadeSubWindows oversized

2011-05-23 Thread Pietro Moras


 Can you describe more accurately what you want to see?
 David
 
Simply that all “cascaded” child windows be within the Upper Left – Lower Right 
corners of the host MDI Window, with no scroll bar on. 
- P.M.

 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
CC: da...@boddie.org.uk
Subject: FW: cascadeSubWindows oversized
Date: Mon, 23 May 2011 13:26:27 +






No David, 
   It wouldn't do, in the sense that: 
-- “.tileSubWindows” method works fine, whereas 
-- “.cascadeSubWindows” doesn't, on exactly the very same situation. 
And that is the problem. 
- P.M. 
 
Date: Mon, 23 May 2011 01:50:00 +0200 
From: David Boddie da...@boddie.org.uk 
To: pyqt@riverbankcomputing.com 
Subject: Re: [PyQt] FW: cascadeSubWindows oversized 
Message-ID: 201105230150.00845.da...@boddie.org.uk 

Would tileSubWindows() do what you want?

David

 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
Subject: FW: cascadeSubWindows oversized
Date: Sat, 21 May 2011 11:41:43 +



Let me ask this same question this other way: 
   Is there a method to reset the size of all MDI SubWindows so that to fit 
them at once exactly on the space available on the host MDI window? Thanks!

- P.M.
 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
Subject: cascadeSubWindows oversized
Date: Thu, 19 May 2011 18:16:01 +



Dear Sir,
   In debugging an existing application based on PyQt4 (4.8.3), while 
“.tileSubWindows” method works ok, with all sub-windows correctly dimensioned 
to fit into the host window, the “.cascadeSubWindows” generates child windows 
by far too large for the available room.



(?) Any idea what / where to look, so to fix this odd behaviour? 


Plus, I must confess that documentation I've got so far: 
-- PyQt 4.8.3 Reference Guide and Class Reference
-- M. Summerfield “Rapid GUI Programming with Python and Qt”
resulted of very little help, so far. My fault, probably...
Thanks.
- P.M.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] FW: cascadeSubWindows oversized

2011-05-23 Thread David Boddie
On Monday 23 May 2011, Pietro Moras wrote:
  Can you describe more accurately what you want to see?
  David

 Simply that all “cascaded” child windows be within the Upper Left – Lower
 Right corners of the host MDI Window, with no scroll bar on. - P.M.

I think you will need to write a function to do this, using the QMdiArea's
subWindowList() method to get the subwindows.

There are lots of constraints you could apply to the way windows are
positioned and resized. This cascade() method might do something similar to
what you want, but it's difficult to get the details right without more
information:

class MdiArea(QMdiArea):

def cascade(self):

if len(self.subWindowList())  2:
return

windows = []
for window in self.subWindowList():
windows.append((window.width(), window.height(), window))

windows.sort()

x = 0
y = 0
endX = self.width() - min(windows[-1][0], self.width())
endY = self.height() - min(windows[-1][1], self.height())

for i in range(len(windows)):

x = i * endX/(len(windows) - 1)
y = i * endY/(len(windows) - 1)

width, height, window = windows[i]
window.move(x, y)
window.resize(min(width, self.width() - x),
  min(height, self.height() - y))
window.raise_()

David
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] FW: cascadeSubWindows oversized

2011-05-22 Thread David Boddie
On Sat, 21 May 2011 11:41:43 +, Pietro Moras wrote:

 Let me ask this same question this other way:
    Is there a method to reset the size of all MDI SubWindows so that to fit
 them at once exactly on the space available on the host MDI window? Thanks!

Would tileSubWindows() do what you want?

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qmdiarea.html#tileSubWindows

David
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] FW: cascadeSubWindows oversized

2011-05-21 Thread Pietro Moras

Let me ask this same question this other way: 
   Is there a method to reset the size of all MDI SubWindows so that to fit 
them at once exactly on the space available on the host MDI window? Thanks!
- P.M.

 


From: studio...@hotmail.com
To: pyqt@riverbankcomputing.com
Subject: cascadeSubWindows oversized
Date: Thu, 19 May 2011 18:16:01 +




Dear Sir,
   In debugging an existing application based on PyQt4 (4.8.3), while 
“.tileSubWindows” method works ok, with all sub-windows correctly dimensioned 
to fit into the host window, the “.cascadeSubWindows” generates child windows 
by far too large for the available room.



(?) Any idea what / where to look, so to fix this odd behaviour? 


Plus, I must confess that documentation I've got so far: 
-- PyQt 4.8.3 Reference Guide and Class Reference
-- M. Summerfield “Rapid GUI Programming with Python and Qt”
resulted of very little help, so far. My fault, probably...
Thanks.
- P.M.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt