Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User jainmonali21's Avatar
    Join Date
    Mar 2010
    Posts
    40
    hi,

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

    Thanks,
    Monali

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    You can use qHash, for example
    http://doc.qt.nokia.com/4.6/qhash.html#qHash-7

  3. #3
    Nokia Developer Champion rahulvala's Avatar
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,294
    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 laa-laa's Avatar
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

  5. #5
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    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 Python
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved