Force application to landscape mode / full screen display
Hello Folks,
it's me again - I have decided to undertake the impossible: creating a realtime game in Qt for S60.
In order to do this, I would need two things:
a) How can I force the device into landscape mode. It doesn't have to be the system - if I can get the QPainter to swap the x and y axis, its ok too.
b) How can I get my QMainWindow to not display the applicaton title and exit button?
Re: Force application to landscape mode / full screen display
[CODE]int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// lock orientation
CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
if(appUi){
QT_TRAP_THROWING(appUi ->SetOrientationL( CAknAppUi::EAppUiOrientationLandscape));
}
ScreenDemo w(&a);
// force full-screen mode
w.showFullScreen();
return a.exec();
}
[/CODE]
Re: Force application to landscape mode / full screen display
Hi,
thank you so much!
However, when editing the mmp file to add the required libraries, I get Carbide whining about how I am editing a "derived file".
WHat is going on here?
Re: Force application to landscape mode / full screen display
[QUOTE=tamhanna;691945]whining about how I am editing a "derived file".[/QUOTE]
In Qt for Symbian, .mmp is generated automatically by qmake, based on your .pro file. You typically should not edit .mmp directly - add your libraries into .pro file instead, see [URL="http://wiki.forum.nokia.com/index.php/CS001517_-_Lock_application_orientation_in_Qt_for_Symbian"]here[/URL].
Re: Force application to landscape mode / full screen display
Re: Force application to landscape mode / full screen display
Re: Force application to landscape mode / full screen display
Hi,
partially.
The landscape mode switch works - but the stupid action button and the title bar still are displayed!
Re: Force application to landscape mode / full screen display
I forgot to add something: the MainWindow is shown as set up in the .ui file.
Re: Force application to landscape mode / full screen display
Use showFullscreen instead of showMaximized in your main.cpp
Re: Force application to landscape mode / full screen display
Already found it, thx!
To add: the main.cpp does NOT seem to get edited. So there is no risk of a fight between Carbide and you.
Re: Force application to landscape mode / full screen display
I'm trying almost the same thing but ib Carbide,C++.
I want my app to launch and stay in landscape mode till the user exits the app.
Any idea guys....i'm clueless...
thnks in advance...
Re: Force application to landscape mode / full screen display
See the code below, from "markboost". It's all you need. (Well, not quite. also #include <AknAppUi.h> and add libs avkon, cone, and eiksrv to your PRO file.)