RE: Qt Autorotation

2010-06-03 Thread Kimmo Hämäläinen
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:v...@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.
 
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-06-03 Thread Stefanos Harhalakis
Hello,

On Thursday 03 of June 2010, Kimmo Hämäläinen wrote:
 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.

I believe you misunderstood the problem:

The original problem was that new windows would not respect the current state. 
If you create a new dialog and set it to auto-rotate, the new dialog will show 
up in landscape mode even if the display was in portrait mode. It is a common 
problem that affects pop-up dialogs.

It can be bypassed by setting a parent window and Felipe explained why.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-06-03 Thread Kimmo Hämäläinen
On Thu, 2010-06-03 at 14:47 +0200, ext Stefanos Harhalakis wrote:
 Hello,
 
 On Thursday 03 of June 2010, Kimmo Hämäläinen wrote:
  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.
 
 I believe you misunderstood the problem:
 
 The original problem was that new windows would not respect the current 
 state. 
 If you create a new dialog and set it to auto-rotate, the new dialog will 
 show 

Do you set the rotation property before showing the dialog or after?  If
you set it before showing it, it sounds like hildon-desktop bug then...

 up in landscape mode even if the display was in portrait mode. It is a common 
 problem that affects pop-up dialogs.
 
 It can be bypassed by setting a parent window and Felipe explained why.

There should not be a difference. If there is, it's a bug...

-Kimmo


___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-06-02 Thread Stefanos Harhalakis
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@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


RE: Qt Autorotation

2010-06-02 Thread Felipe Crochik
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:v...@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.

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-06-02 Thread Robin Burchell
On Thu, May 27, 2010 at 1:26 PM, Felipe Crochik fel...@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: m...@viroteck.net
irc: w00t @ irc.freenode.net
twr: http://twitter.com/w00teh
lac: http://identi.ca/w00t
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-05-27 Thread Luca Donaggio
On Wed, May 26, 2010 at 6:27 PM, Felipe Crochik fel...@crochik.com wrote:

 I combined the reply to all post:

 My application seems to start autorotating after I click on the
 application title to show the menu for the first time. I don't have to
 select anything and I don't do anything different on my code about the
 implementation of the menu.

 Very odd... I will have to try some different things to see if I can
 isolate
 the problem further.

 @Daniil: The test project works fine on my n900
 @Luca: I don't think you need to set on all windows, just the top most
 seems
 to be enough.
 @Attila: I did not know that.

 Thank you
 Felipe

 -Original Message-
 From: Daniil Ivanov [mailto:daniil.iva...@gmail.com]
 Sent: Wednesday, May 26, 2010 11:53 AM
 To: Felipe Crochik
 Cc: maemo-developers@maemo.org
 Subject: Re: Qt Autorotation

 Hi Felipe!

 Two things. Autorotation was around since N900 sales release.
 And this test app works for me fine in PR 1.2 without pressing anything.

 #include QApplication
 #include QMainWindow

 int
 main (int argc,
  char **argv)
 {
QApplication app(argc, argv);
QMainWindow win;
win.setAttribute(Qt::WA_Maemo5AutoOrientation, true);
win.show();

return app.exec();
 }

 ~Daniil.

 On Wed, May 26, 2010 at 6:21 PM, Felipe Crochik fel...@crochik.com
 wrote:
  Now that PR1.2 is out autorotation works!!! Great but.
  Has anybody figured out how to control the autorotation on the
 application
  (without the Ctrl+shift+r)?
 
  The WA_Maemo5AutoOrientation only tells the device that you want this
  application to autorotate but the user still needs to press the
 shortcut
  (I have the worst time with my fat fingers) to activate/deactivate it.
 And
  worst of all you need to do the same every time you start the
 application.
  At least I would like to allow the user to save as a setting for later...
 
  Thanks,
  Felipe
 
  ___
  maemo-developers mailing list
  maemo-developers@maemo.org
  https://lists.maemo.org/mailman/listinfo/maemo-developers
 


Felipe, you're absolutely right: once set the autorotation flag in the
topmost window of the stack, the others seem  to retain it.
Only issue remaining is that once you open a new stacked window, it starts
in landscape mode, disregarding current device orientation, *but* its child
widgets are layed out respecting the correct screen proportions.
I can check for screen geometry and set the landscape or portrait flag
accordingly, but I'm wondering if this will disable the accelerometers from
then on (ie: overriding the autorotation flag set before).
Any clue on this?

-- 
Luca Donaggio
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-05-27 Thread Felipe Crochik
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 attribute will disable the 
autorotation for the new window (does not affect the original one though).
I tried to set the portrait attribute and then the autorotation on the new 
window but then the window will start again on landscape mode. 
One workaround I did not try was to set the portrait attribute and a timer for 
a little after the window is showing to set the autorotation attribute.
It seems that the autorotation dispatcher only check the window attributes 
after the window is showing and/or on a predefined schedule (maybe it is a 
bug). 
My application (macuco2 on the dev repository if you want to try) seems to take 
some time after starting to start receiveing the signals... Sometimes only 
starts after you show the menu for the first time.
Felipe 

 Felipe, you're absolutely right: once set the autorotation flag in the
 topmost window of the stack, the others seem   to retain it.
 Only issue remaining is that once you open a new stacked window, it
 starts in landscape mode, disregarding current device orientation, *but*
 its child widgets are layed out respecting the correct screen
 proportions. I can check for screen geometry and set the landscape or
 portrait flag accordingly, but I'm wondering if this will disable the
 accelerometers from then on (ie: overriding the autorotation flag set
 before). Any clue on this?
 
 -- 
 Luca Donaggio

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Qt Autorotation

