I'm working on a project where I'm trying to send request to our webservice via REST requests. First I only connected the finished(QNetworkReply*) signal to a slot but since it never finished possible due to ssl issues I aslo tried to connect the sslErrors(QNetworkReply*, const QList<QSslError>&) slot as well since the request is https.
connect(&_accessManager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
this, SLOT(printSslErrors(QNetworkReply*, const QList<QSslError>&)));
Then in my print function I'm not able to access the error list in any way.
void AssetManager::printSslErrors(QNetworkReply *reply, const QList<QSslError>& errors) {
...
}
I'v tried:
const QSslError test = errors.at(0); // error on 'test'
QSslError test = errors.at(0); // error on 'test'
or
foreach(QSslError error, errors) {
qDebug() << error.errorString(); // error on 'errors'
}
for(int i = 0; i < errors.count(); i++) {
qDebug() << errors.at(i).errorString(); // error on 'errors'
}
which results in:
error C2079: 'test' uses undefined class 'QSslError'
error C2440: 'initializing' : cannot convert from 'const QSslError' to 'int'
or
error C2027: use of undefined type 'QSslError'
error C2228: left of '.toString' must have class/struct/union
also, that IntelliSense underlines errors or test with the message:
IntelliSense: incomplete type is not allowed
(Notice that it doesnt complain when I do errors.count())
I include <QSslError> in the headerfile...
I've been struggeling quite a lot with the sslError signal and a few weeks ago I was not even able to connect the signal to anything since it "doesn't exists". I'm I missing a module or something?
Thanks for your help
Edit:
Still getting the error:
Object::connect: No such signal QNetworkAccessManager::sslErrors(QNetworkReply*, const QList&)
Also, cannot check if I have Ssl
qDebug() << QSslSocket::supportsSsl();
Since QSslSocket is undefined even though it's included. It must something major that im missing here right? Do I have to install something? I am completly lost here :(