Hello to all,
I've a simple situation that bring me to ask your help for a stupid (I hope) problem.
I tried to look for the internet but... no way
This is the case: I'm trying to create a program to fill an administrative document (i.e. an envoice).
I have an header and some details into two different tables. My problem is on the header; it contain also the CodForn field that is the foreign key of a Fornitori (suppliers) table.
OK I've create my QDataWidgetMapper and create a QSqlRealtionalTable model to map all my widget to the header table.
Now, the problem is that I need to map all Fornitori fields so that if my supplier exists the user find it into the table, if it not exist, the user can insert the data by that 3 fields. To got this, i create an other QDataWidgetMapper to map Fornitori table, and using the ManualSubmit I save the data of fornitori before save the header data.
I thought I could be simple but... the submit() return true but fornitori info not created
I attach my code, I'm testing it by update an existing element (so using currentIndex of mapper to select data of header table) changing the supplier information. Have you any ideas about where is my mistake??
Thanks a lot for your time.
Michelel
tstrda.ui
tstrda.cpp
tstrda.h
Bookmarks