Review Request: Convert libplasma to new qt4.4 technologies.

Dan Meltzer parallelgrapefruit at gmail.com
Fri Feb 29 20:59:25 CET 2008


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://mattr.info/r/187/
-----------------------------------------------------------

(Updated 2008-02-29 13:59:25.415370)


Review request for Plasma.


Summary
-------

This patch converts libplasma to use the new technologies found in Qt 4.4.  It does the following things:

1) Makes Plasma::Widget descend from QGraphicsWidget:  This change allows for a lot of code simplification, widget.cpp shrinks by about 200 lines after removing redundant code.  We cannot replace Plasma::Widget with QGraphicsWidget everywhere directly, as there still are some things in widget that we need.  This patch also removes Widget::expandingDirections in favor of using sizePolicies.

2) Removes Plasma::Layout and Plasma::LayoutItem:  These have been replaced by QGraphicsLayout and QGraphicsLayoutItem respectivly.  All layouts with the exception of boxlayout have been converted to use QGraphicsLayout.

3) Removes Boxlayout.  QGraphicsLinearLayout replaces BoxLayout at this time.  There are a few things that boxlayout had that QGraphicsLayout does not at this point, but they are not entirly important on a wide scale I do not believe.

4) Disables LayoutAnimator.  This is going to need to be ported to work with the new layouting concepts and classes.  When I last spoke with aseigo it sounded like LayoutAnimator needed some rethinking anyways, so I have just disabled it for now.

A few notes:  This patch is only the section of the patch applying to libplasma.  I have another equally big patch that I need to clean up that converts workspace/plasma.  I hope to post that in the next few days.  Also, there are some bugs either in my changes or in qt4.4 (I have not been able to determine which, and reguardless they appear in the applets part of the patch, not the libs.  There is an assert in qt code (found here) that happens after raising()/lowering() items on the panel a bunch.. or sometimes just a few times.

ASSERT: "ascent >= 0.0" in file graphicsview/qgridlayoutengine.cpp, line 82

Program received signal SIGABRT, Aborted.
[Switching to Thread -1256732960 (LWP 9192)]
0xb7eea7f2 in ?? () from /lib/ld-linux.so.2
(gdb)    bt
#0  0xb7eea7f2 in ?? () from /lib/ld-linux.so.2
#1  0xb6056875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb6058201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7090de8 in qt_message_output (msgType=QtFatalMsg, 
    buf=0xbff01670 "ASSERT: \"ascent >= 0.0\" in file graphicsview/qgridlayouten
gine.cpp, line 82") at global/qglobal.cpp:2051
#4  0xb7090e6d in qFatal (msg=0xb7205dc4 "ASSERT: \"%s\" in file %s, line %d")
    at global/qglobal.cpp:2253
#5  0xb7091309 in qt_assert (assertion=0xb6d6c53a "ascent >= 0.0", 
    file=0xb6d6c508 "graphicsview/qgridlayoutengine.cpp", line=82)
    at global/qglobal.cpp:1821
#6  0xb6cdabc3 in fixedDescent (descent=28, ascent=-1, targetSize=28)
    at graphicsview/qgridlayoutengine.cpp:82
#7  0xb6cdf7a3 in QGridLayoutRowData::calculateGeometries (this=0x8291cf4, 
    start=0, end=1, targetSize=28, positions=0x8315758, sizes=0x8315808, 
    descents=0x8315830, totalBox=@0x8291d30)
    at graphicsview/qgridlayoutengine.cpp:387
#8  0xb6ce015c in QGridLayoutEngine::ensureGeometries (this=0x8291c7c, 
    styleInfo=@0xbff049dc, size=@0xbff04940)
    at graphicsview/qgridlayoutengine.cpp:1397
#9  0xb6ce040b in QGridLayoutEngine::setGeometries (this=0x8291c7c, 
    styleInfo=@0xbff049dc, contentsGeometry=@0xbff049b8)
    at graphicsview/qgridlayoutengine.cpp:913
