Qt 6.11 is out! See what's new in the release
blog
QEvent not triggered
-
I want to listen focus in/out events of qlineedit on my ui. I tried eventfilter:
bool MainWidget::eventFilter(QObject* object, QEvent* event) { if(object == ui->lineEditTop && event->type() == QEvent::FocusIn) { qDebug() << "IN"; return false; } if(object == ui->lineEditTop && event->type() == QEvent::FocusOut) { qDebug() << "OUT"; return false; } return false; }on constructor:
setFocusPolicy(Qt::StrongFocus); installEventFilter(this);In this way if blocks never executed. If i remove object == ui->lineEditTop from condition, if blocks runs when i am clicking ui except lineedit. Any idea what is wrong with code?