2010-05-26 Thread Felipe Crochik
Now that PR1.2 is out autorotation works!!! Great but. 
Has anybody figured out how to control the autorotation on the application
(without the Ctrl+shift+r)? 

The WA_Maemo5AutoOrientation only tells the device that you want this
application to autorotate but the user still needs to press the shortcut
(I have the worst time with my fat fingers) to activate/deactivate it. And
worst of all you need to do the same every time you start the application.
At least I would like to allow the user to save as a setting for later... 

Thanks,
Felipe

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-05-26 Thread Luca Donaggio
On Wed, May 26, 2010 at 5:21 PM, Felipe Crochik fel...@crochik.com wrote:

 Now that PR1.2 is out autorotation works!!! Great but.
 Has anybody figured out how to control the autorotation on the application
 (without the Ctrl+shift+r)?

 The WA_Maemo5AutoOrientation only tells the device that you want this
 application to autorotate but the user still needs to press the shortcut
 (I have the worst time with my fat fingers) to activate/deactivate it. And
 worst of all you need to do the same every time you start the application.
 At least I would like to allow the user to save as a setting for later...

 Thanks,
 Felipe

 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers


I'm not sure I'm following you... I just tried with an app I'm working on
(based on python + PySide) and the only thing needed to enable autoratation
is setting the WA_Maemo5AutoOrientation flag for *every* window.
The only issue I'm having is that if you open a new stacked window while in
portrait, it nevertheless starts in landscape, but turning the device around
a bit triggers auto rotation again.

-- 
Luca Donaggio
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-05-26 Thread Daniil Ivanov
Hi Felipe!

Two things. Autorotation was around since N900 sales release.
And this test app works for me fine in PR 1.2 without pressing anything.

#include QApplication
#include QMainWindow

int
main (int argc,
  char **argv)
{
QApplication app(argc, argv);
QMainWindow win;
win.setAttribute(Qt::WA_Maemo5AutoOrientation, true);
win.show();

return app.exec();
}

~Daniil.

On Wed, May 26, 2010 at 6:21 PM, Felipe Crochik fel...@crochik.com wrote:
 Now that PR1.2 is out autorotation works!!! Great but.
 Has anybody figured out how to control the autorotation on the application
 (without the Ctrl+shift+r)?

 The WA_Maemo5AutoOrientation only tells the device that you want this
 application to autorotate but the user still needs to press the shortcut
 (I have the worst time with my fat fingers) to activate/deactivate it. And
 worst of all you need to do the same every time you start the application.
 At least I would like to allow the user to save as a setting for later...

 Thanks,
 Felipe

 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Qt Autorotation

2010-05-26 Thread Attila Csipa
On Wednesday 26 May 2010 17:21:42 Felipe Crochik wrote:
 The WA_Maemo5AutoOrientation only tells the device that you want this
 application to autorotate but the user still needs to press the shortcut
 (I have the worst time with my fat fingers) to activate/deactivate it. And

IIUC the two are unrelated. CTRL-SHIFT-R is forced autorotation provided by 
the system, WA_Maemo5AutoOrientation is a Qt option enabling the application 
to deal with it itself. There might be some 'remembering' involved though as 
some applications seem to remember it (like mail and conversations - might be 
caused by the fact that they never really quit, though).

Regards,
Attila
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


RE: Qt Autorotation

2010-05-26 Thread Felipe Crochik
I combined the reply to all post:

My application seems to start autorotating after I click on the
application title to show the menu for the first time. I don't have to
select anything and I don't do anything different on my code about the
implementation of the menu. 

Very odd... I will have to try some different things to see if I can isolate
the problem further. 

@Daniil: The test project works fine on my n900
@Luca: I don't think you need to set on all windows, just the top most seems
to be enough.
@Attila: I did not know that.

Thank you
Felipe

-Original Message-
From: Daniil Ivanov [mailto:daniil.iva...@gmail.com] 
Sent: Wednesday, May 26, 2010 11:53 AM
To: Felipe Crochik
Cc: maemo-developers@maemo.org
Subject: Re: Qt Autorotation

Hi Felipe!

Two things. Autorotation was around since N900 sales release.
And this test app works for me fine in PR 1.2 without pressing anything.

#include QApplication
#include QMainWindow

int
main (int argc,
  char **argv)
{
QApplication app(argc, argv);
QMainWindow win;
win.setAttribute(Qt::WA_Maemo5AutoOrientation, true);
win.show();

return app.exec();
}

~Daniil.

On Wed, May 26, 2010 at 6:21 PM, Felipe Crochik fel...@crochik.com wrote:
 Now that PR1.2 is out autorotation works!!! Great but.
 Has anybody figured out how to control the autorotation on the application
 (without the Ctrl+shift+r)?

 The WA_Maemo5AutoOrientation only tells the device that you want this
 application to autorotate but the user still needs to press the shortcut
 (I have the worst time with my fat fingers) to activate/deactivate it. And
 worst of all you need to do the same every time you start the application.
 At least I would like to allow the user to save as a setting for later...

 Thanks,
 Felipe

 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers


___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers