Results 1 to 3 of 3

Thread: [SOLVED]-->How to get int using Hex format in QLineEdit !

  1. #1
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default [SOLVED]-->How to get int using Hex format in QLineEdit !

    Hello! Friends,
    I was using QLineEdit->toInt() to get the required input as int. But now as i have changed the inputmask of QLineEdit to say Hex, am not able to get proper input. As we cant use toInt() now i tried few things with QByteArray, but not working.

    Can anyone please help me to get proper int input from QLineEdit where Hex format is displayed.----> i will grateful

    Thanks in advance.
    Last edited by Krish; 20th March 2008 at 12:44.

  2. #2
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: How to get int using Hex format in QLineEdit !

    Thanks to everybody, but i managed to solve it!

    Best regards.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [SOLVED]-->How to get int using Hex format in QLineEdit !

    I don't know if you are aware QString::toInt() can read hex values as well if you pass 16 as the second parameter.

  4. The following user says thank you to wysota for this useful post:

    Krish (20th March 2008)

Similar Threads

  1. Is there a known problem with QMimeData on Mac OS X?
    By Wurgl in forum Qt Programming
    Replies: 8
    Last Post: 27th February 2008, 22:21
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. how to get last character of QLineEdit
    By yagabey in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2008, 16:38
  4. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 01:25
  5. a box around QLineEdit?
    By GreyGeek in forum Qt Tools
    Replies: 13
    Last Post: 8th February 2006, 15:40

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
  •  
Qt is a trademark of The Qt Company.