I follow the Qt/S60 Mailing list, that is turning out to be a very interesting and active ML, and the Qt Labs blog, always full of very good code, written directly by the guys of Qt Software. I thought could be nice to start to post some of the stuff I’m learning.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <eikenv.h>
#include <eikappui.h>
#include <aknenv.h>
#include <aknappui.h>
// ...
// lock orientation
CAknAppUi* appUi = static_cast<caknappui *>( CEikonEnv::Static()->AppUi() );
if ( appUi ) //< Actually, this will always pass. It's a "static_cast" after all...
{
   appUi->SetOrientationL( CAknAppUi::EAppUiOrientationPortrait );
}
// ...




Today's source is: [Nokia Forum](http://discussion.forum.nokia.com/forum/showthread.php?t=164499).</caknappui></aknappui></aknenv></eikappui></eikenv>