I have three QToolButtons in a HBoxLayout.The Pointers are Btn1,Btn2,Btn3.
At first,they are all hidden;
void initButtonStates(){
Btn1->hide();
Btn2->hide();
Btn3->hide();
}
void initButtonStates(){
Btn1->hide();
Btn2->hide();
Btn3->hide();
}
To copy to clipboard, switch view to plain text mode
And there are following functions:
void showBtnA(){
initButtonStates();
Btn1->show();
}
void showBtnB()....
void showBtnC()....
void showBtnA(){
initButtonStates();
Btn1->show();
}
void showBtnB()....
void showBtnC()....
To copy to clipboard, switch view to plain text mode
However,with the following code:
showBtnA();
showBtnB();
showBtnC();
showBtnA();
showBtnB();
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.
Bookmarks