Hi, I am working on an application that uses a dialog box (WDialog) to show and add rows to / from a data base table. Depending on a previous selection the dialog box shows a different set of records from the table. The table“s records are presented using a WTableView widget that uses a WSortFilterProxyModel widget as data model that in turn it is based over a WStandardItemModel widget (this widget actually holds the table records, the WSortFilterProxyModel widget is only used to show the set of records corresponding to the current user's selection, using a filter over a specific column on the WStandardItemModel widget).
The problem arises when I try to add a new row (the data is added using a WStandardItem's setItem() method directly over the WStandardItemModel widget). If the dynamicSortFilter property is set to true, when the program loads the data corresponding to the filtered column it crashes with the following assertion failure message: "Expression: vector iterator + offset out of range". If the dynamicSortFilter property is set to false, everything flows fine but the WTableView widget does not show the new data until the dialog is closed and reopened. I would like ask for some advice regarding how to deal with those widgets: - It is ok to load data directly to the WStandardItemModel widget or the data must be loaded to the WSortFilterProxyModel widget? - Why does not seem possible to maintain automatic track on WStandardItemModel widget changes? (the program crashes if dynamicSortFilter is set to true) - In case that effectively it would not be possible to maintain automatic track on WStandardItemModel widget changes (dynamicSortFilter must be set to false to allow data adding to the model), Is there a method that forces WSortFilterProxyModel widget data refresh to reflect the last record(s) added to the WStandardItemModel widget? Thanks a lot. p.d. I am using Wt 3.20, Windows 7 and Visual C++ Express 2010 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
