+ Reply to Thread
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,317
    Thanks
    20
    Thanked 377 Times in 371 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: String to Integer / Integer to String

    Have a look a QString doc.
    Recommended off-line reading:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

  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,317
    Thanks
    20
    Thanked 377 Times in 371 Posts
    Qt products
    Qt3 Qt4
    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?
    Recommended off-line reading:
    The Foundations of Qt Development (ISBN: 1-59059-831-8)

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

    Default Re: String to Integer / Integer to String

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

+ Reply to Thread

Similar Threads

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