Results 1 to 3 of 3

Thread: How to make text in label or TextEDit to flash?

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to make text in label or TextEDit to flash?

    HI,

    i want to make the text in label to flash(to appear and disappear which makes to look like flashing).
    i tried to do like this

    setting text in the label
    usleep(for some interval)
    clear text in the label
    usleep for some intervel
    run this in a loop for some iterations
    But when i run this code i am not able to use other tools in my window until the loop completes.

    Can any one suggest me any other way to achieve this task or any modifications for the existing .

    Thnks in Advance.

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make text in label or TextEDit to flash?

    use QCoreApplication:rocessEvents () in the place where u editing the QString ... means update() pending events.

    or use qApp->processEvents();
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    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 text in label or TextEDit to flash?

    Use QTimer, that will keep your event loop running

Similar Threads

  1. Replies: 2
    Last Post: 14th February 2010, 17:02
  2. make label of QwtPlotMarker invisible
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 26th November 2009, 13:39
  3. Help text color in TextEdit
    By tho97 in forum Qt Programming
    Replies: 5
    Last Post: 26th March 2008, 09:47
  4. How can I make the cursor flash?
    By cslijy in forum Qt Programming
    Replies: 2
    Last Post: 1st January 2008, 12:51
  5. Make the cursor visible in textEdit (Qt3.3.5)
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 24th January 2007, 23:50

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.