Patch for Lancelot to work with Qt 4.5 (for packagers and distributions)
Hi all. This post is mostly intended for packagers and distributions. If you are a Lancelot user, and your distribution ships it unpatched with Qt 4.5, thus rendering it rather unusable, contact your distro and pass the link to this post.
Thanks to the Gentoo guys Markos Chandras and Robert Piasek there now exists a patch for Lancelot, the KDE 4.2 branch, which makes it work with Qt 4.5 (and 4.4.4 I guess) the way it was supposed to, and the way the trunk version works now. It does need testing, but that is what packagers are for
The patch can be found in this Gentoo bug report:
or you can use the direct link to the patch:
http://bugs.gentoo.org/attachment.cgi?id=182135
Cheerio!
















Mmmmm the patch is very hackish. I am very surprised that you need to do that with 4.5.0. In many plasma applets, we are removing hacks and you need new ones. My point is : were you able to reproduce the problem in a pure Qt app? And more did you report that to Qt Software? I prefer a proper patch in qt-copy which means 4.5.x than a patch directly in the applet which perhaps won’t work with 4.5.1. If you provide me the test case i will be glad to look at it and instead you will be able to point a proper qt-copy patch
.
Comment by Alexis Menard — 9 March 2009 @ 22:34
@Alexis Menard: (replied via mail also) If you’re referring to the move off-screen instead of hiding, I’ve reported a bug (http://www.qtsoftware.com/developer/task-tracker/index_html?id=244902&method=entry) with the example code. The bug was marked later as a duplicate, so I have no idea about the progress of it.
BTW, it isn’t really a new hack, I had the issue in question since the QGraphcisView was introduced, it was just bypassed in a different way before. A way that introduced some bugs, so I had it removed.
About the other, less dirty, hacks, I haven’t really got the time to isolate the problems, but will eventually.
Comment by Ivan Čukić — 9 March 2009 @ 23:00
For the hiding issue i have to say that is not implemented
, so that explain why the layout is not really updated. We have one report for that (before yours i guess so that explain the duplicate).
My idea to bypass this issue is :
- remove the item from the layout when the widget become invisible. and re-add it afterwards.
- reimplement QSizeF QGraphicsLayoutItem::sizeHint and return 0,0 if the item become invisible (invalidate the layout to force an update of sizehints). This should be more cleaner and more reliable for the future.
That is just two ideas coming in my mind tonight
.
Comment by Alexis Menard — 9 March 2009 @ 23:11
@Alexis Menard: Well, I really hope it will not be needed to have something ‘more reliable for the future’ and that the issue in Qt will go away
Both solutions you’ve proposed appear to be OK, but since I’m not planing to /proclaim/ liblancelot as stable any time soon, I don’t think it really matters. That is, if the bug in Qt gets fixed soon.
Comment by Ivan Čukić — 9 March 2009 @ 23:36
What’s the effect of this patch with Qt 4.4.3? I’m asking because that decides whether we can apply this to all Fedora branches right now or need to wait for the flag day on which we push the Qt 4.5 update.
Comment by Kevin Kofler — 13 March 2009 @ 10:48
@Kevin Kofler: I haven’t tested it, which is the main reason the patch is not in the SVN (the 4.2 branch).
So, if I were you, I’d wait for the /push/
Comment by Ivan Čukić — 13 March 2009 @ 11:01