How to know push button is about to click?
-
I plan to click button to show a pop-up window and hide it when click that button again. It's working well when click the button firstly. But at the second click, that window is hidden and then displayed right away. I think the root cause is that the button-clicked signal is emitted after pop-up window lose focus and disappear. In slot function, window's visibility is false, so it's set to be true again. I want to call my slot function before pop-up window lose focus.
-
I plan to click button to show a pop-up window and hide it when click that button again. It's working well when click the button firstly. But at the second click, that window is hidden and then displayed right away. I think the root cause is that the button-clicked signal is emitted after pop-up window lose focus and disappear. In slot function, window's visibility is false, so it's set to be true again. I want to call my slot function before pop-up window lose focus.
@Lee908 said in How to know push button is about to click?:
But at the second click, that window is hidden and then displayed right away.
Sounds like a bug in your code. If you show it maybe somebody will find the issue.
-
@Lee908 said in How to know push button is about to click?:
But at the second click, that window is hidden and then displayed right away.
Sounds like a bug in your code. If you show it maybe somebody will find the issue.
-
It's not a bug. The popup window will disappear when click anywhere out of it. And then button-clicked signal triggers slot to change that window's visibility. So it turns to be shown again.