Yes I've tried that (below). However, the portal now does not give an error, but it does not indicate that it loaded and the basemap made from the tiledLayer does not load either
Could it be the server I am trying to access? I'm entering my username and password as QStrings and don't enter any token like some error messages indicated I needed.
Credential* creds = new Credential(username, password, this);
Portal* portal = new Portal(QUrl("https://arcgis.com"), creds, this);
connect(portal, &Portal::doneLoading, this, [this](Error error){
if (!error.isEmpty()){
qDebug() << error.message() << error.additionalMessage();
}else{
qDebug() << "Portal loaded successfully";
}
});
portal->load();