×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    chennai India
    Posts
    62

    Thumbs up how to close our own application ??

    hi all i want to close my application automatically, when the system time reaches the user given time.
    any ideas???
    Thank you all in advance
    CHANGE is the only constant thing in this world.

  2. #2
    Registered User
    Join Date
    Jul 2009
    Location
    Manchester, UK
    Posts
    35

    Re: how to close our own application ??

    Create a QTimer object that emits a timeout() signal every few seconds.
    Connect the signal to a slot that checks if the required time has elapsed and, if it has, call this->close()

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to close our own application ??

    Why not just compute the time to the given time and set that for the timer interval?

  4. #4
    Registered User
    Join Date
    Jul 2009
    Location
    Manchester, UK
    Posts
    35

    Re: how to close our own application ??

    Quote Originally Posted by danhicksbyron View Post
    Why not just compute the time to the given time and set that for the timer interval?
    As it is a user supplied time it may change after the timer is set.
    Checking periodically saves having to cancel and restart the timer if the user changes the value.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to close our own application ??

    If the user time changes you simply reset the timer. You probably need to be able to cancel it anyway, if some user activity interrupts things.

    Polling is evil on a phone (or on any device, actually).

  6. #6
    Registered User
    Join Date
    Jul 2009
    Location
    Manchester, UK
    Posts
    35

    Re: how to close our own application ??

    Quote Originally Posted by danhicksbyron View Post
    Polling is evil on a phone (or on any device, actually).
    Clearly Nokia don't think it is that bad or they wouldn't have provided the QTimer class with a polling function!
    But yes, on second thoughts it is probably better to set the timer for the time the application needs to close......

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to close our own application ??

    Any tool can be abused.

  8. #8
    Regular Contributor
    Join Date
    Aug 2010
    Location
    chennai India
    Posts
    62

    Re: how to close our own application ??

    Thank buddy.... i got it
    CHANGE is the only constant thing in this world.

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

    Re: how to close our own application ??

    Quote Originally Posted by boddison View Post
    Clearly Nokia don't think it is that bad or they wouldn't have provided the QTimer class with a polling function!
    Please note, that Qt is cross-platform framework, which is available on dozen architectures and only some of them are mobile platforms.

Similar Threads

  1. Close Another application
    By Talib7 in forum Symbian
    Replies: 9
    Last Post: 2010-04-05, 12:46
  2. how to close application by close buttons in n900
    By babulamiet in forum Nokia N9
    Replies: 2
    Last Post: 2010-03-15, 09:08
  3. Replies: 35
    Last Post: 2010-02-26, 14:49
  4. close my application after uninstallation?
    By mismael in forum Nokia N9
    Replies: 1
    Last Post: 2010-02-24, 13:08
  5. How to close an application from Widget
    By soumyso in forum Symbian
    Replies: 6
    Last Post: 2009-11-13, 14:50

Posting Permissions

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