Results 1 to 6 of 6

Thread: How to make a QString text underlined?

  1. #1
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt/Embedded
    Platforms
    Windows

    Question How to make a QString text underlined?

    Hello,

    How to make a QString text underlined?

    for example:
    you@gmail.com --> you@gmail.com

    Thank you!

    -B

  2. #2
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to make a QString text underlined?

    QString is a string... just a type. Where do you want to underlyne it? where do you want to show the text? (QLabel, QGraphicsTextItem...)

  3. #3
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt/Embedded
    Platforms
    Windows

    Default Re: How to make a QString text underlined?

    in QLineEdit

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to make a QString text underlined?

    In that case I'd say one possible solution is styleSheet property.

  5. #5
    Join Date
    Jun 2009
    Posts
    74
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Default Re: How to make a QString text underlined?

    try this:
    QString underline("<u>abc</u>");

  6. #6
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to make a QString text underlined?

    I think you have to use QWidget::setStyle or QWidget::styleSheet
    Example: change the backgroundcolor in a QLabel.
    Qt Code:
    1. QString strStyle("background-color: Red");
    2. mylabel->setStyleSheet(strStyle);
    To copy to clipboard, switch view to plain text mode 

  7. The following user says thank you to jano_alex_es for this useful post:

    maratk1n (24th November 2017)

Similar Threads

  1. how can I make a balloon to wrap the editable text?
    By learning_qt in forum Qt Programming
    Replies: 9
    Last Post: 20th January 2009, 15:09
  2. Replies: 3
    Last Post: 20th November 2007, 07:03
  3. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 20:47
  4. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.