Results 1 to 5 of 5

Thread: Conversion of Qstring to Qint64

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Nov 2013
    Posts
    15
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Conversion of Qstring to Qint64

    when I try this code I still get 0 for value = 20.5. But I need value=20. How can I solve it?

    Qt Code:
    1. inline qint64 GetInteger64FromStatic(QLineEdit* lineEdit)
    2. {
    3. QString text;
    4. qint64 nValue = 0;
    5. //bool convertOK;
    6. bool ok;
    7.  
    8. nValue = lineEdit->text().toLongLong(&ok,10);
    9.  
    10. return nValue;
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by citix; 21st January 2014 at 07:43.

Similar Threads

  1. Enum To QString Conversion
    By yagabey in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2012, 14:28
  2. BSTR to QString Conversion
    By bismitapadhy in forum Qt Programming
    Replies: 9
    Last Post: 16th February 2012, 12:51
  3. char* to QString: conversion
    By abghosh in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2010, 09:32
  4. QString iso 8859-1 conversion
    By mattia in forum Newbie
    Replies: 11
    Last Post: 21st January 2008, 14:17
  5. qint64 to QString
    By Morea in forum Newbie
    Replies: 1
    Last Post: 24th March 2006, 08:21

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