Results 1 to 6 of 6

Thread: how to show and hide Qlabel continuously on mainwindow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2014
    Posts
    31
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to show and hide Qlabel continuously on mainwindow

    Thank you for the reply....can u please provide with an example code..
    I didn't get ur point..

    Thanks in advance..

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to show and hide Qlabel continuously on mainwindow

    Method display should be defined as slot and looks like :
    Qt Code:
    1. void MainWindow::display()
    2. {
    3. label->setVisible(!label->isVisible());// Set the status of the opposite
    4. QTimer::singleShot(500,this,SLOT(display()));// call display() after 500 ms
    5. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2014
    Posts
    31
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to show and hide Qlabel continuously on mainwindow

    Quote Originally Posted by Lesiok View Post
    Method display should be defined as slot and looks like :
    Qt Code:
    1. void MainWindow::display()
    2. {
    3. label->setVisible(!label->isVisible());// Set the status of the opposite
    4. QTimer::singleShot(500,this,SLOT(display()));// call display() after 500 ms
    5. }
    To copy to clipboard, switch view to plain text mode 
    Thanks for the reply sir..

    I was placed that method...but when i run my program..it is showing that..
    "The program has unexpectedly finished."

    Thanks in advance..

  4. #4
    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: how to show and hide Qlabel continuously on mainwindow

    Run your program in your debugger. When it crashes look at where it crashed in the back trace you will likely be given.

Similar Threads

  1. Replies: 22
    Last Post: 26th November 2015, 20:27
  2. mouseMoveEvent show/hide
    By davidovv in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2013, 09:50
  3. Show and hide Tab page
    By fulin in forum Newbie
    Replies: 3
    Last Post: 28th March 2012, 09:43
  4. Hide and Show QMenu
    By febil in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2009, 09:31
  5. How to hide mainwindow at program start up
    By palmer in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2008, 14:35

Tags for this Thread

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.