Not possible to set layout on custom widget plugin
-
wrote on 16 Feb 2017, 17:23 last edited by
Hi,
I am trying to create a simple widget plugin for Qt Designer. I am however stuck on a few points.
It's a simple widget inheriting from QWidget, which has a title and a content QWidget underneath.
When clicking on the title, the content is hidden/shown, with a small animation.
Sources can be found here: https://github.com/Hallot/CollapsibleWidgetQtI can build the plugin just fine, and it appears in Qt Designer afterwards.
However, I cannot add a layout to my custom widget. If I add a couple of QLabels to the widget, no layout is available.
I have set the isContainer() method to true, to no avail.
Any idea of what I am doing wrong?Second question, I have defined a property "title" in the domXml() method, so the user can set the title from the Qt Designer interface.
How can I get when this field is changed so I can change the value of the title in the widget?Last question, the animations depend on the height of the content, so I'd need to reset the maximumHeight value for the animations every time the content widget is modified. Is there a signal for this?
Thanks.
-
wrote on 17 Feb 2017, 08:16 last edited by
If you just need the final result, it's available: https://github.com/crapp/qaccordion
-
wrote on 20 Feb 2017, 07:43 last edited by
Thanks for the link, but I am mostly interested in being able to do it all through the Qt Designer UI via a plugin.
3/3