Results 1 to 3 of 3

Thread: SETTING THE TEXT COLOR FOR QMessageBox

  1. #1
    Join Date
    Nov 2009
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile SETTING THE TEXT COLOR FOR QMessageBox

    Hello everbody,

    anyone please suggest me a way top set the color for the text in QMessageBox

  2. #2
    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: SETTING THE TEXT COLOR FOR QMessageBox

    Have you tried setting the text using an HTML fragment containing the font element?

  3. #3
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SETTING THE TEXT COLOR FOR QMessageBox

    Hi vinkakarun.

    You can try this:


    Qt Code:
    1. QMessageBox::warning(this , trUtf8("EXAMPLE") ,
    2. "<P>EXAMPLE THE TEXT IN <FONT COLOR='#800000'>RED</FONT> AND <FONT COLOR='#000080'>BLUE</FONT></P>"),QMessageBox::Close);
    To copy to clipboard, switch view to plain text mode 

    Enjoy

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Replies: 2
    Last Post: 23rd July 2012, 08:42
  3. Setting QTabWidget's Text with a QStyle
    By taurho in forum Qt Programming
    Replies: 0
    Last Post: 11th March 2009, 12:23
  4. QTreeWidgetItem setting color for the text
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 17:22
  5. Setting text color on QLabel
    By Yorma in forum Newbie
    Replies: 11
    Last Post: 15th June 2006, 07:25

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.