Results 1 to 5 of 5

Thread: String to Integer / Integer to String

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Question String to Integer / Integer to String

    Hi,

    In my program I have three lineEdit to add two numbers and show the resault.
    my problrm is I don't know how can I convert string to integer and after calculation convert Integer to String.

    please guide me.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: String to Integer / Integer to String

    Have a look a QString doc.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: String to Integer / Integer to String

    Are these ok?

    int toInt ( bool * ok = 0, int base = 10 ) const
    std::string toStdString () const

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: String to Integer / Integer to String

    Will my answer be faster to read then the function documentation?
    I mean really, no disrespect, but what do you expect with such questions?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: String to Integer / Integer to String

    Do they work? If so, yes, otherwise, No

Similar Threads

  1. Passing an integer to a slot
    By bizmopeen in forum Newbie
    Replies: 6
    Last Post: 30th October 2009, 10:51
  2. integer as a QTableWidgetItem ?
    By tommy in forum Qt Programming
    Replies: 7
    Last Post: 29th May 2009, 18:44
  3. Qtablewidget and insert integer
    By freeman in forum Newbie
    Replies: 1
    Last Post: 22nd July 2008, 18:06
  4. Converting to integer
    By Salazaar in forum Newbie
    Replies: 2
    Last Post: 15th June 2007, 21:11
  5. converting string to unsigned integer
    By mgurbuz in forum Qt Programming
    Replies: 4
    Last Post: 12th May 2006, 10:46

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.