Code transitions - Theme transitions

Peter Penz peter.penz at gmx.at
Sun Nov 23 10:37:13 GMT 2008


Hi,

On Monday, 17. November 2008 08:48:26 Rafael Fernández López wrote:
> Hi all,
>
> I am pretty sure you remember the class Mathias Kretz did start for widget
> transitions: KFadeWidgetEffect. It had serious performance problems that
> were fixed later by me, fully basing the code on the work done by Fredrik
> Höglund on KFileItemDelegate.
[...]
>
> I ask this mainly because I have read on IRC that QTreeView::setAnimated()
> seems to work fine and is nice. I was tempted to write the attached patch,
> and later I wondered: "should this be really done by kstyle?".

Sorry for jumping in so late into this discussion, but since a few days the 
Oxygen style activates QTreeView::setAnimated(true) and I could see some side 
effects:

* Sometimes trees reopen themselves animated although the number of nodes did 
not change at all. This can be reproduced e. g. in KMail when adjusting the 
size of the of the Folder panel (context menu on header -> adjust Icon Size).

* I faced a crash (see [2]) in Kate that is related to the treeview animation.

* There is an issue in QTreeView (QTreeViewPrivate::renderTreeToPixmap()  - 
see [1]), which leads to a nasty flickering when a tree view widget disabled 
the autofilling of the background (QWidget::setAutoFillBackground(true)). The 
disabling of the background is e. g. necessary in Dolphin, where the treeview 
is drawn in the Oxygen-gradiented dock. I bypassed this issue temporary in 
Dolphin by invoking QTreeView::setAnimated(false) again explicitly when 
receiving the show event, but I don't think that is a final solution.

It should not be too tricky to fix this Qt-issue in 
QTreeViewPrivate:renderTreeToPixmap(), but I'm not sure about the policy how 
we should proceed here: Is it assured that if we provide a patch for Qt that 
distributions will apply this patch too?

From my personal point of view it might be more safe to disable the QTreeView 
animation in the Oxygen style for KDE 4.2 and assure that we fix this in a 
clean way for KDE 4.3.

Any thoughts?

Best regards,
Peter

[1] In QTreeViewPrivate::renderTreeToPixmap() the background of the pixmap is 
filled by q->palette().base(). But it is required that the pixmap provides an 
alpha channel if the autofilling of the background has been disabled.

[2]
#10 0xb721b8e7 in qFatal (msg=0xb736735c "ASSERT failure in %s: \"%s\", file 
%s, line %d") at global/qglobal.cpp:2260
#11 0xb721b92c in qt_assert_x (where=0xb6fecc4a "QVector<T>::at", 
what=0xb6fecc37 "index out of range", file=0xb6fecc00 
"../../include/QtCore/../../src/corelib/tools/qvector.h", line=323)
    at global/qglobal.cpp:1836
#12 0xb6eb95a3 in QVector<QTreeViewItem>::at (this=0x8d22e88, i=1) at 
../../include/QtCore/../../src/corelib/tools/qvector.h:323
#13 0xb6eaa7af in QTreeViewPrivate::_q_endAnimatedOperation (this=0x8d22c30) 
at itemviews/qtreeview.cpp:2900
#14 0xb6eb7376 in QTreeView::qt_metacall (this=0x8d22c08, 
_c=QMetaObject::InvokeMetaMethod, _id=18, _a=0xbf9c05a4) at .moc/debug-
shared/moc_qtreeview.cpp:144
#15 0xb4444f54 in KateCompletionTree::qt_metacall (this=0x8d22c08, 
_c=QMetaObject::InvokeMetaMethod, _id=86, _a=0xbf9c05a4) at 
/home/kde4peter/kde/build/KDE/kdelibs/kate/katecompletiontree.moc:60
#16 0xb73288e8 in QMetaObject::activate (sender=0x8d22e6c, 
from_signal_index=7, to_signal_index=7, argv=0x0) at kernel/qobject.cpp:3007
#17 0xb7328d75 in QMetaObject::activate (sender=0x8d22e6c, m=0xb73bff14, 
local_signal_index=3, argv=0x0) at kernel/qobject.cpp:3080
#18 0xb7363fa1 in QTimeLine::finished (this=0x8d22e6c) at .moc/debug-
shared/moc_qtimeline.cpp:169
#19 0xb727aeaf in QTimeLinePrivate::setCurrentTime (this=0x8d22f08, msecs=277) 
at tools/qtimeline.cpp:177
#20 0xb727af3b in QTimeLine::timerEvent (this=0x8d22e6c, event=0xbf9c0be4) at 
tools/qtimeline.cpp:761
#21 0xb7326be0 in QObject::event (this=0x8d22e6c, e=0xbf9c0be4) at 
kernel/qobject.cpp:1105
#22 0xb6982389 in QApplicationPrivate::notify_helper (this=0x805acc8, 
receiver=0x8d22e6c, e=0xbf9c0be4) at kernel/qapplication.cpp:3772
#23 0xb698269e in QApplication::notify (this=0xbf9c0e9c, receiver=0x8d22e6c, 
e=0xbf9c0be4) at kernel/qapplication.cpp:3366
#24 0xb77efcdf in KApplication::notify (this=0xbf9c0e9c, receiver=0x8d22e6c, 
event=0xbf9c0be4) at 
/home/kde4peter/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307
#25 0xb73142e7 in QCoreApplication::notifyInternal (this=0xbf9c0e9c, 
receiver=0x8d22e6c, event=0xbf9c0be4) at kernel/qcoreapplication.cpp:583
#26 0xb7d251a1 in QCoreApplication::sendEvent (receiver=0x8d22e6c, 
event=0xbf9c0be4) at 
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#27 0xb7345253 in QTimerInfoList::activateTimers (this=0x805df2c) at 
kernel/qeventdispatcher_unix.cpp:563
#28 0xb7342c00 in timerSourceDispatch (source=0x805def8) at 
kernel/qeventdispatcher_glib.cpp:166
#29 0xb61b82d9 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#30 0xb61bb85b in ?? () from /usr/lib/libglib-2.0.so.0
#31 0xb61bb9d8 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#32 0xb7341f32 in QEventDispatcherGlib::processEvents (this=0x8057f60, 
flags={i = -1080291992}) at kernel/qeventdispatcher_glib.cpp:325
#33 0xb6a261fc in QGuiEventDispatcherGlib::processEvents (this=0x8057f60, 
flags={i = -1080291944}) at kernel/qguieventdispatcher_glib.cpp:204
#34 0xb7311308 in QEventLoop::processEvents (this=0xbf9c0e10, flags={i = 
-1080291884}) at kernel/qeventloop.cpp:149
#35 0xb7311545 in QEventLoop::exec (this=0xbf9c0e10, flags={i = -1080291816}) 
at kernel/qeventloop.cpp:196
#36 0xb7314ae3 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:845
#37 0xb69820a2 in QApplication::exec () at kernel/qapplication.cpp:3304
#38 0xb80a1386 in kdemain (argc=1, argv=0xbf9c1454) at 
/home/kde4peter/kde/src/KDE/kdesdk/kate/app/katemain.cpp:250
#39 0x08048726 in main (argc=) at 
/home/kde4peter/kde/build/KDE/kdesdk/kate/app/kate_dummy.cpp:3





More information about the kde-core-devel mailing list