---Type <return> to continue, or q <return> to quit---
#10 0xb6cd1216 in QGraphicsLinearLayout::setGeometry (this=0x82bd6e0, 
    rect=@0xbff04a58) at graphicsview/qgraphicslinearlayout.cpp:483
#11 0xb6ccdedf in QGraphicsLayout::activate (this=0x82bd6e0)
    at graphicsview/qgraphicslayout.cpp:234
#12 0xb6ccdfa1 in QGraphicsLayout::widgetEvent (this=0x82bd6e0, e=0x86d9340)
    at graphicsview/qgraphicslayout.cpp:295
#13 0xb6cd23e1 in QGraphicsWidget::event (this=0x8171dd0, event=0x86d9340)
    at graphicsview/qgraphicswidget.cpp:1065
#14 0xb662f257 in QApplicationPrivate::notify_helper (this=0x8078480, 
    receiver=0x8171dd0, e=0x86d9340) at kernel/qapplication.cpp:3761
#15 0xb662f549 in QApplication::notify (this=0x8072c30, receiver=0x8171dd0, 
    e=0x86d9340) at kernel/qapplication.cpp:3355
#16 0xb786530f in KApplication::notify (this=0x8072c30, receiver=0x8171dd0, 
    event=0x86d9340)
    at /home/hydrogen/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:311
#17 0xb71a5d3b in QCoreApplication::notifyInternal (this=0x8072c30, 
    receiver=0x8171dd0, event=0x86d9340) at kernel/qcoreapplication.cpp:586
#18 0xb71a9f09 in QCoreApplication::sendEvent (receiver=0x8171dd0, 
    event=0x86d9340)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#19 0xb71a62dc in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, 
    event_type=0, data=0x804bbf0) at kernel/qcoreapplication.cpp:1191
#20 0xb71a6551 in QCoreApplication::sendPostedEvents (receiver=0x0, 
---Type <return> to continue, or q <return> to quit---
    event_type=0) at kernel/qcoreapplication.cpp:1084
#21 0xb71dba4e in QCoreApplication::sendPostedEvents ()
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#22 0xb71da903 in postEventSourceDispatch (s=0x807a8a0)
    at kernel/qeventdispatcher_glib.cpp:211
#23 0xb5e3f11c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0xb5e4255f in ?? () from /usr/lib/libglib-2.0.so.0


In addition, items on the taskbar grow every time setText() is called on them, not sure if this is related or not.


The request here is for review of the idea and changes made, with the understanding that there may be more review necessary once the second part of the changes get posted.


Diffs
-----

  trunk/KDE/kdebase/workspace/libs/plasma/CMakeLists.txt
  trunk/KDE/kdebase/workspace/libs/plasma/applet.h
  trunk/KDE/kdebase/workspace/libs/plasma/applet.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/containment.h
  trunk/KDE/kdebase/workspace/libs/plasma/containment.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/corona.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/borderlayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/borderlayout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/boxlayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/boxlayout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/fliplayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/flowlayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/flowlayout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/freelayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/freelayout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/layout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/layout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/layoutitem.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/layoutitem.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/nodelayout.h
  trunk/KDE/kdebase/workspace/libs/plasma/layouts/nodelayout.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/uiloader.h
  trunk/KDE/kdebase/workspace/libs/plasma/uiloader.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/label.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/label.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/lineedit.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/lineedit.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/meter.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/meter.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/progressbar.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/progressbar.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/pushbutton.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/pushbutton.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/rectangle.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/rectangle.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/signalplotter.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/signalplotter.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/tests/testLayouts.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/tests/testProgressBar.cpp
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.h
  trunk/KDE/kdebase/workspace/libs/plasma/widgets/widget.cpp

Diff: http://mattr.info/r/187/diff


Testing
-------

Been using this patch for the past few days. There are still a number of crashes in what appears to be qt4.4 code, but these changes seem sound.


Thanks,

Dan



More information about the Panel-devel mailing list