×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Location
    India
    Posts
    123

    Send Application to Background

    Hi,

    I want to develop an application in QT which can run in background as we can do in symbian.Is this possible in QT ?? if yes, can any one guide me on this.As I cannot find any information on this in Qt..

    Regards,

    Vishal.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Send Application to Background

    If you want to have application without UI, use QCoreApplication.

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Location
    India
    Posts
    123

    Re: Send Application to Background

    Quote Originally Posted by divanov View Post
    If you want to have application without UI, use QCoreApplication.
    Hi,
    divanov thanks for reply ,I found some info on this link below:


    http:///wiki.forum.nokia.com/index.p..._to_background

    And it worked , i have done following addition in my pro file:

    Code:
    symbian { 
    
         LIBS += -lws32\
                 -lcone
    
       }
    Regards,
    Vishal

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    23

    Re: Send Application to Background

    Hey vishal and divanov,

    Pls help me for my project . I am very new to QT . So pls send me the simple code to run background .
    iam having these bellow code from nokia forum .But i dont know how to put in QT together.

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

    LIBS += -lws32\
    -lcone

    }

    Thank advance,
    Deepak S

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Send Application to Background

    hello deepak6raji

    have you tried any thing of that, it will be great if you give some more details like what have you tried and what was the output??

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    44

    Question Re: Send Application to Background

    Anyone sovle this problem?
    I just get errors like "undefined reference to 'CCoeEnv::Static()'"?
    pls help.

  7. #7
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Send Application to Background

    Quote Originally Posted by hutigers View Post
    Anyone sovle this problem?
    I just get errors like "undefined reference to 'CCoeEnv::Static()'"?
    pls help.
    You need a linkage with "lws32" - add it to your .pro file.

  8. #8
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Send Application to Background

    If you want launch your Qt for Symbian app to the background, all you need is

    Code:
    symbian: RSS_RULES += "launch = KAppLaunchInBackground;"
    in your .pro file. Although, I'm not sure why you would want that; you click on the app icon, nothing seems to happen (as it's launched in background) so you click again, at which point the app comes to foreground.

    If you need to switch your application to background during run-time, just call lower() on your QMainWindow.

    If you need to have an application without GUI, use QCoreApplication as suggested by divanov.

  9. #9
    Registered User
    Join Date
    Nov 2008
    Posts
    44

    Re: Send Application to Background

    Quote Originally Posted by rahulvala View Post
    You need a linkage with "lws32" - add it to your .pro file.
    I have done this.
    PHP Code:
    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-10-14T08:10:21
    #
    #-------------------------------------------------

    QT       += core gui

    TARGET 
    hideWindow
    TEMPLATE 
    app


    SOURCES 
    += main.cpp\
            
    mainwindow.cpp

    HEADERS  
    += mainwindow.h

    FORMS    
    += mainwindow.ui

    CONFIG 
    += mobility


    MOBILITY 


    symbian {
        
    LIBS += -lws32\
                -
    lcone
        TARGET
    .UID3 0xe438051b
        
    # TARGET.CAPABILITY += 
        
    TARGET.EPOCSTACKSIZE 0x14000
        TARGET
    .EPOCHEAPSIZE 0x020000 0x800000

    but still got problem like.


    my main.cpp
    PHP Code:
    #include <QtGui/QApplication>
    #include "mainwindow.h"
    //#include "\NokiaQtSDK\Symbian\SDK\epoc32\include\COEMAIN.H"

    int main(int argcchar *argv[])
    {
        
    QApplication a(argcargv);
        
    MainWindow w;
        
    w.showMaximized();
        
    int rc 0;
        while (
    true)
        {
            
    rc a.exec();
            
    w.showMaximized();
            
    RWindowGroupwg = &CCoeEnv::Static()->RootWin();
             
    wg->SetOrdinalPosition(-1);
        }
    #if defined(Q_WS_S60)
        
    w.showMaximized();
    #else
        
    w.show();
    #endif

        
    return a.exec();


  10. #10
    Regular Contributor
    Join Date
    Jan 2011
    Posts
    100

    Re: Send Application to Background

    Hello everyone,
    I am also facing the same problem, i want to set app to background on auto start but want to set it to the foreground if started manually from the list. (My application has got UI.)
    I tried the same code and got same errors. I need help too on this.
    -Amruta

  11. #11
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Send Application to Background

    I think you need to add SwEvent capability in your mmp file.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  12. #12
    Registered User
    Join Date
    Jul 2007
    Posts
    279

    Re: Send Application to Background

    Hi,
    try this code enclosing symbian preprocessor
    Code:
         #ifdef Q_WS_S60
             RWindowGroup* wg = &CCoeEnv::Static()->RootWin();
             wg->SetOrdinalPosition(-1);
         #endif
    this may solve the errors

    Ram

Similar Threads

  1. Replies: 1
    Last Post: 2009-06-08, 15:42
  2. send key event to application running in background
    By chandra1234 in forum Symbian
    Replies: 2
    Last Post: 2008-10-07, 07:56
  3. How can I start an application and send it to the background immediately?
    By Hyungwoo Yang in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-03-30, 10:02
  4. What is application running in background?
    By newnb in forum Symbian
    Replies: 3
    Last Post: 2007-01-08, 03:03
  5. Replies: 4
    Last Post: 2005-09-01, 13:47

Posting Permissions

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