V
V
Vadim kyklaed2017-10-20 08:14:16
Qt
Vadim kyklaed, 2017-10-20 08:14:16

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

1 answer(s)
K
Katerina, 2017-10-20
@kyklaed

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 question

Ask a Question

731 491 924 answers to any question