I am trying to build a form for in Qt Designer for QGIS 2.14.6, Win 7, SQLite Database 3.14. My form is designed to add new work orders and I need to add many addresses to it through a child table that stores the PKey for each work order and the PKey for an address. The relationship is build in QGIS and it functions through the Identity tools. Can someone direct me to an example of how the QgsRelationReferenceWidget is setup from within a form?

  • QWat project use this element in a .ui : https://github.com/qwat/QWAT/blob/master/qgis-project/ui_forms/subscriber.ui and you have the api document https://qgis.org/api/classQgsRelationReferenceWidget.html#a5065f2c7bf41ce103f32734e1ed122d0 ,too – Fran Raga Sep 13 '16 at 10:52
  • This sort of helps, but I would need to completely build their database and database tables to their exact setup to know how it is working for sure. I think the object name needs to reflect the relationship id but it isn't working in my document. I also cannot find where, or how, they add the sub form to edit and store the child table relation. – Tyler Veinot Sep 13 '16 at 13:18
  • Using the QWat and, medspx.fr/blog/Qgis/better_qgis_forms_part_three, and blog.vitu.ch/10112013-1201/qgis-relations I managed to get the drop down for addresses but I can't seem to get it to write the wo_id into the child table to relate the work order to the address. I think I can get around this by adding a "save" button to the work order form thus saving the wo_id so that I can add it manually in the subform to create the relation but I can't seem to find a "save" button function or any code to create one online. – Tyler Veinot Sep 15 '16 at 16:04

Your Answer


Browse other questions tagged or ask your own question.