@gserm I have a workaround that might work for you, I used an eventFilter, and enabled auto scrolling on key press, and disabled it on key release. here's how I did it:
main.cpp
#include <QApplication>
#include <QTableWidget>
#include <QComboBox>
#include <QObject>
#include <QEvent>
#include "myEventFilter.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qApp->setStyleSheet(
"QComboBox{background: yellow;}"
"QTableView::item:hover{color: red;}"
);
auto rows = 100;
auto cols = 5;
auto table = new QTableWidget(rows, cols);
for(auto i = 0; i != rows; ++i)
{
for(auto j = 0; j != cols; ++j)
{
if(j == 0)
{
auto item = new QTableWidgetItem("hello");
table->setItem(i, j, item);
}
else
{
auto cb = new QComboBox();
cb->addItems(QStringList() << "Item1" << "Item2");
table->setCellWidget(i, j, cb);
}
}
}
table->setMinimumSize(800,600);
table->setAutoScroll(false);
myEventFilter *filter = new myEventFilter();
table->installEventFilter(filter);
filter->t=table;
table->show();
return a.exec();
}
myEventFilter.h
#ifndef MYEVENTFILTER_H
#define MYEVENTFILTER_H
#include <QObject>
#include <QEvent>
#include <QTableWidget>
class myEventFilter : public QObject
{
Q_OBJECT
public:
myEventFilter (QObject *parent = nullptr) {};
QTableWidget *t;
protected:
bool eventFilter(QObject *obj, QEvent *event) override
{
if(event->type() == QEvent::KeyPress)
{
t->setAutoScroll(true);
}
if(event->type() == QEvent::KeyRelease)
{
t->setAutoScroll(false);
}
return QObject::eventFilter(obj,event);
};
};
#endif // MYEVENTFILTER_H