View Full Version : Problem with custom container widget

8th August 2007, 15:57

QT 4.3 on windows.

I have created a custom widget for use in QT Designer.
This is intended as a collapsible groupbox. The .ui form
previews and operates correctly in QT Designer. An image is attached.

The plug-in also correctly appears in mt QT Designer toolbox
and I can move it onto a form, preview the form and that works.

This is intended to be a container widget in that controls may
be moved onto it and placed in a layout. I am returning true
in my isContainer() routine.

My widget will allow me to place items on it. Radio buttons
for example. I then select the radio buttons and apply a
layout. The red rectangle appears. I then resize with the
mouse and as soon as I let go of the selection QT Designer

It's happy with the radio buttons if I don't attempt to
place them in their own layout.

I have tried using both a QWidget and a QFrame as my container
portion of my widget. Both yield the same results.

Any ideas?

Thank you


8th August 2007, 16:14
Do you set any layout(in the plugin) for the container widget?
Try saving the ui(without resizing it) after you apply the layout and then compile it with uic and take a look at the resulting source.
See if everything is in order.


8th August 2007, 23:08
Can you use the widget properly from within manualy written code and not Designer?

24th August 2007, 18:59
I am able to add controls to my control if I do it manually and not from QT Designer.

In fact as soon as I place anything on my container control QT Designer crashes.

Any ideas?

25th August 2007, 03:37
This seems to have been a result of applying
A Grid layout to the overall control as the final step. I changed it to a Vertical layout and
That seemed to take care of it.