I've made a custom plugin and use QT Designer. When the form appears, if I click into the cavenas then the form disappears. I would like to force the forme to stay a the first plan. And also, keep the "possibility" to click into the cavenas if I need (without hiding the plugin's form). How can I manage that?
You only need to import Qt from PyQt5.QtCore and to include one additional instruction (by using "setWindowFlags" method) as it can be observed in following code snippet of all my plugins with this desired behavior (Plugin Dialog Always On Top):
. . . from PyQt5.QtCore import Qt . . . def __init__(self, iface): . . . # Create the dialog (after translation) and keep reference self.dlg = WhereAmIDialog() self.dlg.setWindowFlags(Qt.WindowStaysOnTopHint) . . .