QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgswebview.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  ----------------------------------------------------
4  date : 19.5.2015
5  copyright : (C) 2015 by Matthias Kuhn
6  email : matthias (at) opengis.ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSWEBVIEW_H
17 #define QGSWEBVIEW_H
18 
19 #include <QWidget>
20 #include <QPrinter>
21 
22 #ifdef WITH_QTWEBKIT
23 #include <QtWebKit/QWebView>
24 
25 class CORE_EXPORT QgsWebView : public QWebView
26 {
27  Q_OBJECT
28 
29  public:
30  explicit QgsWebView( QWidget* parent = 0 )
31  : QWebView( parent )
32  {}
33 };
34 #else
35 #include "qgswebpage.h"
36 
45 class CORE_EXPORT QgsWebView : public QWidget
46 {
47 
49  Q_OBJECT
50  public:
51  explicit QgsWebView( QWidget *parent = 0 )
52  : QWidget( parent )
53  , mSettings( new QWebSettings() )
54  , mPage( new QWebPage() )
55  {
56  }
57 
58  ~QgsWebView()
59  {
60  delete mSettings;
61  delete mPage;
62  }
63 
64  void setUrl( const QUrl& url )
65  {
66  Q_UNUSED( url );
67 
68  }
69 
70  void load( const QUrl& url )
71  {
72  Q_UNUSED( url );
73  }
74 
75  QWebPage* page() const
76  {
77  return mPage;
78  }
79 
80  QWebSettings* settings() const
81  {
82  return mSettings;
83  }
84 
85  void setHtml( const QString& html )
86  {
87  Q_UNUSED( html );
88  }
89 
90  virtual QgsWebView* createWindow( QWebPage::WebWindowType )
91  {
92  return new QgsWebView();
93  }
94 
95  void setContent( const QByteArray&, const QString&, const QUrl& )
96  {
97 
98  }
99 
100  void print( QPrinter* )
101  {
102 
103  }
104 
105  signals:
106 
107  public slots:
108 
109  private:
110  QWebSettings* mSettings;
111  QWebPage* mPage;
112 
114 };
115 #endif
116 
117 #endif // QGSWEBVIEW_H
The QWebPage class is a collection of stubs to mimic the API of a QWebPage on systems where QtWebkit ...
Definition: qgswebpage.h:99
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition: qgswebview.h:45
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
The QWebSettings class is a collection of stubs to mimic the API of a QWebSettings on systems where Q...
Definition: qgswebpage.h:36