Answer the question
In order to leave comments, you need to log in
How to get a signal or at least something from qtablewidget when a cell is not selected?
Hello. There is a table. The user can click on it to select the desired field and get detailed information. It is necessary for me that when the user clicked past the field or into another field or button, receive a signal or at least something. I need to bind one button to it.
Answer the question
In order to leave comments, you need to log in
tblWidget->installEventFilter(this);
...
bool eventFilter(QObject *obj, QEvent *event)
{
if (obj == tblWidget&& event == QEvent::MouseButtonPress)
{
QMouseEvent *mouseEvent = static_cast(event);
if (!tblWidget->itemAt(mouseEvent->pos())) {
...
}
}
// standard event processing
return QObject::eventFilter(obj, event);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question