I try to do something like this (original code was written in Python, so may be it has some syntax errors):
MyModel *groupModel = new MyModel()
cb->setView(&tvGroups)
cb->setModel(&groupModel)
cb->setModelColumn(0)
QTreeView *tvGroups = new QTreeView()
MyModel *groupModel = new MyModel()
cb->setView(&tvGroups)
cb->setModel(&groupModel)
cb->setModelColumn(0)
To copy to clipboard, switch view to plain text mode
cb is QComboBox.
After it usual integer combobox indexes become very strange.
In function which is connected to signal setCurrentIndex(int index) I print index and see that it has value -1 for items group2 and something_else, and 0 for others in the tree example below.
tree has such items:
All
group1
group1.1
group1.2
group2
something_else
All
group1
group1.1
group1.2
group2
something_else
To copy to clipboard, switch view to plain text mode
What is wrong?
Bookmarks