I added 2 interesting new features:
1. The model can now display an empty line (if the property is set - setShowEmptyLine(true)) as the last line. This gives the feeling of QxEntityEditor for when inputting a new row (item) in your table. I have only tested this with e_auto_update_on_field_change. The dirty line is marked with "*" in the vertical header (like in QSqlTableModel). If this is used with generated classes from QxEntityEditor - patches are needed in the generated code. See the bottom of:
http://www.qxorm.com/forum/phpbb/viewtopic.php?f=9&t=750
2. DragNDrop - available if dependency with QT_WIDGETS_LIB is enabled in the .pri. Supports internal moving around of items following the relationships of nested models. I built it implementing QUndoCommand, however I have not (yet) implemented any undo functionality. I might or might not add this in the future.
To use this mode of DragNDrop:
- Code: Select all
model->setAutoUpdateDatabase(IxModel::e_auto_update_on_field_change);
model->setOnlyDelRelations(true);
model->setDragDropMode(IxModel::e_drag_drop_relations, m_undo); //you need to provide an undo stack
I also added a drag and drop support mode (e_drag_drop_all) for the app to implement (e.g. in a proxy model). I use this mode for InternalMove of tables that need to be arranged by the user.
There are also a few patches to the code:
1. QxOrm.pro - fix output dir:
DESTDIR = $$PWD/lib/
2. QxOrm.pro - Performance String concat. Add QT_USE_QSTRINGBUILDER
3. IxModel.cpp - Fix IxModel::setHeaderData - using it with default role (Qt::EditRole) should change the header in a headerview (role Qt::DisplayRole).
4. IxModel.cpp - You have a field Description in QxEntityEditor for the properties. What this does is setDescription. This description never gets read afterwards. What I did is put this description (if present) as the default headerview column name. IxModel::headerData
5. removeRows for e_auto_update_on_field_change.
My App is ready for an alpha test phase by my colleagues, that will commence in a few weeks. This is when my extensions to QxOrm will get some real world testing as well. For now it is off my agenda. I will try to keep you posted, if we find bugs during the test phase. I only wish I could have added the RESELECT feature I mentioned here:
http://www.qxorm.com/forum/phpbb/viewtopic.php?f=2&t=752
I have an idea how to implement it, but it will need quite a few changes and it is not that important. Maybe you will suggest an easier solution.