I tried to use the Model View system to make it work, but it gave me more headaches than solutions.
QTableView::setModel is private so I couldn't make it work with the table I had.
Now it is working, what I've done? Filtered the QEvent::FocusIn to force the Cell selection, here goes the code:
@bool Dialog::eventFilter(QObject object, QEvent event)
{
if(object->isWidgetType() && event->type() == QEvent::FocusIn)
{
QWidget widget = qobject_cast<QWidget>(object);
if(widget)
{
ui->table->setCurrentCell(widget->pos().y() / 30, 0);
}
}
return false;
}@
I'm using that stupid way to select the cell because it was not working with "the proper way". The cells height are constant so a temporary solution for a short on time project.
I'm glad this is working, but I found what I've considered an error, maybe from Qt.
I created a topic to discuss it: "link":http://developer.qt.nokia.com/forums/viewthread/9323/.