Results 1 to 4 of 4

Thread: To underline the numbers behind the decimal points?

  1. #1
    Join Date
    Jun 2010
    Posts
    38
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default To underline the numbers behind the decimal points?

    In some stock software some figure showing this way:12.01

    How can I do it with QT?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: To underline the numbers behind the decimal points?

    If you want to display this text in QLabel, you can use html tags to underline a part of the text, just use:

    Qt Code:
    1. QLabel::setText("<u>my text</u>");
    To copy to clipboard, switch view to plain text mode 

    You can create needed text given a real number using the basic arithmetical operations and QString::number() method. ( a hint: 12.01 = 12 + 0.01 )

  3. #3
    Join Date
    Jun 2010
    Posts
    38
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: To underline the numbers behind the decimal points?

    If in stock software, I think figure showed maybe in QTableView or others.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: To underline the numbers behind the decimal points?

    If this has to happen in item views then you would need to write a delegate to paint the text appropriately.

Similar Threads

  1. QLineEdit for editing hexadecimal and decimal numbers
    By schall_l in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2012, 12:38
  2. Turn off the underline when using a QLabel as a link
    By gmat4321 in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2010, 14:31
  3. Replies: 0
    Last Post: 18th March 2009, 07:15
  4. QTableWidget and Decimal places
    By pshah.mumbai in forum Qt Programming
    Replies: 3
    Last Post: 17th August 2008, 09:30
  5. converting the value from hexadecimal to decimal value
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 16th November 2007, 11:24

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.