@Chris-Kawa I did not realize I made a duplicate post , so I am adding my goof here . Sorry for wasting space.
I think I got the concept of containers, but I am obviously missing something else.
What am I missing in my code ?
Decaration
QList<const QBluetoothDeviceInfo* > RemoteDeviceInfo;
This works
RemoteDeviceInfo.append(&info);
// verify
text = "!!!!!!!!! DEBUG verify RemoteDeviceInfo \n";
text += " name \n";
text += RemoteDeviceInfo.at(0)->name();
qDebug() << text;
m_ui->plainTextEdit_8->appendPlainText(text);
// m_ui->plainTextEdit_3->appendPlainText(text
for(auto &device:RemoteDeviceInfo)
{
text = " BUILD range loop test ";
m_ui->plainTextEdit_8->appendPlainText(text);
text = " device name ";
text += device->name();
m_ui->plainTextEdit_8->appendPlainText(text);
}
when I attempt to verify RemoteDeviceInfo) using another method
it fails
if(!RemoteDeviceInfo.isEmpty()) passes OK
{
for (auto &device:RemoteDeviceInfo)
{
text = " For loop test ";
qDebug() << text;
text = " device address \n";
text += device->address().toString(); fails here
qDebug() << text;
m_ui->plainTextEdit_8->appendPlainText(text);
text = " device name \n";
text += device->name(); // >address().toString()
qDebug() << text;
m_ui->plainTextEdit_8->appendPlainText(text);
}
}
}
My debug shows no contents in RemoteDeviceInfo when used in another method.