/[projects]/infoscreen/webview.cpp
ViewVC logotype

Diff of /infoscreen/webview.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

infoscreen/MyWebView.cpp revision 540 by torben, Sat Jan 9 15:22:14 2010 UTC infoscreen/webview.cpp revision 2103 by torben, Tue Feb 4 14:16:40 2014 UTC
# Line 1  Line 1 
1  #include <QApplication>  #include <QApplication>
2  #include <QDesktopWidget>  #include <QDesktopWidget>
3    #include <QtDebug>
4    
5    
6  #include <stdexcept>  #include <stdexcept>
7    
8  #include "MyWebView.h"  #include "webview.h"
9    
10    
11  MyWebView::MyWebView(QWidget* parent) : QWebView(parent) {                WebView::WebView(QWidget* parent) : QWebView(parent) {
     connect(this, SIGNAL( loadFinished(bool) ), this, SLOT( onChange(bool) ) );  
12    
13      QWebSettings* settings = QWebSettings::globalSettings();      QWebSettings* settings = QWebSettings::globalSettings();
14      settings->setAttribute( QWebSettings::JavascriptEnabled, true);      settings->setAttribute( QWebSettings::JavascriptEnabled, true);
15      settings->setAttribute( QWebSettings::PluginsEnabled, true);      settings->setAttribute( QWebSettings::PluginsEnabled, true);
16  }  }
17    
18  void MyWebView::start(QString url, QString screenid) {  void WebView::start(QString& url, QString& screenid) {
19      try {      try {
20          this->load( QUrl( generateUrl(url, screenid) ) );          this->load( QUrl( generateUrl(url, screenid) ) );
21      } catch (std::exception& e) {      } catch (std::exception& e) {
# Line 22  void MyWebView::start(QString url, QStri Line 24  void MyWebView::start(QString url, QStri
24    
25  }  }
26    
27  void MyWebView::showError(const char* msg) {  void WebView::showError(const char* msg) {
28      QString str("<html><body><center><h1>");      QString str("<html><body><center><h1>");
29      str.append(msg).append("</h1></center></body></html>");      str.append(msg).append("</h1></center></body></html>");
30      this->setHtml( str );      this->setHtml( str );
31  }  }
32    
33  QString MyWebView::generateUrl(QString url, QString screenid) {  QString WebView::generateUrl(QString& url, QString& screenid) {
34      QDesktopWidget* desktop = QApplication::desktop();      QDesktopWidget* desktop = QApplication::desktop();
35      QRect rect = desktop->screenGeometry();      QRect rect = desktop->screenGeometry();
36    

Legend:
Removed from v.540  
changed lines
  Added in v.2103

  ViewVC Help
Powered by ViewVC 1.1.20