Results 1 to 3 of 3

Thread: how to convert int to QString?

  1. #1
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile how to convert int to QString?

    Hi EveryBody
    can any one tell me how to convert int into Qstring?

    I've a function int GetNo();
    n my class name is let cls; n clsObj is object of this class.
    so i need this function to change into QString;
    clsObj.Getno();

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to convert int to QString?


  3. The following user says thank you to marcel for this useful post:

    phillip_Qt (4th October 2007)

  4. #3
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to convert int to QString?

    i was doing something like this just the other day,

    the way i got it to work was

    Qt Code:
    1. QString mystringint;
    2. mystringint.setNum(100);
    To copy to clipboard, switch view to plain text mode 

    100 was is the int

    cheers,
    Philly

Similar Threads

  1. How to convert from QString to string ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 1st December 2010, 02:50
  2. How to convert Int to QString in QT4?
    By drake1983 in forum Newbie
    Replies: 2
    Last Post: 11th March 2007, 07:58
  3. Convert wstring to QString.
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2007, 15:18
  4. Replies: 2
    Last Post: 12th June 2006, 18:47
  5. How to convert from QString to quint16 ?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2006, 10:00

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.