I
I
Ilnur2017-09-24 20:45:24
Qt
Ilnur, 2017-09-24 20:45:24

How to pass data from one subclass to another subclass?

Let:
Devices, Devices1, Devices2, Plot classes
Was:
Using MainWindow I receive data from the device using the Devices class
and using MainWindow I send them to Plot
I want to do this:
I declare the classes Devices1, Devices2, Plot in MainWindow
Then using MainWindow " I run "Devices1, Devices2, which send data to Plot
This is how I want to implement it:
I declare the classes Devices1, Devices2, Plot in MainWindow
Using MainWindow, I get pointers to variables in Plot
These pointers are sent to Devices1, Devices2.
They, in turn, poll the devices and send this data through pointers.
Plot draws these points every n seconds.
Question:
Is there any other way to transfer data from Devices1, Devices2 to Plot?
Important:
So that all this happens as quickly as possible (and at the same time correctly).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-09-24
@Il_noor

If Qt - then signals and slots. Fast, thread safe and no polling every "n sec".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question