Results 1 to 2 of 2

Thread: integer to QChar

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default integer to QChar

    I need to change the digits of a floating number n update it back to the QLCDNumber as double.

    You know, the best way crossed my mind is to convert the double to QString and replace
    the new digit with any three digits of the double. However, the QString replace() method
    take QChar as the last argument. I need to replace this argument with the integer I wish to
    replace in QLCDNumber. I tried to convert it but it gives me error.

    does anyone know how to convert my integer to QChar ?

  2. #2
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: integer to QChar

    To convert integer to QChar you can convert it to QString then to QChar.
    Qt Code:
    1. QString::number(NUMBER).at(INDEX)
    To copy to clipboard, switch view to plain text mode 

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

    saman_artorious (26th February 2013)

Similar Threads

  1. Problem in conversion of QChar to char
    By Prashant_Bhutani in forum Newbie
    Replies: 5
    Last Post: 19th April 2010, 10:27
  2. From QString to QChar
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 03:14
  3. Highlidhting a single QChar in QLineEdit.
    By Zenzen in forum Qt Programming
    Replies: 2
    Last Post: 7th January 2009, 21:15
  4. size of QChar
    By babu198649 in forum Newbie
    Replies: 5
    Last Post: 4th August 2008, 15:36
  5. Q3PopUpmenu: Qchar * to QString
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 1st February 2007, 20:33

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.