<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">I've created a QTreeView and a QStandardItemModel.</span><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
Then I add several rows and replace the item in the second column with a combobox.</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
item = QStandardItem(text2)</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">model.appendRow([ QStandardItem(text1), item ])</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">cbx = QComboBox()</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">cbx.addItem("A")</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
cbx.addItem("B")</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">tvw.setIndexWidget(model.indexFromItem(item), cbx)</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">The problem is that the combobox doesn't show up. Instead text2 is shown.</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">What is wrong with this code?</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<br></div></div>