Hi All,
I have encountered a small problem in QTableWiget.
I want to navigate through table widget created programatically on Windows.
Some of the items in table are non-editable and flags are set as
qTableWiget->setItem(row, column, item);
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
QTableWigetItem* item = new QTableWidgetItem(str);
qTableWiget->setItem(row, column, item);
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
To copy to clipboard, switch view to plain text mode
I have intialize the table item with default properties as gets set in designer.
qTableWiget->setTabKeyNavigation(true);
qTableWiget->setAutoScroll(true);
qTableWiget->setTabKeyNavigation(true);
qTableWiget->setAutoScroll(true);
qTableWiget->setHorizontalScrollMode(QAbstractItemView::ScrollPerItem);
qTableWiget->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
qTableWiget->setSelectionMode(QAbstractItemView::ExtendedSelection);
qTableWiget->setEditTriggers(QAbstractItemView::AnyKeyPressed |
QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
To copy to clipboard, switch view to plain text mode
When I clicked on any of the item, it gets selected.
But when I use arrow keys or tab key, no other item gets selected.
Please let me know your suggestions on it.
Bookmarks