hi. i have 2 classes A and B. B is subclass into the A. B needs to access to the A members and functions. how could i do this in Qt?
hi. i have 2 classes A and B. B is subclass into the A. B needs to access to the A members and functions. how could i do this in Qt?
This has nothing to do with Qt. If you are writing in C++, it is a C++ question and you should look up C++ inheritance.
If what you are asking is this kind of subclassing:
Qt Code:
class B { // ... }; class A : public B { // ... };To copy to clipboard, switch view to plain text mode
and you mean B needs to know about methods that are defined only in A, then how is this supposed to work? If you create an instance of class B and try to cast it to "A" and use A methods, your code will probably crash when you try to call A methods because an instance of B is not an instance of A even if you force the code to treat it that way.
Maybe you should show some of your code where you are trying to do what you want, because the way I understand your question it doesn't make any sense.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
QJak (2nd May 2018)
QJak (2nd May 2018)
thanks
I need to do 3 works toghether in the same time:
1- first thread does processing on gived data and showing results with GUI
2- second thread does logging (saving above data into a file)
3- third thread does waiting every 10 second and then sending a byte to GUI of the first thread for showing
please help me to do this work
thanks
I think you only need two threads: main (with GUI) and worker. Worker process data, logs them to the file and sends data to GUI with signals and slots. Sending data to GUI is activated with QTimer::timeout signal with 10s period.
QJak (2nd May 2018)
thanks
before i did this by using signal and slot. but when i send a signal to two slots, the slots not working in paralell procces and first one of these slots works and after finishing this slot, the other slot starts. but i need the two slots work paralel (like thread)
How do slots work in parallel if they are in one thread? If they must work in parallel then they must be in separate threads.
QJak (2nd May 2018)
Bookmarks