I am having a hard time understanding the concept of sharing anything between members of a class, especially when the member is another class.
The C++ tool I am using does not support inheritance and my task is to pass data between members.
My specific question is :
it looks as I need to replace default null pointer and pass a "this" pointer starting with an "new" instance of the primary class.
In my case
MainWindow_Bluetooth *MWBT = new MainWindow_Bluetooth(this);
MainWindow_Bluetooth::MainWindow_Bluetooth(QWidget *parent) :
QMainWindow(parent),
m_ui(new Ui::MainWindow_Bluetooth),
m_status(new QLabel),
m_console(new Console),
m_mdiarea(new QMdiArea(parent)),
m_settings(new SettingsDialog(parent)),
m_serial(new QSerialPort(this))
{
I am asking for verification / confirmation / explanation of this.
Is is conceptually acceptable in C++ which lacks inheritance?
At present I like to detect an event in settingsDialog ( have that working ) and execute a method in QMdiArea.
I can execute QMmdiArea from within the class, but my code to do so from SettignsDialog does not work.
I AM NOT ASKING FOR CODE!
I need better understanding of the "passing data " conceptually,
if there is RTFM I am game.
m_mdiarea(new QMdiArea(parent)),
m_settings(new SettingsDialog(parent)),
What I have tried:
I get compilation errors when default - null pointer - is passed to derived class.