Hello!

Please, help me to solve this problem:

DownLoader.h:19: error: no matching function for call to 'Downloader::connect(std::shared_ptr<QNetworkReply >&, const char*, Downloader* const, const char*)'
* * * * * * * * *this, SLOT(replyFinished( ) ) );
Qt Code:
  1. #ifndef DOWNLOADER_H
  2. #define DOWNLOADER_H
  3.  
  4. #include <memory>
  5.  
  6. #include <QObject>
  7. #include <QString>
  8. #include <QNetworkReply>
  9. #include <QNetworkRequest>
  10. #include <QNetWorkAccessManager>
  11.  
  12. class Downloader : public QObject
  13. {
  14. * *Q_OBJECT
  15.  
  16. * *Downloader( )
  17. * *{
  18. * * * *connect( m_reply, SIGNAL( finished( ) ),
  19. * * * * * * * * this, SLOT( replyFinished( ) ) );
  20. * *}
  21.  
  22. * *void fetch( const QString &url )
  23. * *{
  24. * * * *m_reply.reset(m_manager->get( QNetworkRequest( QUrl( url ) ) ) );
  25. * *}
  26.  
  27. signals:
  28. * *void signalWithContent( QString * );
  29.  
  30. private slots:
  31. * *void replyFinished( )
  32. * *{
  33. * * * *QByteArray data = m_reply->readAll( );
  34. * * * *QString content( data );
  35. * * * *emit signalWithContent( &content );
  36. * *}
  37.  
  38. private:
  39. * *std::shared_ptr<QNetworkAccessManager> m_manager =
  40. * * * * * *std::make_shared<QNetworkAccessManager>( new QNetworkAccessManager( this ) );
  41.  
  42. * *std::shared_ptr<QNetworkReply> m_reply;
  43. };
  44.  
  45. #endif // DOWNLOADER_H
To copy to clipboard, switch view to plain text mode