PDA

View Full Version : Issue with using layout in custom widget plugins (Qt 5.1)



alizadeh91
26th August 2013, 06:39
Hi,
I’ve written a custom widget plugin for QtDesigner and I’ve used layout system to arrange elements in the plugin. But when i use this plugin in forms, the layout system of the plugin won’t works correctly. What am i missing?! Is the plugins supports layout system?
Thanks

wysota
27th August 2013, 11:09
the layout system of the plugin won’t works correctly.
What do you mean?


Is the plugins supports layout system?
The plugin doesn't care about internals of your widgets.

alizadeh91
27th August 2013, 14:31
Suppose i want to put a comboBox besides a lineEdit in plugin and whenever expands it in a form, the lineEdit expands to fill extra spaces. If i put them in layout, when i use this layout in forms then this happens:
9485
What am i missing?

wysota
27th August 2013, 14:34
What did you set the horizontal size policy of the line edit to?

alizadeh91
27th August 2013, 15:50
I've set QSizePolicy::Expanding for lineEdit with a high maximumWidth and a fixed size policy for comboBox and nothing is between them. An i'm so confused because when i create these combination in a simple form (not using plugin) the layout works like a charm but when i create the layout in plugin the plugin won't works correctly.

Added after 10 minutes:

I'll will attach an example tomorrow.

wysota
27th August 2013, 16:19
I've set QSizePolicy::Expanding for lineEdit with a high maximumWidth and a fixed size policy for comboBox and nothing is between them.
Why did you set a maximum width for it? Where do those large margins in your attachment come from?