Issue with using layout in custom widget plugins (Qt 5.1)
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
Re: Issue with using layout in custom widget plugins (Qt 5.1)
Quote:
Originally Posted by
alizadeh91
the layout system of the plugin won’t works correctly.
What do you mean?
Quote:
Is the plugins supports layout system?
The plugin doesn't care about internals of your widgets.
1 Attachment(s)
Re: Issue with using layout in custom widget plugins (Qt 5.1)
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:
Attachment 9485
What am i missing?
Re: Issue with using layout in custom widget plugins (Qt 5.1)
What did you set the horizontal size policy of the line edit to?
Re: Issue with using layout in custom widget plugins (Qt 5.1)
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.
Re: Issue with using layout in custom widget plugins (Qt 5.1)
Quote:
Originally Posted by
alizadeh91
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?