Revision 829403

Go back to digest for 13th July 2008

Other in Office

Thomas Zander committed changes in /trunk/koffice:

Refactor to make this work propertly :)

The KoChartModel now is a QObject as qobject_cast is the only thing that works in this case. The problem is that KoChartModel is not a class in a shared-library, but a class compiled into each using-application.

See <a href="http://techbase.kde.org/Development/Tutorials/Common_Programming_Mistakes#dynamic_cast">http://techbase.kde.org/Development/Tutorials/Common_Programming_Mistakes#dynamic_cast</a>;

The problem we had is that KSpread wanted to use QAbstractTableModel but kchart wants to use the extra implementation of QStandardItemModel. So the change has to be from 'is a' to 'has a' model.
The effective changes are not that big; kspread now has a new class (oddly named) that is the model in Binding_p.h and kchart simply has a QStandardItemModel member.

I suggest someone come up with some better naming now since KoChartModel for a class that owns a model, but is not a model might be confusing ;)

File Changes

Added 1 files
  • /trunk/koffice/kspread/Binding_p.h
Modified 6 files
  • /trunk/koffice
  •   /interfaces/KoChartModel.cpp
  •   /interfaces/KoChartModel.h
  •   /kspread/Binding.cpp
  •   /kspread/Binding.h
  •   /kchart/shape/TableModel.cpp
  •   /kchart/shape/TableModel.h
7 files changed in total