2

I would like to add my plugin window to the list of panels in QGIS 3.18.
My goal is to attach my plugin window to one side of QGIS and it seems to be only possible for these listed panel windows.

enter image description here

3
  • 1
    Is your specific goal to attach the plugin to one side of the screen, or is it to add the plugin to the panels menu? If your goal is to attach the plugin window to one side of the screen, you can use a dockwidget UI type - example.
    – Matt
    Commented Mar 16, 2022 at 15:46
  • Yes, That would solve my problem. Do you know how to switch my QDialog mainWindow into a QDockWidget?
    – Setare
    Commented Mar 17, 2022 at 13:32
  • See my answer below. It doesn't answer your original question about the QGIS view panels, but it is probably worth you rewording your question to be more in line with how to switch your QDialog mainWindow to a DockWidget. You will get better help that way.
    – Matt
    Commented Mar 17, 2022 at 14:31

1 Answer 1

1

If you create your UI using QT Designer, you can make a new form and choose QDockWidget from the widgets dropdown and copy all your items across from your old form. You will have to update the UI initialisation in your code to the new type.

I tend to use the Plugin Builder plugin, there you can select DockWidget as your UI type.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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