I would like to restrict my application to portrait orientation. I was able to it in Qt 4.7.3 but was unable use the same code for Qt 4.6.3. Is there any way to setOreintation in Qt 4.6.3

有帮助吗?

解决方案

You can use Symbian specific code to meet your requirement. Add the following code in your Main.cpp file:

// Symbian specific code
    #ifdef Q_OS_SYMBIAN
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
    TRAPD(error, 
    if (appUi) {
        // Lock application orientation into Portrait
        appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
    }
    );
    #endif

Also the following LIBS in your pro file:

LIBS += -lcone -leikcore -lavkon

Refer this LINK for more details.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top