[Kde-games-devel] does this solve the multiple resizing bug foryou?
Wolfgang Rohdewald
wolfgang at rohdewald.de
Wed May 6 15:51:31 CEST 2009
On Mittwoch, 6. Mai 2009, Casper van Donderen wrote:
> I used to do this using QApplication:desktop().width() (on a Qt app)
that is the desktop size but the maximum window is desktop minus plasma panel.
If I have a maximized window and move the panel from screen bottom to screen
right, the window changes size
but I had a closer look at QApplication.desktop() so now I have a new proposal
without any timers based on all your ideas. Seems to work so far, and hopefully
on all platforms:
(the additional resize happens if we are maximized in any direction, just vertical
or just horizontal is sufficient)
- in the KXMLGuiWindow constructor, set self.ignoreResizing to 1 (default)
- in KXMLGuiWindow.resizeEvent() (which is called before qgraphicsview.resize) do:
if self.ignoreResizing == 1: # at startup
desktop = KApplication.kApplication().desktop()
if desktop.frameGeometry().width() <= self.frameGeometry().width() \
or desktop.frameGeometry().height() <= self.frameGeometry().height():
self.ignoreResizing += 1
- in QGraphicsView.resizeEvent(), decrement ignoreResizing if > 0 and resize only if we get 0
(I have only one QGraphicsView, otherwise this would of course be more complicated)
--
Wolfgang
More information about the kde-games-devel
mailing list