[PATCH] KPluginSelector

Martijn Klingens klingens at kde.org
Sat Nov 29 23:03:49 GMT 2003


Hiya,

Attached one-liner "fixes" a very annoying bug in KPluginSelector that made 
the QWidgetStack not honour the minimumSizeHint of embedded KCMs. It was 
possible to resize the window below minSizeHint, and it was possible that the 
embedded KCM got truncated due to a too small window.

"fixes", because the bug is not caused by embedding KCMs and all of Qt's 
layout management seems ok to me. After several very frustrating debug 
sessions I came up with the attached .cpp file that exhibits the problem if 
the #if 0 part is left as is, but not when the #if is removed.

Unfortunately this might help the TT people to tell me what's wrong, but in 
the case of KPluginSelector it was no help. The problem there is that the 
widgets are added run-time, AFTER the widget stack is already being shown. To 
me it seems that the dynamic adding of widgets is what really breaks the 
layout.

What the patch does is simply making sure that the minimumSizeHint is copied 
to minimumSize. This solves the issue as long as the embedded KCM doesn't 
change size hint later, but is obviously a hack, and works around Qt's 
automatic layouting a bit.

I've no idea how to fix it for real though and this is at least better than 
what we had. I'd almost say it's a Qt bug, but even that I cannot verify, 
there's way too much dynamics going on to distill an test case.

Comments? Suggestions? Should I commit this until we have a real fix? Or 
should we withhold this while waiting for the real fix?

-- 
Martijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kpluginselector.diff
Type: text/x-diff
Size: 596 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031130/fa7fe9df/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ws.cpp
Type: text/x-c++src
Size: 802 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031130/fa7fe9df/attachment.cpp>


More information about the kde-core-devel mailing list