I made a GUI and used win10toast_click library to get an alarm. When I get an alarm, I want to click that alarm. And then I want to bring the main window to the front like you actually click that window. I tried several sugesstions, but it did not work well.
For example,
window.setWindowFlags(window.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
window.show()
window.setWindowFlags(window.windowFlags() & ~QtCore.Qt.WindowStaysOnTopHint)
window.show()
or
window.setWindowState(window.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive)
window.activateWindow()
I thought it would be very simple. But I couldn’t find the right answer.
If I click the window, it is shown on top. I want that.(not on top always.) Can anyone help me?
def check_exist(self):
toast.show_toast("checking", "exist", icon_path='', duration=3, threaded=True,
callback_on_click=self.activate_window)
def activate_window(self):
?