Results 1 to 2 of 2

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

  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 13:10.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QToolButton show()&hide() not correct

    Sure you use the right pointer in showBtnB and showBtnC? You seen behaviour can only be the result of a wrong pointer use or something else in your code. So provide a little bit more code or make a small compilable demo which illustrate you problem.

Similar Threads

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