PDA

View Full Version : Designer plugin with container widget



perneky
22nd April 2020, 14:13
Hi All,

I am struggling with creating a new Designer widget, with a container in it for Qt 5.14.1. I am following tutorials and some other leads to get this working and I actually have my widget in Qt designer. My widget derives from QWidget, have some layouts, a frame and a label in it. And also a QWidget intended to be a container for other widgets from the designer.

My problem is, how do I specify the container widget for the Designer?

I am trying to solve this with QDesignerContainerExtension (although the documentation is stating that it is not meant for this), as most forum posts are pointing to that direction (but never with a working example). I am forcing it to have 1 page and for that page I return my container widget back.

The widget appears in the designer, but when I drag an other widget into it, like a button, the button is not placed into the container widget, it actually not even appears in the widget tree. It seems the button is attached to the custom widget, but not to the container. Also I can't seem to be able to specify a layout for it.

Here is what I have now: 13423

Can you please help me making this work?

Thank you.

Laci

wysota
28th April 2020, 00:44
You can download code for wwWidgets here: http://www.wysota.eu.org/wwwidgets/#download

It contains a couple of working containers. I'm not maintaining it anymore but the code that is there should still work.