Results 1 to 6 of 6

Thread: Input Dialog with Check Box?

  1. #1
    Join Date
    Oct 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Input Dialog with Check Box?

    Hey all,

    I want to make a dialog that won't show itself in the future if the user selects a check box.

    The trouble is how to put a checkbox in a dialog. I looked at QInputDialog, but didn't see anything for checkboxes. I also looked at QMessageBox, but don't know how to sneak a checkbox in.

    Is there any way easier or more straightforward than using QDialog? If not, how would I go about it? Sorry, complete newbie here.

    -PtP

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Input Dialog with Check Box?

    You can subclass the input dialog

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Input Dialog with Check Box?

    Or you can use QErrorMessage.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Oct 2010
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X

    Default Re: Input Dialog with Check Box?

    Thanks. This is very helpful. I did not know that you could subclass the input dialog. This forum is great. Thanks for taking the time to answer the question posted here.

  5. #5
    Join Date
    Oct 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Input Dialog with Check Box?

    Since the dialog is simple, I just decided to go the default route and subclass QDialog.

    The only thing I am wondering is how to return an integer from QDialog::exec(). Or should have I subclassed QInputDialog?

    Thanks!

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Input Dialog with Check Box?

    The exec() function returns one of two possible values:
    http://doc.trolltech.com/latest/qdia...ialogCode-enum

    Do you want to change this? If so, why?

Similar Threads

  1. Replies: 0
    Last Post: 5th October 2010, 08:41
  2. closing child dialog closes parent dialog
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 28th May 2010, 20:46
  3. Why modeless dialog block keyboard input
    By franco.amato in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2010, 03:08
  4. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 14:01
  5. QLineEdit check Input
    By raphaelf in forum Newbie
    Replies: 1
    Last Post: 17th August 2006, 15:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.