Taskbar Menu
-
@Nan-Feng said in Taskbar Menu:
close the window, fixed to the taskbar
I doubt you can do that with Qt as it is something done by the OS. Maybe there is something in Win32 API.
-
Since I have used Qt, I no longer want to call the system API. If I can’t achieve what I just said, can I intercept the close event in the right-click menu on the taskbar? I know that the close event must be intercepted in eventFilter or closeEvent. But how should it be judged that it is the closing event of the taskbar menu? Because there is a close event triggered from a button on the form, we need to judge.
-
@Nan-Feng said in Taskbar Menu:
can I intercept the close event in the right-click menu on the taskbar?
You can use the
closeEvent
, but then it will activate every time you try to close the window, no matter how.But how should it be judged that it is the closing event of the taskbar menu?
AFAIK, Qt can't differenciate that.
Because there is a close event triggered from a button on the form, we need to judge.
Create two cases:
- First case: You click your button... It's very easy to tell, if you close your window with your own button
- Second case: Every other close event: Your button was not clicked