Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.3, 5.0.1
-
Qt 5: a18e3a3ceff970250498b38ec85ae43c67b7993f
Description
Steps to reproduce using the app below:
- Select any of these cells: (2, 0), (3, 0), (3, 1)
- Navigate to cell containing the span (1, 1) with either the directional keys or tab/backtab (using the mouse does not reproduce the bug).
- Edit the cell's contents - they won't change after confirming the changes.
Seems to be caused by a cell below/to the side of the cell at (1, 1) being selected before editing it.
#include <QApplication> #include <QHeaderView> #include <QStandardItemModel> #include <QTableView> int main(int argc, char *argv[]) { QApplication app(argc, argv); QStandardItemModel model(4, 2); QTableView tableView; tableView.setModel(&model); tableView.horizontalHeader()->setStretchLastSection(true); for (int row = 0; row < 4; ++row) { for (int column = 0; column < 2; ++column) { QModelIndex index = model.index(row, column, QModelIndex()); model.setData(index, QVariant(QString("%1,%2").arg(row).arg(column))); } } tableView.setSpan(1, 1, 2, 1); // Problem. tableView.show(); return app.exec(); }