Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Hello All,

    I am a new Maemo developer.
    I won't to send my application to background.

    I tried to hide the Main Window using "QWidget::hide ()", and it success to hide the application but i failed to show it again.

    I also tried to minimize the Main Window using "QWidget::setWindowState ( Qt::WindowMinimized )" but it not worked as i won't, it make the application in bottom of other applications.

    I won't any method to send the application to background or hide it and show it again.

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    QWidhet::hide() is a proper way to do what you likely want.

  3. #3
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Quote Originally Posted by divanov View Post
    QWidhet::hide() is a proper way to do what you likely want.
    Thanks Daniil,

    I use it, and it hide the application, but when the user open the application again another instance from the application was opened and the old one still running.

    There are two ways to deal with that problem like close the old one using QProcess::start("kill -KILL <old_pid>")), or put a value in a database to inform the old one to show it self, but i have to make a timer for every second to check that value.

    I am using the first way, but i am asking if there is a direct way to send application to background in Qt or DBus.

  4. #4
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Could you explain, what do you mean by sending application to background?

    Apart from that you can use, for example, dbus_bus_request_name and dbus_bus_name_has_owner to limit number of instances of your application.
    http://dbus.freedesktop.org/doc/api/...b5b1d33395679b
    http://dbus.freedesktop.org/doc/api/...9e49ad18e0cb25

  5. #5
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Thanks Daniil for your attention,

    I used QWidget::hide(), and when the user opens a new instance from the application, I check if there another hidden instance and closes it.

  6. #6
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by mabdelaal View Post
    Thanks Daniil for your attention,

    I used QWidget::hide(), and when the user opens a new instance from the application, I check if there another hidden instance and closes it.
    And why you cannot let user just close it? Since you close it on next instance start any way.

  7. #7
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by divanov View Post
    Apart from that you can use, for example, dbus_bus_request_name and dbus_bus_name_has_owner to limit number of instances of your application.
    http://dbus.freedesktop.org/doc/api/...b5b1d33395679b
    http://dbus.freedesktop.org/doc/api/...9e49ad18e0cb25
    Or their Qt counterparts:
    http://doc.trolltech.com/4.6/qdbusco...egisterService
    http://doc.trolltech.com/4.6/qdbusco...viceRegistered

  8. #8
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Hi all,

    I am working on an application that plays a sound every x minutes. user has the ability to hide the application while the sound still works.

    I make the main window of the application hidden using QWidget::hide(), and the application became hidden.

    But when the user opens the application again (by clicking its icon) a new instance from the application was opened and the hidden instance still working.

    how to show the hidden window (when clicking the application icon) instead of opening a new instance of the application?

    Thank you

  9. #9
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Are you using osso_initialize() in your application?

  10. #10
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Quote Originally Posted by divanov View Post
    Are you using osso_initialize() in your application?
    No, please tell me how to use it.

    Thank you.

  11. #11
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    There is a wiki article about application integration with DBus.

  12. #12
    Registered User mabdelaal's Avatar
    Join Date
    Jan 2010
    Posts
    32
    Thanks a lot.

Similar Threads

  1. How to display CAknWaitDialog in a hidden background application task
    By hyuan in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2009-07-26, 21:24
  2. Start an application and send message
    By symbi4n_programmer in forum Symbian C++
    Replies: 7
    Last Post: 2009-07-10, 07:12
  3. Run Application in background and hide from toolbar
    By Abhishek_karmakar in forum Symbian C++
    Replies: 3
    Last Post: 2008-12-31, 10:09
  4. Send Console application to background..
    By santu.paul@gmail.com in forum Symbian C++
    Replies: 3
    Last Post: 2008-12-21, 17:46
  5. Help!!! How to send .exe application to background
    By harry_zhang in forum Symbian C++
    Replies: 7
    Last Post: 2006-07-19, 16:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
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