Created
September 3, 2015 19:25
-
-
Save anonymous/e326ccbeb14b92e85958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
QSharedPointer<QGuiApplication> app(SailfishApp::application(argc, argv)); | |
QSharedPointer<QQuickView> view(SailfishApp::createView()); | |
... | |
NetworkAccessManagerFactory* factory = new NetworkAccessManagerFactory; | |
view->engine()->setNetworkAccessManagerFactory(factory); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "networkaccessmanagerfactory.h" | |
QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent) | |
{ | |
m_networkManager = new QNetworkAccessManager(parent); | |
connect(m_networkManager,SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),this,SLOT(onIgnoreSSLErrors(QNetworkReply*,QList<QSslError>))); | |
return m_networkManager; | |
} | |
void NetworkAccessManagerFactory::onIgnoreSSLErrors(QNetworkReply *reply, QList<QSslError> error) | |
{ | |
reply->ignoreSslErrors(error); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef NETWORKACCESSMANAGERFACTORY_H | |
#define NETWORKACCESSMANAGERFACTORY_H | |
#include <QObject> | |
#include <QNetworkAccessManager> | |
#include <QNetworkReply> | |
#include <QQmlNetworkAccessManagerFactory> | |
#include <QSslError> | |
class NetworkAccessManagerFactory : public QObject,public QQmlNetworkAccessManagerFactory | |
{ | |
Q_OBJECT | |
public: | |
virtual QNetworkAccessManager *create(QObject *parent); | |
public slots: | |
void onIgnoreSSLErrors(QNetworkReply* reply,QList<QSslError> error); | |
private: | |
QNetworkAccessManager* m_networkManager; | |
}; | |
#endif // NETWORKACCESSMANAGERFACTORY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import Sailfish.Silica 1.0 | |
Page { | |
id: page | |
SilicaListView { | |
id: listView | |
anchors.fill: parent | |
header: PageHeader { | |
title: qsTr("Artists") | |
} | |
Image { | |
width: 100 | |
height: 100 | |
source: "https://www....png" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment