[Qt-interest] QSqlRelationalTableModel/QTableView delegate functions for row navigation

Harry Sfougaris hsfougaris at gmail.com
Sun Apr 25 19:48:25 CEST 2010


I would like to know if the user is trying to move to another row.
If the data is not valid, i want to be able to either force him to fix it, or cancel the edits. The events i have found (and the one you mention) don't seem to give you the ability to disallow moving to another row.

Thanks

Harry Sfougaris

Sent from my iPhone

On 25 Απρ 2010, at 20:35, Jan <janusius at gmx.net> wrote:

> I am not sure if I get exactly what you are looking for:
> 
> I could subclass the delegate and do your validation inside of 
> setModelData() (not sure if its the exact name) function.
> 
> Jan
> 
> Am 25.04.2010 18:04, schrieb Harry Sfougaris:
>> I would like to have a QTableView with a model set to a QSqlRelationalTableMode and a manual submit policy, where I handle when the data is submitted to the server.
>> So after using code like:
>>     myModel->insertRow(row);
>>     QModelIndex index = myModel->index(row, MyFld1);
>>     myVw->setCurrentIndex(index);
>>     myVw->edit(index)
>> I need to know when the current row is about to change, so I may do my validations and call submitAll.
>> I know of the currentRowChanged signal of QTableView, but is there something like a delegate function that can be hooked  (like shouldChangeCurrentRow), where I can control what happens navigations away from the currently edited row?
>> Thanks,
>> Harry Sfougaris
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list