Qt Autorotation

RE: Qt Autorotation

Felipe Crochik

2010-06-02 22:39 UTC
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.

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@v13.gr]
Sent: Wednesday, June 02, 2010 6:08 PM
To: Felipe Crochik
Cc: maemo-developers@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.

  •  Reply

Re: Qt Autorotation

Robin Burchell
Karma: 996
2010-06-02 22:42 UTC
On Thu, May 27, 2010 at 1:26 PM, Felipe Crochik <felipe@crochik.com> 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.

This was filed as a bug earlier today:

http://bugreports.qt.nokia.com/browse/QTBUG-11190

Interested readers may wish to subscribe for updates.

Best,

Robin Burchell
mob: +447702671419
msn: msn@viroteck.net
irc: w00t @ irc.freenode.net
twr: http://twitter.com/w00teh
lac: http://identi.ca/w00t
  •  Reply

RE: Qt Autorotation

2010-06-03 11:54 UTC
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@v13.gr]
> Sent: Wednesday, June 02, 2010 6:08 PM
> To: Felipe Crochik
> Cc: maemo-developers@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.
>

  •  Reply

Re: Qt Autorotation

ahcene Boubekki
Karma: 29
2010-06-15 00:59 UTC
I think I found something new..

How do you launch your app? with a terminal?
well if its the case allow your terminal to rotate with a Ctrl+Maj+R
and then launch your app..and it should work..
  •  Reply