[Qt-interest] Focus on QLineEdit - sorry.. if its very easy.. I am a newbie in GUI programming
Cyril C
cyril.mailing.list at gmail.com
Mon Dec 28 19:53:07 CET 2009
Abhijeet Rastogi a écrit :
> Hi.. Suppose, I have
>
> QLineEdit *line1;
> QLineEdit *line2;
> QLineEdit *line3;
>
> If for instance, my cursor is on line1 and when i click on the text
> input area of line2, I want to run a custom slot. How do I accomplish
> that?
>
There are several ways to achieve that. To me, the easiest in your case
may be to connect the QApplication::focusChanged(QWidget *old, QWidget
*now) signal (see doc) to a custom slot that would check if the
arguments match one of your qlineedits.
More information about the Qt-interest-old
mailing list