Results 1 to 2 of 2

Thread: QToolButton show()&hide() not correct

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default QToolButton show()&hide() not correct

    I have three QToolButtons in a HBoxLayout.The Pointers are Btn1,Btn2,Btn3.
    At first,they are all hidden;
    Qt Code:
    1. void initButtonStates(){
    2. Btn1->hide();
    3. Btn2->hide();
    4. Btn3->hide();
    5. }
    To copy to clipboard, switch view to plain text mode 
    And there are following functions:
    Qt Code:
    1. void showBtnA(){
    2. initButtonStates();
    3. Btn1->show();
    4. }
    5. void showBtnB()....
    6. void showBtnC()....
    To copy to clipboard, switch view to plain text mode 
    However,with the following code:
    Qt Code:
    1. showBtnA();
    2. showBtnB();
    3. showBtnC();
    To copy to clipboard, switch view to plain text mode 

    BtnA is always there,and no BtnB&C
    But When Using qDebug(),it shows that BtnA is not visible.But it's just there.
    That's really strange.

    p.s. each of the Buttons has a Stylesheet to give it a border-image(normal,hover,pressed,etc)

    Thanks To any reply and i'm just waiting online.
    Last edited by daiheitan; 13th March 2010 at 12:10.

Similar Threads

  1. how to show and hide frames?
    By rambo83 in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2010, 09:53
  2. Hide and Show QMenu
    By febil in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2009, 09:31
  3. hide from taskbar but show to ALT-TAB
    By musikit in forum Qt Programming
    Replies: 0
    Last Post: 15th August 2008, 16:14
  4. Show or hide a form
    By Gayathri in forum Newbie
    Replies: 11
    Last Post: 17th November 2006, 12:39
  5. Cannot hide QToolButton
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2006, 09:41

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.