Hi,
I have an issue with moving next cell in a QTableView by pressing Key_Return. In some cases like a cell has dropdown list box as its item and from that cell if i press Enter/Return key it throws a exception while exetuing this->setCurrentIndex(Index).
this refers to a object of QTableView
and Index refers to a QModelIndex.
The exception is
ASSERT: "VisualRow != -1" in file itemviews\qtableview.cpp line 932. (I am using Qt 4.4).
sample code segment
{
const QModelIndex
& Index
= this
->moveCursor
(QAbstractItemView::MoveNext, Qt
::KeypadModifier);
if(Index.isValid())
this->setCurrentIndex(Index);
}
{
const QModelIndex& Index = this->moveCursor(QAbstractItemView::MoveNext, Qt::KeypadModifier);
if(Index.isValid())
this->setCurrentIndex(Index);
}
To copy to clipboard, switch view to plain text mode
the problem only occurs if the current cell itself has a ComboBox or other QWidgets
Please share your ideas to solve ths issue.
Bookmarks