PDA

View Full Version : Selected window



bunjee
25th October 2007, 13:59
Hello,

I want to know when a windows is selected in my QT apps.

I tried : virtual void focusInEvent ( QFocusEvent * event ) without success, since it only concerns the inside of the window.

I tried : connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget *)),
this, SLOT(onFocusChanged(QWidget *, QWidget *)));

But I'm not satisfied with that solution since I get an update for every focus event.

Any idea?

jpn
25th October 2007, 14:03
Try catching QEvent::ActivationChange (http://doc.trolltech.com/latest/qevent.html#Type-enum) in QWidget::changeEvent().