Reputation: 1739
I have at QComboBox some items (added by program - it is a lot added items (about 1000))
So i make combobox editable -> then it is simple to find a correct item. (For example if i want to find item called "My Example" i write in combobox "MY" and i get items which starts from "MY" )
But when i write somethink other than it is in combobox, combobox add this item.
I dont want it, i want only to:
And press push button to accept my choice - then how to check that i choice item from items added by Program not written and not finished by User?
Upvotes: 3
Views: 2651
Reputation: 4354
Set these QComboBox properties to the following:
1. Set setEditable
to true
.
2. Set insertPolicy
to NoInsert
.
3. Set currentIndex
to -1
to make it empty at start.
Then process currentIndexChanged
signal which will be sent only when a certain item from the list is chosen.
Upvotes: 7