Results 1 to 5 of 5

Thread: Convertion between QLineEdit formated to Double

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Convertion between QLineEdit formated to Double

    it's kind of notation, use
    Qt Code:
    1. qDebug( "%f", your_variable );
    To copy to clipboard, switch view to plain text mode 
    and you will see what you want

  2. #2
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Convertion between QLineEdit formated to Double

    Thanks for your help.
    You help-me to understand the process.

    Now I'm using this:

    QLocale locale;

    locale.setDefault(QLocale::German); // Decimal point is Comma: 000.000,00
    locale.setNumberOptions(QLocale::OmitGroupSeparato r);


    bool ok;
    double d;
    d = locale.toDouble( LE_TEST->text(), &ok );
    if(ok) {
    qDebug( "%f", d );
    }

    The LE_TEST is using inputMask: 999.999.999,99

    Thanks

Similar Threads

  1. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13

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
  •  
Qt is a trademark of The Qt Company.