Results 1 to 7 of 7

Thread: Need Graphical Text on QPushButton/QLabel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Need Graphical Text on QPushButton/QLabel

    I'm wanting to create more graphical text to put on our QPushButtons and QLabels. I mean text with effects, like gradients...outlines...etc.

    How would you gurus recommend approaching something like this? I'd like to avoid pre-creating images for all the text I'll need, as we'll need to translate it later on. I know QPainter can achieve all the effects I need.

    Would the best method be to get the region of the button or label I want the graphical text on, then use QPainter to paint the text I need inside the area? That was my initial thought, but somehow I don't like that.

    Thanks for any help you can give, Daniel

    EDIT: Been reading up on QPainter - I notice it can take a QPaintDevice in its constructor as the object to paint to. Looking at QPaintDevice I see that QPixmap implements it. Would it be feasible (efficient) to paint my graphical text to a QPixmap object, then set the QPixmap as the button's icon? I'm going to experiment of course, just want to do it the best possible way.
    Last edited by JimDaniel; 3rd June 2008 at 04:46.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. Match the text beetween two string
    By dreamer in forum Qt Programming
    Replies: 4
    Last Post: 20th May 2008, 14:48
  4. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  5. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30

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.