Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to access Ssl error list from QNetworkAccessManager
    primarykey
    data
    text
    <p>I'm working on a project where I'm trying to send request to our webservice via REST requests. First I only connected the <code>finished(QNetworkReply*)</code> signal to a slot but since it never finished possible due to ssl issues I aslo tried to connect the <code>sslErrors(QNetworkReply*, const QList&lt;QSslError&gt;&amp;)</code> slot as well since the request is https. </p> <pre><code>connect(&amp;_accessManager, SIGNAL(sslErrors(QNetworkReply*, const QList&lt;QSslError&gt;&amp;)), this, SLOT(printSslErrors(QNetworkReply*, const QList&lt;QSslError&gt;&amp;))); </code></pre> <p>Then in my print function I'm not able to access the error list in any way. </p> <pre><code>void AssetManager::printSslErrors(QNetworkReply *reply, const QList&lt;QSslError&gt;&amp; errors) { ... } </code></pre> <p>I'v tried:</p> <pre><code>const QSslError test = errors.at(0); // error on 'test' QSslError test = errors.at(0); // error on 'test' </code></pre> <p>or</p> <pre><code>foreach(QSslError error, errors) { qDebug() &lt;&lt; error.errorString(); // error on 'errors' } for(int i = 0; i &lt; errors.count(); i++) { qDebug() &lt;&lt; errors.at(i).errorString(); // error on 'errors' } </code></pre> <p>which results in:</p> <blockquote> <p>error C2079: 'test' uses undefined class 'QSslError'<br> error C2440: 'initializing' : cannot convert from 'const QSslError' to 'int'</p> </blockquote> <p>or</p> <blockquote> <p>error C2027: use of undefined type 'QSslError'<br> error C2228: left of '.toString' must have class/struct/union</p> </blockquote> <p>also, that IntelliSense underlines <code>errors</code> or <code>test</code> with the message: </p> <blockquote> <p>IntelliSense: incomplete type is not allowed</p> </blockquote> <p>(Notice that it doesnt complain when I do <code>errors.count()</code>)</p> <p>I include <code>&lt;QSslError&gt;</code> in the headerfile... </p> <p>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?</p> <p>Thanks for your help</p> <p>Edit:</p> <p>Still getting the error:</p> <blockquote> <p>Object::connect: No such signal QNetworkAccessManager::sslErrors(QNetworkReply*, const QList&amp;)</p> </blockquote> <p>Also, cannot check if I have Ssl</p> <pre><code>qDebug() &lt;&lt; QSslSocket::supportsSsl(); </code></pre> <p>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 :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload