[Interest] Subclassing QNetworkAccessManager not working

Samuel Gaist samuel.gaist at edeltech.ch
Tue Nov 3 17:01:40 CET 2015


On 3 nov. 2015, at 16:51, "Jason H" <jhihn at gmx.com> wrote:

> I am experimenting with creating my own scheme. Per the documentation at http://doc.qt.io/qt-5/qnetworkaccessmanager.html#supportedSchemes I am to provide a protected slot, which will be hooked up by the MOC. However I am only ever getting the default implementation:
> I got:
> ("ftp", "file", "qrc", "http", "https", "data")
> I expected:
> ("aes")
> 
> Also, what's this "data" scheme it supports?
> 
> [Please no comments about using HTTPS, I'm already using HTTPS where appropriate]
> 
> #include <QNetworkAccessManager>
> 
> class EncryptingNetworkManager: public QNetworkAccessManager {
> public:
> 	EncryptingNetworkManager(QObject *parent = 0) : QNetworkAccessManager(parent)
> 	{
> 	}
> 
> protected slots:
> 	QStringList supportedSchemesImplementation() {
> 		QStringList schemes;
> 		schemes.push_back("aes");
> 		return schemes;
> 	}
> };
> 
> int main(int argc, char *argv[])
> {
> 	EncryptingNetworkManager enm;
> 	qDebug() << enm.supportedSchemes();
> ...
> 
> }
> 
> --
> Thanks
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Hi,

You have a signature error: it's a const method

Cheers
Samuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151103/025d2633/attachment.sig>


More information about the Interest mailing list