Results 1 to 4 of 4

Thread: Text Effects

  1. #1
    Join Date
    Jan 2009
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Text Effects

    Hi,

    I am wanting to fade out the text on a QLabel to be transparent, then change the text, and fade back to black with the new text showing. The text is coming out of a data file so I can't create myself a movie in advance so I need to do it on the fly.

    I can change it instantly but thought it might look better with an effect, since I had that thought I have regretted it ever since

    I am currently using Qt3 and python and am stuggling to come up with a solution. I have read some bit about Qt4 and am wondering if it may be easier with that.

    Any ideas would be welcomed.

    Many Thanks in advance

    BigEd

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Text Effects

    Run a timer to change the text color. I think the approach would be pretty similar in both Qt 3 and Qt 4, just change the text color from the palette.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Text Effects

    This is slightly complicated by the fact I have an image as the background on the window so whats behind the text label is not solid colour. So I need to fade to transparent somehow

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Text Effects

    Qt Code:
    1. QPalette palette = label->palette();
    2. palette.setColor(QColorGroup::Text, QColor(qRgba(r, g, b, a))); // <-- 'a'
    3. label->setPalette(palette);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Need Graphical Text on QPushButton/QLabel
    By JimDaniel in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2008, 08:12
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.