×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    5

    Close QInputDialog box automatically with a timer

    Hi,

    I have a requirement to close a QInputDialog after a 60 seconds if the user did not click on Ok or Cancel buttons.

    I tried with a wrrapper class for QInputDialog and used a timer inside it to close the Input dialog box automatically. But it wait on getText() method and not closing the widget.

    It is really appreciate if anyone can guide me on how to do it

    Thanks
    Kelum

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Close QInputDialog box automatically with a timer

    QInputDialog is derived from QWidget and so i think calling QWidget::Close() method should work.

  3. #3
    Registered User
    Join Date
    Jul 2011
    Posts
    5

    Re: Close QInputDialog box automatically with a timer

    Hi,

    I could do it. I used inputDialog.exec() method and took the return value. In the timer which is in my QInputDialog wrapper class, I set this.reject() once the time is up. That will cause exec() method to return 0.
    and then it close my QInputDialog automatically. That is what I wanted to do.

    Thanks Savaj for ur hint.

    Thanks

Similar Threads

  1. How to change InputMethodHints of a QInputDialog?
    By rahul.kulshreshtha in forum Qt
    Replies: 3
    Last Post: 2010-10-06, 15:45
  2. Replies: 1
    Last Post: 2010-06-29, 15:27
  3. How to Close Video Canvas automatically after Playing Video file
    By podugubhanuprakash in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2009-01-21, 12:52
  4. Emulator close automatically.
    By 113115 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2008-09-26, 20:21

Posting Permissions

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