Results 1 to 4 of 4

Thread: setVisible(bool) problem, only works one way

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default setVisible(bool) problem, only works one way

    I am trying to set up a function that will make a label visible and invisible on alternating times I push a putton. So far I have set up the connection to use the setVisible(bool) public slot when I push the button. I have set up the function to access ButtonClickedHandler(bool) when action clicked(bool) is taken

    Qt Code:
    1. void MainWindow::ButtonClickedHandler(bool checked)
    2. {
    3. ui->label->setVisible(checked);
    4. }
    To copy to clipboard, switch view to plain text mode 

    When I compile and run the program, pushing the button the first time makes the label disappear, but pushing it subsequent times does not do anything, and does not turn the visibility back on. How can I get this to work properly?



    Alternatively I've tried to just create a connection between the button using clicked(bool) and the label using setVisible(bool), but I have the same exact problem, the first push makes the label disappear but subsequent pushes do not make it return.

    Thank you in advance
    Last edited by hojoff79; 29th December 2010 at 17:57.

Similar Threads

  1. setVisible textblock in QTextEdit
    By corrado in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2010, 03:04
  2. QTextBlock::setVisible()
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2009, 01:06
  3. setVisible(false) doesn't work
    By sepehr in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2009, 16:20
  4. setVisible, -> token, problems
    By Salazaar in forum Newbie
    Replies: 25
    Last Post: 12th June 2007, 14:30
  5. Problem with "setModified(bool)"
    By _SamSoft_ in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2007, 14:51

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.