graphicshybridview.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <QMessageBox>
  2. #include <QGraphicsSceneMouseEvent>
  3. #include <QWebFrame>
  4. #include <QNetworkProxyFactory>
  5. #include "hybridwebpage.h"
  6. #include "graphicshybridview.h"
  7. #include "hybridpluginmanager.h"
  8. #include "hybridfw_global.h"
  9. #if defined(Q_OS_SYMBIAN) && !defined(HAVE_NOKIAQTSDK)
  10. #include "sym_iap_util.h"
  11. #endif
  12. GraphicsHybridView::GraphicsHybridView(QMainWindow *parentWindow,QGraphicsItem *parent, QString identifier) :
  13. QGraphicsWebView(parent)
  14. {
  15. #if defined(Q_OS_SYMBIAN) && !defined(HAVE_NOKIAQTSDK)
  16. qt_SetDefaultIap();
  17. #endif
  18. // Find the default proxy for http connections, use the first item
  19. QList<QNetworkProxy> list = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(QUrl("http://www.google.com/")));
  20. if (list.count() >= 1)
  21. {
  22. QNetworkProxy::setApplicationProxy(list.at(0));
  23. }
  24. m_hybridWebPage = new HybridWebPage(this);
  25. connect(m_hybridWebPage->mainFrame(), SIGNAL(contentsSizeChanged(QSize)),
  26. this, SIGNAL(contentsSizeChanged(QSize)));
  27. this->setPage(m_hybridWebPage);
  28. m_pluginManager = new HybridPluginManager(this, parentWindow,identifier);
  29. m_pluginManager->initFrame(page()->mainFrame());
  30. }
  31. HybridPluginManager *GraphicsHybridView::plugins()
  32. {
  33. return m_pluginManager;
  34. }
  35. void GraphicsHybridView::enableLogging()
  36. {
  37. m_hybridWebPage->enableLogging();
  38. }