1

I have a custom form created with QT Designer on which I have several comboboxes among other stuff. All the fields have the correct names corresponding to the database.

But something weird and frustrating happens when I'm trying to use the form in QGIS. All the comboboxes except one, when I click on them, they display duplicate values of the original values I have designed them with. E.g if the combobox originally has the values 1,2 and 3, when I click on it, it displays 1,2,3,1,2,3 or 1,2,3,2,3 or 1,2,3,3,1 or some other combination of the existing values.

If I choose from the first tuple of the values (the original ones), nothing is stored in the database. If I choose a value from the duplicates it is correctly stored. The one combobox that displays only the correct values (no duplicates) doesn't store anything in the database. What's up with that?

1

First, create your combobox in Qt Designer without any values. Then save your form and join it to your layer in QGIS.

Now, in the properties of your layer, go to the Field tab. Here you can add values to your empty combobox: click on Text edit and change it to Value map. Add your values in the table displayed and click OK.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.