PDA

View Full Version : Communication Help Pls



munna
25th May 2006, 13:15
Hi,

I have a QListWidget which is a child of some widget. This "some" widget is inturn the child of a QSplitter which is the child of QMainWindow.

Now, When QListWidget is focused, One of the Menu Items of the application should change.

Which is the best way to communicate to the Application Window that the ListWidget is focused in or out.

Currently my focusInEvent and focusOutEvent emit a signal which is connected to a slot in its parent which in turn emits a signal to a slot in its parent and finally to the mainwindow.

Is it a good way ?

Thanks a lot.

wysota
25th May 2006, 14:22
Yes, it's fine. Alternatively you could connect to QApplication signal focusChanged() and in the slot check if the widget receiving or losing focus is the listwidget and act upon it.