Update: A custom INSERT call with QSqlQuery works in the subclass, but I didn't find out why the insertRows() function doesn't work as expected.
Best Regards
Best Regards
Am 30. Mai 2012 um 20:47 schrieb noru...@me.com:
Hello,
I have two tables (products, customers).
In the subclass of the QSqlRelationalTableModel (customers) i set up the relations.
In the view i use a QSqlRelationalDelegate to get a combobox with the products.
Now, if i add a new product, then I see the product in the combobox.
But if I add a customer, then the new row (insertRows(rowCount(), 1);) isn't added to the database, but the insertRows() function returns true.
I think that the constraint is violated, but I didn't get any errors with lastError().
Did I need to refresh the relations or something else after I add a product, so that the QSqlRelationalTableModel has the new/updated keys?
Thanks in advance
Best Regards
NoRulez
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest