zack
14th July 2009, 12:50
I have a QCombox and in the combobo a TreeWidget
comboBox->setModel(treeWidget->model());
comboBox->setView(treeWidget);
Now I want to pre select an item in this treeWidget
treeWidget->scrollToItem (Item);
treeWidget->setCurrentItem(Item);
But for some reason, it doesn't select the Item.
In the combobox is still the first toplevelItem visible and when I click on the combobox he opens the correct toplevelitem, where Item is placed, but it's not selected.
Is it a bug, or am I on the wrong way?
comboBox->setModel(treeWidget->model());
comboBox->setView(treeWidget);
Now I want to pre select an item in this treeWidget
treeWidget->scrollToItem (Item);
treeWidget->setCurrentItem(Item);
But for some reason, it doesn't select the Item.
In the combobox is still the first toplevelItem visible and when I click on the combobox he opens the correct toplevelitem, where Item is placed, but it's not selected.
Is it a bug, or am I on the wrong way?