PDA

View Full Version : Size of a plugin widget in designer



high_flyer
17th February 2006, 19:50
Hi,

Qt4, linux.
I have made a designer plugin.
But when I pick it from the plugin panel, its size is a defalut size, which I would like to change.
I tried to resize it in my plugin wrapper clss before the instance of the widget is returned, but that has no affect.
I am reading the docs about it at the moment , but if any one can point me to the right direction to save me some time I will appreciate it. :)

Thanks.

wysota
17th February 2006, 21:02
Could you explain the situation a bit more? You can't resize a widget once it's placed on a form? Did you use layouts while designing it?

high_flyer
17th February 2006, 21:11
What I mean is, when you pick a widget from the widget panel, it pops under your cursor for you do drag and drop it on a form.
I managed to have it the size I want once dropped on the form.
But I can't seem to control its size during the "drag" faze from the panel to the form.
For example, if you look at the worldclock example, once you click on it, it apears in a 200x200 rectangle.
If you look at the code, TT just made resize(200,200) in the clocks constructor.
There is no other sizing code in the plugin inplementation or the base clock class (that I can see).
If I use resize() in my plugins base class it has no effect, nor when I do it in the plugin implementation class in createWidget().
So far I could not find what am I doing wrong, and why in my case the widget ignores the resize() in the costructor when it clearly works for the clock example...

Thanks.

EDIT: no layout is used for the widget, its just one widget.

wysota
17th February 2006, 23:12
I guess the size during the drag is taken from the sizeHint of the widget.

high_flyer
28th February 2006, 14:29
I figured it out.
You can set it in the xml code in the domXml() of your plugin class.