darkadept
18th May 2006, 16:16
Hello everyone,
I have a QComboBox that is connected to a QSqlTableModel (via setModel). The combobox displays the items from the database just fine. I have the editable and autocomplete properties of the combobox set to true. I want the user to be able to either: 1) select an existing item from the list, 2) start typing and let the autocomplete select an existing item, and 3) add a new item if it doesn't already exist.
I've got 1) and 2) working but the adding of new items doesn't seem to work well. I know that the QComboBox is not a proper 'View' in Qt4, so maybe I'm not doing things right.
Thanks in advance for the help.
I have a QComboBox that is connected to a QSqlTableModel (via setModel). The combobox displays the items from the database just fine. I have the editable and autocomplete properties of the combobox set to true. I want the user to be able to either: 1) select an existing item from the list, 2) start typing and let the autocomplete select an existing item, and 3) add a new item if it doesn't already exist.
I've got 1) and 2) working but the adding of new items doesn't seem to work well. I know that the QComboBox is not a proper 'View' in Qt4, so maybe I'm not doing things right.
Thanks in advance for the help.