vvim / BT_deelnemers

First try out for the Buurtijd software project
0 stars 0 forks source link

what if we have a table with only 2 rows, but the id's are "0" and "7" ?? #16

Open vvim opened 7 years ago

vvim commented 7 years ago

see 83745cd8378b08a511217eada5d7d62cc2e31ad7

We base the QComboBox on a table in the database. If the ids are not consistent 0 -> x, we will run in a problem.

p.e.:

 table[0] = item1
 table[7] = item2
 table[8] = item3

will give a combobox with

  0 -> "item1"
  1 -> ""
  2 -> ""

in the current code ( 83745cd8378b08a511217eada5d7d62cc2e31ad7 ) instead of the preferred:

  0 -> "item1"
  7 -> "item2"
  8 -> "item3"

I tried to solve it with a QMap as in c1394fb65c4816ba885e7ce3aae8108e19c74473 , but this gave me difficulties constructing the QComboBox.

Still, I believe we have to tackle this problem and a QMap might still be the answer