Results 1 to 3 of 3

Thread: QInputDialog default value

  1. #1
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QInputDialog default value

    Hi

    I am trying to set the default value for a QInputDialog

    Qt Code:
    1. double d= QInputDialog::getDouble(this,"Please enter Log base","Log Base = ",1.027459485, 1.0, 2.0 ,10, &ok);
    To copy to clipboard, switch view to plain text mode 

    However when I display the dialog the default value is display as

    1.0300000000

    Why is this?

    Regards

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QInputDialog default value

    Try creating an instance of QInputDialog and adjusting the number of decimals.
    J-P Nurmi

  3. #3
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QInputDialog default value

    Hi

    I tried that and adjusting the number of decimals . Still getting

    1.0300000000

    but with more or less decimals depending on the precision

    Thanks

Similar Threads

  1. Getting the name of the default style
    By gregsan in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2011, 19:00
  2. Replies: 7
    Last Post: 12th January 2011, 22:01
  3. QTreeView default drag action
    By onamatic in forum Qt Programming
    Replies: 2
    Last Post: 1st March 2010, 07:37
  4. Getting default "system" palette[solved]
    By maverick_pol in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2008, 17:34
  5. QInputDialog
    By bkv in forum Newbie
    Replies: 2
    Last Post: 6th October 2006, 07:34

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.