How to connect focus event from QLineEdit?

后端 未结 2 1637
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 09:25

I have to connect focus event from some QLineEdit element (ui->lineEdit) to the method focus(). H

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 10:09

    I assume you mean connect as in signals/slots, focus event isn't a signal it's a virtual method you have to override in order to change the behavior:

    http://doc.qt.io/qt-5/qlineedit.html#focusInEvent

提交回复
热议问题