Results 1 to 2 of 2

Thread: Input Dialog

  1. #1
    Join Date
    Dec 2011
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Input Dialog

    Hi All. Please assit. Learning programming and I want to use an input dialog box first without the Cancel push button and then later make use of the cancel push button to end the program. I am using the following statement for the input dialog QInputDialog::getInteger(0, "Calculator", "Calculated value", 1, 1, 10,1,0,0)
    Last edited by Enoctaffie; 13th February 2012 at 10:18.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Input Dialog

    QInputDialog::getInteger is obsolete, use getInt() instead.

    Qt Code:
    1. // example
    2. bool ok;
    3. int i = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"), tr("Percentage:"), 25, 0, 100, 1, &ok);
    4. if(!ok)
    5. {
    6. exit( 0 );
    7. }
    To copy to clipboard, switch view to plain text mode 
    If ok is nonnull *ok will be set to true if the user pressed OK and to false if the user pressed Cancel. The dialog's parent is parent.

Similar Threads

  1. Replies: 3
    Last Post: 19th October 2011, 13:08
  2. taking input from the input box
    By neutrino in forum Qt Programming
    Replies: 7
    Last Post: 30th September 2011, 17:09
  3. Input Dialog with Check Box?
    By PeterThePuter in forum Newbie
    Replies: 5
    Last Post: 26th October 2010, 05:30
  4. Why modeless dialog block keyboard input
    By franco.amato in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2010, 02:08
  5. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01

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.