[maemo-developers] Qt Autorotation

From: Kimmo Hämäläinen kimmo.hamalainen at nokia.com
Date: Thu Jun 3 14:54:10 EEST 2010
On Thu, 2010-06-03 at 00:39 +0200, ext Felipe Crochik wrote:
> Hi, 
> 
> It seems to me that this is an "unintended positive side effect" instead of
> a planned requirement. I pass the mainwindow pointer to my dialog
> constructors and this should set the parent.
> 
> By reading the documentation setParent should be quite useless in this
> scenario because I would be changing the parent to the exact same one
> assigned previously. I believe it just happens to work because setParent
> will hide the just created dialog and then when you call exec or show it
> will probably trigger the "window manager" recognizing this window as part
> of an autorotation application and adjusting it accordingly.

Yes, the WM makes sure that transient dialogs "inherit" portrait
properties from the parent (meaning the window they are transient for).
Of course, you could also put the window properties to the dialog window
itself to have the same effect with a system-modal (non-transient)
dialog.

-Kimmo

> 
> Regardless, it was a good catch. It will probably help saving a bunch of
> useless lines of code trying to remedy this issue and hopefully on a new
> release it will be fixed so we don't need to artificially "reset" the parent
> to make the manager adjust the window.
> 
> I would say that it is probably worth reporting this as a bug on the
> qt/nokia web site. Have you reported it?
> 
> Thanks for updating us on your findings
> Felipe
> 
> -----Original Message-----
> From: Stefanos Harhalakis [mailto:v13 at v13.gr] 
> Sent: Wednesday, June 02, 2010 6:08 PM
> To: Felipe Crochik
> Cc: maemo-developers at maemo.org; Luca Donaggio
> Subject: Re: Qt Autorotation
> 
> Hello,
> 
> On Thursday 27 of May 2010, Felipe Crochik wrote:
> > Luca,
> > I ran into the same issue - the new windows always start on landscape -
> and
> > used the same workaround - checked the screen resolution and when taller
> > set the portrait attribute. And yes, I believe you are right, setting the
> 
> I had the same problem but it proved to be my fault. If you are using
> QDialogs 
> like me then you only have to be sure that you're setting the main window
> (the 
> one with the portrait mode support) as the parent window. This will give
> nice 
> portrait support and QDialogs will start in the proper condition.
> 
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

More information about the maemo-developers mailing list