Problem SSL Google Maps QWebview
-
Hi everyone,
I'm progamming a QWebView so as to display a local HTML file. This webpage is divided in an HTML part and a javascript one in order to display a Google Map. This HTML file is fine, it gives me the right result on Firefox. Nervetheless, when i put it in my QWebView, the map layer is ok but my custom overlays representing pie charts are gone. Moreover, I've got these errors in the console tab :
@QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_get_error
LEAK: 58 CachedResource
LEAK: 294 WebCoreNode@I'm aware that it is a SSL issue, but after many searches on Google I just can't manage to make my QwebView works. I've downloaded OpenSSL light version, even the complete one. I've put libeay32.dll, libssl32.dll and ssleay32.dll near my .exe file in my debug folder, but nothing happens. I've even copy all the dll files needed so as to launch my exe from the debug folder, nothing happens too.
If someone could give me a clear method to add SSL, it could be awesome. I've lost many hours (days ?) on it.
I'm on Qt 5.2.1, this is the standard code I'm using, maybe it could give you some clues.
@#include <QtGui>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->gmapView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true );
ui->gmapView->settings()->setAttribute(QWebSettings::PluginsEnabled,true);
ui->gmapView->settings()->setAttribute(QWebSettings::JavaEnabled,true );
ui->gmapView->settings()->setAttribute(QWebSettings::JavascriptEnabled,true );
ui->gmapView->settings()->setAttribute(QWebSettings::AutoLoadImages,true);
ui->gmapView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled,false);
ui->gmapView->settings()->setAttribute(QWebSettings::DnsPrefetchEnabled,true);
ui->gmapView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard,true);
ui->gmapView->settings()->setAttribute(QWebSettings::PrintElementBackgrounds,true);
ui->gmapView->settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled,true);QString fileName = qApp->applicationDirPath() + "/map.html"; if( !QFile(fileName).exists() ) { qDebug() << "File not found:" << fileName; } QUrl url = QUrl::fromLocalFile( fileName ); ui->gmapView->load( url );
}
MainWindow::~MainWindow()
{
delete ui;
}@.pro file
@QT += core gui webkit webkitwidgets network sql svg xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = carte
TEMPLATE = appCONFIG += openssl-linked
CONFIG += opensslSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui@
Firefox result :
Qt result :
Thanks a lot
-