-1

There is no signal as clicked for QlineEdit.

connect(w,SIGNAL(clicked()),this,SLOT());
m7913d
  • 10,244
  • 7
  • 28
  • 56
Satyam_jay
  • 149
  • 1
  • 9
  • Have you looked at [`focusInEvent`](http://doc.qt.io/qt-5/qlineedit.html#focusInEvent)? – m7913d Jun 20 '17 at 14:19
  • how does that work?Can u please elaborate i am amateur. – Satyam_jay Jun 20 '17 at 14:41
  • Concerning `focusInEvent`, see [Event System](http://doc.qt.io/qt-5/eventsandfilters.html) for more information. An alternative is to use the [`textEdited`](http://doc.qt.io/qt-5/qlineedit.html#textEdited) or [`textChanged`](http://doc.qt.io/qt-5/qlineedit.html#textChanged) signals depending on what you really want. – m7913d Jun 20 '17 at 14:52
  • 1
    lets start with explanation what you need to achieve. – Marek R Jun 20 '17 at 15:12
  • Take a look at this question and the accepted answer https://stackoverflow.com/questions/6452077/how-to-get-click-event-of-qlineedit-in-qt – Ramez Jun 20 '17 at 15:25
  • Possible duplicate of [How to get Click Event of QLineEdit in QT?](https://stackoverflow.com/questions/6452077/how-to-get-click-event-of-qlineedit-in-qt) – eyllanesc Jun 20 '17 at 15:48

1 Answers1

1

There is no such signal in Qt widgets. You need to derive QLineEdit class and implement void QLineEdit::mouseReleaseEvent(QMouseEvent *e), like this:

class MyLineEdit public QLineEdit {
...
virtual void mouseReleaseEvent(QMouseEvent *e) { emit clicked(); }

signals:
void clicked();
}

Later, you can promote QLineEdit in graphical editor to MyLineEdit class.

vanderdill
  • 162
  • 2
  • 14