Passing pointer issue
-
I would like to have an access between objects.
I can view both object when I do not pass "this " pointer, as shown in attached. .
I can test fill the "combo box" , no problem.When I add "this" pointer into Form_SetupLocalAdapte(this) r I can see only the "combo box", and nothing else.
Should I be able to pass ( replacing the default null pointer ) and return a pointer to the " Form_SetupLocalAdapter " - from calling code ?
At this point I am not coding for passing "connectt" messages, just like to have the pointer passing working.
.

-
whether it is safe or not will depend on architectural decisions: who should own the object, and what is its duration? and explicit use of this is only rarely needed, usually just to get around some weird syntactical dereferencing issue. in class instance methods this is implicit
-
I have changed "my architecture" and decided to pass only part of the data - QList.
//LocalAdapterAddressList FSLA = new Form_SetupLocalAdapter(); // LocalAdapterAddressList); FSLA = new Form_SetupLocalAdapter(LocalAdapterAddressList); // &LocalAdapterAddressList); FSLA->show();i also added a constructor to process the passed data (pointer )
public:
explicit Form_SetupLocalAdapter(QWidget *parent = nullptr);
explicit Form_SetupLocalAdapter(QList <*data_list>);
//LocalAdapterAddressListNow I am getting this error
/mnt/07b7c3f8-0efb-45ab-8df8-2a468771de1f/PROJECTS/RECOVERY/BLUETOOTH/SOURCE/CCC_SOURCE/terminal_SERIAL_BLUETOOTH_VER_1/terminal_SERIAL_BLUETOOTH/terminal_BLUETOOTH/form_setuplocaladapter.h:17: error: use of undeclared identifier 'data_list'
In file included from form_setuplocaladapter.cpp:1:
./form_setuplocaladapter.h:17:45: error: use of undeclared identifier 'data_list'
explicit Form_SetupLocalAdapter(QList <*data_list>);
^I am not familiar with "template" and have no idea how to fix this.
I have been RTFM and have not found a single example of passing template variable (object) as a parameter . All examples are about HOW to build template class. I do not need that, I already have a class I want to reuse.