You can set the sizePolicy of each element in a layout. Typically a button has a fixed vertical size and an expanding horizontal size (dont get confused with "minimum" and "expanding" size policy).
Maybe it is useful to take the Qt creator and create a simple application and play around with layouts...
and you have to put QLayout::SetFixedSize as arg of SizeConstraint
Here is the doc explanation:
sizeConstraint : SizeConstraint
This property holds the resize mode of the layout.
The possible values are:
Constant Value Description
QLayout::SetDefaultConstraint 0 The main widget's minimum size is set to minimumSize(), unless the widget already has a minimum size.
QLayout::SetFixedSize 3 The main widget's size is set to sizeHint(); it cannot be resized at all.
QLayout::SetMinimumSize 2 The main widget's minimum size is set to minimumSize(); it cannot be smaller.
QLayout::SetMaximumSize 4 The main widget's maximum size is set to maximumSize(); it cannot be larger.
QLayout::SetMinAndMaxSize 5 The main widget's minimum size is set to minimumSize() and its maximum size is set to maximumSize().
QLayout::SetNoConstraint 1 The widget is not constrained.
I'm not sure anyone cares about this anymore, but I believe I know what the problem is.
When the plugin class is created, it is actually created outside the currently executing QApplication (via dlopen) and the code is running in a different thread. By reading up a bit on dlopen, it seems that the memory where the library is created comes from a different pool and that all libraries (used like this at least), should make sure to implement a function to destroy themselves.
Not sure if this makes any sense for someone, but it does for me.
Now, I just need to figure a way to get the libraries thread to join with the man QApplication that is already running.
@Ajith_P_V Yes that is right, you don't need to add the physical device. That was really just an extra option in case that was convenient to you later on : )
Have a look at creating kits for cross compiling in the qt docs if you can find it! - there are quite a few bits of info out there that may fill in the gaps I have left. I only gave the general steps required.
thread = new QThread(this);
IIRC, these lines are doing more than you think they do. thread's parent is your object, then you move your MyObject instance to thread, so all objects who are child of your MyObject instance are moved the thread. So thread will be moved to itself.
All in all, you should rather have thread in your main as a stack object