How to get Click Event of QLineEdit
in Qt ?
I am not able to see any SLOT related to click in QLineEdit
?
I don't think subclassing a QLineEdit is the right choice. Why subclass if you don't need to? You could instead use event filters. Check out QObject::eventFilter.
Example:
MyClass::MyClass() :
edit(new QLineEdit(this))
{
edit->installEventFilter(this);
}
bool MyClass::eventFilter(QObject* object, QEvent* event)
{
if(object == edit && event->type() == QEvent::FocusIn) {
// bring up your custom edit
return false; // lets the event continue to the edit
}
return false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With