×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    8

    Question How to hide QT app?

    Environment: QT for S60, QT dialog app.
    I want my Qt app hide and show as needed. When I try to hide it by calling MyDialog.hide(), it has 2 problems:
    1, It is available in the task list popup window. In the task list window, my app is shown, and the main window is the homescreen, but the task title is my app's title. Looks strange.
    2, After I call MyDialog.hide(), the softkey still keeps not changed. When I press softkey ‘Exit’, the app will exit. Seems it still ‘visible’. The main window is hidden, but softkey menu is visible.

    Then I try CApaWindowGroupName::SetHidden() as below. It does not work as expected. It still has above 2 problems.
    CCoeEnv *env = CCoeEnv::Static();
    TInt wgId = env->RootWin().Identifier();
    RWsSession session = env->WsSession();
    CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(session, wgId);
    wgName->SetHidden(EFalse);
    wgName->SetWindowGroupName(env->RootWin());
    CleanupStack::PopAndDestroy(); // wgName
    Can anybody please help me to hide it completely? Thanks very much for any reply.
    Last edited by wizardlee; 2010-08-04 at 05:14.

  2. #2
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: How to hide QT app?

    Hi,

    If there is no Qt API available then you can try the native API:

    1. Hide your application (send the application to the background)

    CCoeEnv::Static()->RootWin().SetOrdinalPosition(-1) or TApaTask::SendToBackground()

    2. Remove your application from the task list

    CAknAppUi::HideApplicationFromFSW()

    Google the APIs for more info.

    Regards

    Ziteng Chen

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    8

    Re: How to hide QT app?

    Thanks. But how can I find the CAknAppUi object for a QT app?

  4. #4
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: How to hide QT app?

    Quote Originally Posted by wizardlee View Post
    Thanks. But how can I find the CAknAppUi object for a QT app?
    Hi,

    how to:

    CAknAppUi* appui = static_cast<CAknAppUi*>(CCoeEnv::Static()->AppUi());

    Regards

    Ziteng Chen

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    8

    Re: How to hide QT app?

    Thanks very much. It works, with a minor problem:
    when it is hidden, it's hidden too deeply, since it's hidden even in process list (ps), and the circle (which normally indicate application running) near app icon is hidden too. Is it possible to show the circle?

  6. #6
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: How to hide QT app?

    Hi,

    I've no better solutions, the HideApplicationFromFSW() can hide the app from the Task manager (also called Fast Swap Window, it is the task list launched by long pressing the menu key), and at the same time it can hide the running indicator (circle on the app icon in Main menu).

    The app should still be in the processes list (if you mean the processes found by the native API TFindProcess) because it is still running.

    Regards

    Ziteng Chen

  7. #7
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: How to hide QT app?

    Hi,

    Concerning this issue, I am able to hide the circle (which normally indicate application running) and to hide the application icon in the "opened applications" by setting HideApplicationFromFSW to true.
    But the problem I'm facing is how to know when the user reenter the application by pressing on the application icon in the menu list, in order to change the Boolean of "HideApplicationFromFSW" to false.

    Thanks in advance.
    lipos123

  8. #8
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: How to hide QT app?

    Hi lipos123

    When user re-enter/re-launches the application by pressing the application icon from the app menu list, the application is brought to foreground,
    i think you can use the HandleForegroundEventL to check if your app is foreground and set the bool HideApplicationFromFSW..

    void <AppMyClass>::HandleForegroundEventL(TBool aForeground)
    {
    CEikAppUi::HandleForegroundEventL( aForeground );

    if( aForeground )
    {
    .. set the HideApplicationFromFSW to false
    }
    else
    {
    .. set the HideApplicationFromFSW to true
    }
    }

  9. #9
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: How to hide QT app?

    Quote Originally Posted by kusumk View Post
    Hi lipos123

    When user re-enter/re-launches the application by pressing the application icon from the app menu list, the application is brought to foreground,
    i think you can use the HandleForegroundEventL to check if your app is foreground and set the bool HideApplicationFromFSW..

    void <AppMyClass>::HandleForegroundEventL(TBool aForeground)
    {
    CEikAppUi::HandleForegroundEventL( aForeground );

    if( aForeground )
    {
    .. set the HideApplicationFromFSW to false
    }
    else
    {
    .. set the HideApplicationFromFSW to true
    }
    }
    how can i implement this symbian code in my qt c++ application,
    I am trying to call void MainWindow::HandleForegroundEventL... but no such function exists.
    Any help...

  10. #10
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: How to hide QT app?


  11. #11
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: How to hide QT app?

    Quote Originally Posted by vineet.jain View Post
    didn't work well,
    i have reimplemented the eventFilter function in my code, but i am not able to know when the application is hidden. what should I compare in the eventfilter ? i have compared if the event->type() ==is equal to QEvent::ActivationChange and QEvent::ApplicationActivate, but when pressing any button in the application it triggers.

    Any idea ?

  12. #12
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: How to hide QT app?

    I think only QEvent::ApplicationActivate would work: http://www.developer.nokia.com/Commu...d_when_resumed

Similar Threads

  1. Can I publish QT app to Ovi store and get paid (Nokia QT SDK non commercial license)
    By stepic in forum [Closed] Publishing to Nokia Store
    Replies: 5
    Last Post: 2010-06-27, 04:55
  2. Replies: 11
    Last Post: 2010-01-26, 19:00
  3. Hide App Installer
    By anoopd in forum Symbian
    Replies: 4
    Last Post: 2009-07-14, 11:17
  4. Hide an app to user
    By Lord Ryj in forum Symbian
    Replies: 1
    Last Post: 2009-05-16, 04:48
  5. How to hide my app
    By liafail in forum Symbian
    Replies: 3
    Last Post: 2005-12-23, 02:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •