PDA

View Full Version : Displaying information in various windows



GAURAV PANT
25th March 2014, 10:58
Hi,
I have three windows A,B and C and some data is comming from library to display on these window. Now I want to display data on these windows and using some unique key or some other thing i have to determine in which window the data i have is displayed i.e whether the data is for Window A ,B or C.
How to achieve this.
Thanks

d_stranz
27th March 2014, 02:21
This doesn't sound like a Qt problem to me.

Since we have no idea what your "library data" is, we have to assume that there is some information in the data that determines where it should be displayed. So a Qt solution is to set up 3 signals (dataAvailableForA(), dataAvailableForB(), dataAvailableForC()) in the code that reads the data and implement a slot in each of windows A, B, and C (onDataAvailable()). Connect the appropriate signal to each window's slot (i.e. connect dataAvailableForA() to A's onDataAvailable() slot, etc.). In your code that determines what type of data you have, emit the appropriate signal, and the window that is listening for it will know that it has data to display.