Namespaces
Variants
Actions
Revision as of 04:17, 11 October 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to send a Qt app to the background on Symbian

Jump to: navigation, search

This code snippet demonstrates how to hide a Qt application in the background on Symbian, instead of allowing it to exit.

Article Metadata

Article
Created: User:Wwwcitizen (10 Feb 2010)
Last edited: hamishwillee (11 Oct 2012)

Code

The way it works is that when the application is exited the exec() completes, and the app window is forced into the background and then re-executed. Symbian C++ code is used to force the app into the background.

Source file:

    MainWindow mainWindow();
mainWindow.showMaximized();
int rc = 0;
while (true)
{
rc = a.exec();
mainWindow.showMaximized();
RWindowGroup* wg = &CCoeEnv::Static()->RootWin();
wg->SetOrdinalPosition(-1);
}

You need following linkage in your .pro file

symbian { 
LIBS += -lws32\
-lcone
}
145 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved