1

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?

1

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)
.
.
.
| improve this answer | |
  • thanks ! I'had to pu the 2 lines into def run(self): – zlikotp Dec 26 '19 at 7:17
  • You're welcome. – xunilk Dec 26 '19 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.