×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    40

    Question how to convet QString into int?

    hi,

    I want to convert QString into int . Can anybody tell me how to convert it.

    Thanks,
    Monali

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to convet QString into int?

    You can use qHash, for example
    http://doc.qt.nokia.com/4.6/qhash.html#qHash-7

  3. #3
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: how to convet QString into int?

    Quote Originally Posted by jainmonali21 View Post
    hi,

    I want to convert QString into int . Can anybody tell me how to convert it.

    Thanks,
    Monali
    You are talking about this one: http://wiki.forum.nokia.com/index.ph...ned_data_in_Qt

    Also see the reference of this article : Qstring


    Best regards.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: how to convet QString into int?


  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to convet QString into int?

    What do you want to do, convert decimal characters into an int, or come up with some sort of integer representation for the (non-decimal) string value?

    For the former just do:
    Code:
    QString mystring(1234);
    int myint = mystring.toInt();
    Use toInt(16) if the string is hex rather than decimal.

    Bookmark the Qt reference: http://doc.qt.nokia.com/4.6-snapshot/index.html

    At the top of the main page is "All Classes". Click on that and select "QString" from the list. All your answers are there.

Similar Threads

  1. Picture arrangment on screen
    By Hesam in forum Mobile Java General
    Replies: 1
    Last Post: 2010-03-31, 11:16
  2. Why Are Pre-processors Inherently Evil?
    By grahamhughes in forum Mobile Java General
    Replies: 15
    Last Post: 2009-02-12, 08:42
  3. Python for UIQ
    By cassioli in forum Symbian
    Replies: 141
    Last Post: 2008-06-11, 18:16
  4. CustomItem overlaps TextField
    By asashour in forum Mobile Java General
    Replies: 2
    Last Post: 2007-03-27, 11:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×