Results 1 to 2 of 2

Thread: Converting short to QString

  1. #1
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Converting short to QString

    Hello All,

    I want to put a short value to LineEdit. B ut LineEdit only takes QString. Can anyone please tell me how i can do this.

    Qt Code:
    1. LineEdit->setText(short_value);
    To copy to clipboard, switch view to plain text mode 

    it will be of great help. I tried
    Qt Code:
    1. QString::fromUtf16
    To copy to clipboard, switch view to plain text mode 
    but the value is random signs.

    Just ignore the question. I found the answer.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Converting short to QString

    RTFM (Read This Fine Manual) : QString::number

Similar Threads

  1. Replies: 2
    Last Post: 17th May 2012, 10:55
  2. converting QByteArray to unsigned short
    By sattu in forum Qt Programming
    Replies: 16
    Last Post: 28th September 2010, 13:51
  3. converting uint to QString
    By Yayati.Ekbote in forum Newbie
    Replies: 1
    Last Post: 14th April 2010, 13:43
  4. Converting a QString to a LPCTSTR?
    By dobedidoo in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2009, 14:27
  5. Converting u_char to QString
    By merlvingian in forum Newbie
    Replies: 7
    Last Post: 29th September 2006, 00:11

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.