Results 1 to 6 of 6

Thread: how to show and hide Qlabel continuously on mainwindow

Threaded 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 how to show and hide Qlabel continuously on mainwindow

    Hello all,
    I am new to Qt, please tell me how to show and hide the Qlabel message continuously on my mainwindow...

    Here is my code..

    MainWindow.cpp

    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. label=ui->label;
    7.  
    8. display();
    9. }
    10.  
    11. MainWindow::~MainWindow()
    12. {
    13. delete ui;
    14. }
    15.  
    16. void MainWindow::display()
    17. {
    18. while(1)
    19. {
    20. label->show();
    21. sleep(1000);
    22. label->hide();
    23. }
    24. }
    To copy to clipboard, switch view to plain text mode 

    when i run the program mainwindow is not comming...and no errors are comming..
    Please help me..
    Thank you.
    Last edited by anda_skoa; 30th March 2014 at 12:06. Reason: Changed [quote] to [code] tags

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.