From b8e16c3bddb706ecc195e86eaafb89ed90f9bfc3 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 24 Feb 2012 20:35:27 +0100 Subject: Implement MappingTreeWidget This is a rather large commit. It implements MappingTreeWidget using MappingTreeModel unsurprisingly this uncovered some exciting bugs. Fixes the following bugs in MappingTreeModel: * use insertRows() and removeRows() when addings children, because dataChanged() won't do it. * don't use a prepared QSqlQuery when fetching children recursively. This won't work because the query is still active when we invoke ourselves again. Put the query on the stack instead * Keep the model sorted. Also add an entry for a MappingTreeEditor to the File-Menu. --- mappingtreemodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mappingtreemodel.h') diff --git a/mappingtreemodel.h b/mappingtreemodel.h index a18ce57..451ab83 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -52,10 +52,10 @@ class MappingTreeModel : public SmTreeModel { }; void getMappingTypes(); void getChildrenRecursive(SmTreeItem *item); + int lowerBound(SmTreeItem *item, const QVariant &value, int column = 0) const; QSqlDatabase mDb; QSqlQuery *mTypesQ; QSqlQuery *mTypeParentsQ; - QSqlQuery *mChildrenQ; QSqlQuery *mUpdateTypeQ; QSqlQuery *mUpdateChildQ; QSqlQuery *mAddMappingTypeQ; -- cgit v1.2.3-70-g09d2