Hi,
i'm working on an application, which only supports the portrait mode.
all works fine, when i start it out of the portrait mode.
but when the system is in the landscape mode, and i start the app then the bottom part of the full screen window has a withe background color instead of black.
Started out of portrait mode:
everything is fine.
But started out of landscape mode:
I had to use a photo camera to make a screenshot because ScreenSnap doesn't show this effect in the screenshots...
now i did a workaround by redefining the applications QPalette
Code:MainWindow::MainWindow() { ... #ifdef Q_OS_SYMBIAN // Workaround to Bug#02: // overrides the system color sheme!!! (TODO: find another solution) QPalette pal; pal.setColor(QPalette::Window, Qt::black); pal.setColor(QPalette::WindowText, Qt::white); QApplication::setPalette(pal); showFullScreen(); ... #else
the main function has this code to lock to portrait mode:
my workaround is fine, but it overrides the systems default color sheme. and that's not a nice way!Code:#include <QApplication> #include "mainwindow.h" // found this code for screen-orientation on: // http://thpmaemo.blogspot.com/2010/10/qt-write-once-ifdef-everywhere.html // added this code on 26th of Oct. 2010 #ifdef Q_OS_SYMBIAN #include <AknAppUi.h> #endif int main(int argc, char *argv[]) { QApplication app(argc, argv); #ifdef Q_OS_SYMBIAN CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi()); TRAPD(error, if (appUi) { appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); } ); #endif MainWindow window; //window.show(); return app.exec(); }
has anybody had this bug or a better idea for a workaround?
kind regards,
Karl Zeilhofer







