How to add a widget in a QTableView?
Unsolved
General and Desktop
-
I'm developing a software for trading, and in the shopping cart I'm trying to add a QDoubleSpenBox in each cell of a column so I can provide a way to change the amount of items in the cart
int row = modeloTabela->rowCount(); QDoubleSpinBox *dsbQuantidade = new QDoubleSpinBox(); dsbQuantidade->setMaximum(produto.quantidadeDouble()); ui->tvCarrinho->setIndexWidget(modeloTabela->index(0, 2), dsbQuantidade);
But nothing happens
![alt text]( image url)
-
Hi,
Why set a widget ? You should take a look at the Spin Box Delegate Example. It will likely be what you are looking for.