summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Péterffy <[email protected]>2015-07-12 17:32:00 +0200
committerGábor Péterffy <[email protected]>2015-07-12 17:32:00 +0200
commit20a691ee3365822fcfa33a6d71739acb66542ddb (patch)
tree701037385cf56ac8d6333e85a040353cb7822466
parentae0b249ad299983383a425211e6891ba7ee0197c (diff)
REVIEW: 124193
QT_NO_WEBKIT option
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/apps/CMakeLists.txt20
-rw-r--r--src/apps/marble_android/CMakeLists.txt40
-rw-r--r--src/apps/marble_android/main.cpp5
-rw-r--r--src/lib/marble/CMakeLists.txt54
-rw-r--r--src/lib/marble/LegendWidget.cpp4
-rw-r--r--src/lib/marble/MarbleLegendBrowser.cpp14
-rw-r--r--src/lib/marble/MarbleLegendBrowser.h5
-rw-r--r--src/lib/marble/NullLegendWidget.ui37
-rw-r--r--src/lib/marble/NullMarbleWebView.cpp21
-rw-r--r--src/lib/marble/NullMarbleWebView.h28
-rw-r--r--src/lib/marble/NullTinyWebBrowser.cpp34
-rw-r--r--src/lib/marble/NullTinyWebBrowser.h45
-rw-r--r--src/lib/marble/NullWebPopupWidget.ui80
-rw-r--r--src/lib/marble/PopupItem.cpp26
-rw-r--r--src/lib/marble/PopupItem.h5
-rw-r--r--src/lib/marble/cloudsync/RouteItemDelegate.cpp7
-rw-r--r--src/lib/marble/routing/RoutingInputWidget.cpp7
19 files changed, 397 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ae1c30..3543e3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,7 +90,6 @@ find_package(Qt5Quick)
find_package(Qt5OpenGL)
find_package(Qt5PrintSupport)
-
if(QTONLY)
# Forward the old QTONLY=TRUE option to the new WITH_KDE=FALSE
set(WITH_KF5 FALSE)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 78b83a3..591cfac 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -49,7 +49,12 @@ endif()
add_subdirectory( lib/marble )
add_subdirectory( lib/astro )
+
+#FIXME: Port to Android
+if(NOT ANDROID)
add_subdirectory( plugins )
+endif()
+
add_subdirectory( bindings )
configure_file(
diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt
index 8046d1a..1d7cb40 100644
--- a/src/apps/CMakeLists.txt
+++ b/src/apps/CMakeLists.txt
@@ -1,9 +1,11 @@
-add_subdirectory(marble-ui)
-add_subdirectory(marble-qt)
-add_subdirectory(marble-mobile)
-add_subdirectory(marble-kde)
-add_subdirectory(marble_android)
-
-if( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
- add_subdirectory(marble-touch)
-endif( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
+if (NOT ANDROID)
+ add_subdirectory(marble-ui)
+ add_subdirectory(marble-qt)
+ add_subdirectory(marble-mobile)
+ add_subdirectory(marble-kde)
+ if( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
+ add_subdirectory(marble-touch)
+ endif( QT_QTDECLARATIVE_FOUND OR Qt5Quick_FOUND )
+else()
+ add_subdirectory(marble_android)
+endif()
diff --git a/src/apps/marble_android/CMakeLists.txt b/src/apps/marble_android/CMakeLists.txt
index 92329dd..531c8a6 100644
--- a/src/apps/marble_android/CMakeLists.txt
+++ b/src/apps/marble_android/CMakeLists.txt
@@ -1,23 +1,23 @@
-if(ANDROID)
- set(marble_SRCS main.cpp)
- marble_qt4_automoc(${marble_SRCS})
+set(marble_SRCS main.cpp)
+marble_qt4_automoc(${marble_SRCS})
- add_library (marble_android SHARED ${marble_SRCS})
- set_target_properties(marble_android PROPERTIES VERSION 0.0.1)
+add_library (marble_android SHARED ${marble_SRCS})
+set_target_properties(marble_android PROPERTIES VERSION 0.0.1)
- target_link_libraries (
- marble_android
- ${Qt5Core_LIBRARIES}
- ${Qt5Xml_LIBRARIES}
- ${Qt5Widgets_LIBRARIES}
- ${Qt5PrintSupport_LIBRARIES}
- ${Qt5Network_LIBRARIES}
- ${Qt5WebKitWidgets_LIBRARIES}
- ${Qt5WebKit_LIBRARIES}
- ${MARBLEWIDGET}
- astro)
-
- include(../../../qt-android-cmake/AddQtAndroidApk.cmake)
- add_qt_android_apk(marble_android_apk marble_android DEPENDS "../../../../build/src/lib/marble/libmarblewidget-qt5.so" "../../../../build/src/lib/astro/libastro.so")
-endif(ANDROID)
+target_link_libraries (
+ marble_android
+ ${Qt5Core_LIBRARIES}
+ ${Qt5Xml_LIBRARIES}
+ ${Qt5Widgets_LIBRARIES}
+ ${Qt5PrintSupport_LIBRARIES}
+ ${Qt5Network_LIBRARIES}
+ ${Qt5WebKitWidgets_LIBRARIES}
+ ${Qt5WebKit_LIBRARIES}
+ ${MARBLEWIDGET}
+ astro)
+
+file(COPY "../../../data" DESTINATION "${CMAKE_BINARY_DIR}/src/apps/marble_android/assets")
+
+include(../../../qt-android-cmake/AddQtAndroidApk.cmake)
+add_qt_android_apk(marble_android_apk marble_android DEPENDS "../../../../build/src/lib/marble/libmarblewidget-qt5.so" "../../../../build/src/lib/astro/libastro.so")
diff --git a/src/apps/marble_android/main.cpp b/src/apps/marble_android/main.cpp
index f3f34c9..737b8b8 100644
--- a/src/apps/marble_android/main.cpp
+++ b/src/apps/marble_android/main.cpp
@@ -5,10 +5,11 @@
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
-// Copyright 2015 Gábor Péterffy <[email protected]>
+// Copyright 2015 Gábor Péterffy <[email protected]>
//
-#include <QtGui/QApplication>
+#include <QApplication>
+
#include "MarbleWidget.h"
int main(int argc, char ** argv)
diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt
index 8b36d08..94ff3da 100644
--- a/src/lib/marble/CMakeLists.txt
+++ b/src/lib/marble/CMakeLists.txt
@@ -50,6 +50,10 @@ if( QT5BUILD )
set(marblequick_SRCS MarbleQuickItem.cpp)
endif()
+if(QT_NO_WEBKIT)
+add_definitions(-DQT_NO_WEBKIT)
+endif()
+
set(marblewidget_SRCS
${geodata_SRCS}
${graphicsview_SRCS}
@@ -64,12 +68,10 @@ set(marblewidget_SRCS
LatLonBoxWidget.cpp
MarbleWidget.cpp
MarbleAbstractPresenter.cpp
- MarbleWebView.cpp
MarbleModel.cpp
MarbleMap.cpp
MarbleControlBox.cpp
MarbleColors.cpp
- MarbleDBusInterface.cpp
NavigationWidget.cpp
MapViewWidget.cpp
FileViewWidget.cpp
@@ -168,7 +170,6 @@ set(marblewidget_SRCS
StackedTileLoader.cpp
TileLoaderHelper.cpp
TileCreator.cpp
- TinyWebBrowser.cpp
#jsonparser.cpp
FileLoader.cpp
FileManager.cpp
@@ -286,10 +287,28 @@ set(marblewidget_SRCS
cloudsync/ConflictDialog.cpp
)
+
+if (QT_NO_WEBKIT)
+ LIST(APPEND marblewidget_SRCS
+ NullMarbleWebView.cpp
+ NullTinyWebBrowser.cpp
+ )
+else()
+ LIST(APPEND marblewidget_SRCS
+ MarbleWebView.cpp
+ TinyWebBrowser.cpp
+ )
+endif()
+
+if (NOT QT_NO_DBUS)
+ LIST(APPEND marblewidget_SRCS
+ MarbleDBusInterface.cpp
+ )
+endif()
+
set (marblewidget_UI
LatLonBoxWidget.ui
NavigationWidget.ui
- LegendWidget.ui
MapViewWidget.ui
CurrentLocationWidget.ui
FileViewWidget.ui
@@ -319,7 +338,6 @@ set (marblewidget_UI
routing/RoutingProfileSettingsDialog.ui
MapWizard.ui
MapThemeDownloadDialog.ui
- WebPopupWidget.ui
cloudsync/CloudRoutesDialog.ui
MarbleCloudSyncSettingsWidget.ui
MovieCaptureDialog.ui
@@ -329,6 +347,17 @@ set (marblewidget_UI
FormattedTextWidget.ui
ElevationWidget.ui
)
+if (QT_NO_WEBKIT)
+ LIST(APPEND marblewidget_UI
+ NullLegendWidget.ui
+ NullWebPopupWidget.ui
+ )
+else()
+ LIST(APPEND marblewidget_UI
+ LegendWidget.ui
+ WebPopupWidget.ui
+ )
+endif()
# FIXME: cleaner approach of src/lib/marblwidget/MarbleControlBox.* vs. marble.qrc
qt_add_resources(marblewidget_SRCS libmarble.qrc ../../apps/marble-ui/marble.qrc)
@@ -415,16 +444,28 @@ if( QT5BUILD )
set(marblequick_HDRS MarbleQuickItem.h)
endif()
+if (QT_NO_WEBKIT)
+ set(marble_WebKit
+ NullMarbleWebView.h
+ NullTinyWebBrowser.h
+ )
+else()
+ set(marble_WebKit
+ MarbleWebView.h
+ TinyWebBrowser.h
+ )
+endif()
+
install( FILES
${graphicsview_HDRS}
${marblequick_HDRS}
+ ${marble_WebKit}
AutoNavigation.h
BookmarkManager.h
DownloadRegion.h
DownloadRegionDialog.h
LatLonBoxWidget.h
MarbleWidget.h
- MarbleWebView.h
MarbleMap.h
MarbleModel.h
MarbleControlBox.h
@@ -451,7 +492,6 @@ install( FILES
TileId.h
TileCoordsPyramid.h
TileLevelRangeWidget.h
- TinyWebBrowser.h
QtMarbleConfigDialog.h
global.h
MarbleColors.h
diff --git a/src/lib/marble/LegendWidget.cpp b/src/lib/marble/LegendWidget.cpp
index b74373c..df8ba70 100644
--- a/src/lib/marble/LegendWidget.cpp
+++ b/src/lib/marble/LegendWidget.cpp
@@ -16,7 +16,11 @@
using namespace Marble;
// Ui
+#ifdef QT_NO_WEBKIT
+#include "ui_NullLegendWidget.h"
+#else
#include "ui_LegendWidget.h"
+#endif
#include "MarbleLegendBrowser.h"
diff --git a/src/lib/marble/MarbleLegendBrowser.cpp b/src/lib/marble/MarbleLegendBrowser.cpp
index f628b83..73bed40 100644
--- a/src/lib/marble/MarbleLegendBrowser.cpp
+++ b/src/lib/marble/MarbleLegendBrowser.cpp
@@ -27,8 +27,12 @@
#include <QStyle>
#include <QStyleOptionButton>
#include <QRegExp>
+
+#ifndef QT_NO_WEBKIT
#include <QWebFrame>
#include <QWebElement>
+#endif
+
#include <QTextDocument>
#include "GeoSceneDocument.h"
@@ -72,11 +76,13 @@ MarbleLegendBrowser::MarbleLegendBrowser( QWidget *parent )
d->m_suppressSelection = false;
#endif // Q_WS_MAEMO_5
+#ifndef QT_NO_WEBKIT
QWebFrame *frame = page()->mainFrame();
connect(frame, SIGNAL(javaScriptWindowObjectCleared()),
this, SLOT(injectCheckBoxChecker()));
page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
connect( this, SIGNAL(linkClicked(QUrl)), this, SLOT(openLinkExternally(QUrl)) );
+#endif
}
MarbleLegendBrowser::~MarbleLegendBrowser()
@@ -127,6 +133,7 @@ void MarbleLegendBrowser::initTheme()
void MarbleLegendBrowser::loadLegend()
{
+#ifndef QT_NO_WEBKIT
if (d->m_currentThemeId != d->m_marbleModel->mapThemeId()) {
d->m_currentThemeId = d->m_marbleModel->mapThemeId();
} else {
@@ -173,12 +180,15 @@ void MarbleLegendBrowser::loadLegend()
QTextDocument *document = new QTextDocument(page()->mainFrame()->toHtml());
d->m_marbleModel->setLegend( document );
}
+#endif
}
void MarbleLegendBrowser::injectCheckBoxChecker()
{
+#ifndef QT_NO_WEBKIT
QWebFrame *frame = page()->mainFrame();
frame->addToJavaScriptWindowObject( "Marble", this );
+#endif
}
void MarbleLegendBrowser::openLinkExternally( const QUrl &url )
@@ -374,6 +384,7 @@ QString MarbleLegendBrowser::generateSectionsHtml()
void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked )
{
+#ifndef QT_NO_WEBKIT
QWebElement box = page()->mainFrame()->findFirstElement("input[name="+name+']');
if (!box.isNull()) {
if (checked != d->m_checkBoxMap[name]) {
@@ -383,10 +394,12 @@ void MarbleLegendBrowser::setCheckedProperty( const QString& name, bool checked
}
update();
+#endif
}
void MarbleLegendBrowser::setRadioCheckedProperty( const QString& value, const QString& name , bool checked )
{
+#ifndef QT_NO_WEBKIT
QWebElement box = page()->mainFrame()->findFirstElement("input[value="+value+']');
QWebElementCollection boxes = page()->mainFrame()->findAllElements("input[name="+name+']');
QString currentValue="";
@@ -403,6 +416,7 @@ void MarbleLegendBrowser::setRadioCheckedProperty( const QString& value, const Q
}
update();
+#endif
}
}
diff --git a/src/lib/marble/MarbleLegendBrowser.h b/src/lib/marble/MarbleLegendBrowser.h
index 7e80c38..936eedb 100644
--- a/src/lib/marble/MarbleLegendBrowser.h
+++ b/src/lib/marble/MarbleLegendBrowser.h
@@ -19,7 +19,12 @@
#include <QString>
+
+#ifdef QT_NO_WEBKIT
+#include "NullMarbleWebView.h"
+#else
#include "MarbleWebView.h"
+#endif
#include "marble_export.h"
diff --git a/src/lib/marble/NullLegendWidget.ui b/src/lib/marble/NullLegendWidget.ui
new file mode 100644
index 0000000..bc7cd2d
--- /dev/null
+++ b/src/lib/marble/NullLegendWidget.ui
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LegendWidget</class>
+ <widget class="QWidget" name="LegendWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>332</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Legend</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="MarbleLegendBrowser" name="m_marbleLegendBrowser">
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MarbleLegendBrowser</class>
+ <extends>QWidget</extends>
+ <header>MarbleLegendBrowser.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/lib/marble/NullMarbleWebView.cpp b/src/lib/marble/NullMarbleWebView.cpp
new file mode 100644
index 0000000..de988ca
--- /dev/null
+++ b/src/lib/marble/NullMarbleWebView.cpp
@@ -0,0 +1,21 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2015 Gábor Péterffy <[email protected]>
+//
+
+#include "NullMarbleWebView.h"
+
+MarbleWebView::MarbleWebView(QWidget *parent):
+ QWidget(parent)
+{
+}
+
+void MarbleWebView::setUrl(const QUrl &url)
+{
+
+}
diff --git a/src/lib/marble/NullMarbleWebView.h b/src/lib/marble/NullMarbleWebView.h
new file mode 100644
index 0000000..54cf276
--- /dev/null
+++ b/src/lib/marble/NullMarbleWebView.h
@@ -0,0 +1,28 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2015 Gábor Péterffy <[email protected]>
+//
+
+#ifndef NULLMARBLEWEBVIEW_H
+#define NULLMARBLEWEBVIEW_H
+
+#include <QWidget>
+#include <QUrl>
+
+#include "marble_export.h"
+
+class MARBLE_EXPORT MarbleWebView : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit MarbleWebView(QWidget *parent = 0);
+ void setUrl(const QUrl & url);
+};
+
+#endif // NULLMARBLEWEBVIEW_H
+
diff --git a/src/lib/marble/NullTinyWebBrowser.cpp b/src/lib/marble/NullTinyWebBrowser.cpp
new file mode 100644
index 0000000..dae559c
--- /dev/null
+++ b/src/lib/marble/NullTinyWebBrowser.cpp
@@ -0,0 +1,34 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2015 Gábor Péterffy <[email protected]>
+//
+
+#include "NullTinyWebBrowser.h"
+#include <QByteArray>
+
+namespace Marble {
+
+TinyWebBrowser::TinyWebBrowser(QWidget *parent):
+ QWidget(parent)
+{
+}
+
+QByteArray TinyWebBrowser::userAgent(const QString &platform, const QString &plugin)
+{
+ return QByteArray();
+}
+
+void TinyWebBrowser::setWikipediaPath(const QString &relativeUrl)
+{
+}
+
+void TinyWebBrowser::print()
+{
+}
+
+}
diff --git a/src/lib/marble/NullTinyWebBrowser.h b/src/lib/marble/NullTinyWebBrowser.h
new file mode 100644
index 0000000..f70cfde
--- /dev/null
+++ b/src/lib/marble/NullTinyWebBrowser.h
@@ -0,0 +1,45 @@
+//
+// This file is part of the Marble Virtual Globe.
+//
+// This program is free software licensed under the GNU LGPL. You can
+// find a copy of this license in LICENSE.txt in the top directory of
+// the source code.
+//
+// Copyright 2015 Gábor Péterffy <[email protected]>
+//
+
+#ifndef NULLTINYWEBBROWSER_H
+#define NULLTINYWEBBROWSER_H
+
+// Qt
+#include <QByteArray>
+#include <QString>
+#include <QUrl>
+#include <QWidget>
+
+// Marble
+#include "marble_export.h"
+
+namespace Marble
+{
+
+class MARBLE_EXPORT TinyWebBrowser : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ explicit TinyWebBrowser( QWidget* parent = 0 );
+
+ static QByteArray userAgent(const QString &platform, const QString &plugin);
+
+ public Q_SLOTS:
+ void setWikipediaPath( const QString& relativeUrl );
+ void print();
+
+ Q_SIGNALS:
+ void statusMessage( QString );
+};
+
+}
+
+#endif
diff --git a/src/lib/marble/NullWebPopupWidget.ui b/src/lib/marble/NullWebPopupWidget.ui
new file mode 100644
index 0000000..0be5e25
--- /dev/null
+++ b/src/lib/marble/NullWebPopupWidget.ui
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WebPopupWidget</class>
+ <widget class="QWidget" name="WebPopupWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="1">
+ <widget class="QLabel" name="titleText">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="4">
+ <widget class="MarbleWebView" name="webView" native="true"/>
+ </item>
+ <item row="0" column="0">
+ <widget class="QToolButton" name="goBackButton">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="libmarble.qrc">
+ <normaloff>:/marble/webpopup/icon-arrow-back.png</normaloff>:/marble/webpopup/icon-arrow-back.png</iconset>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QToolButton" name="printButton">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="libmarble.qrc">
+ <normaloff>:/marble/webpopup/icon-print.png</normaloff>:/marble/webpopup/icon-print.png</iconset>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QToolButton" name="hideButton">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="libmarble.qrc">
+ <normaloff>:/marble/webpopup/icon-remove.png</normaloff>:/marble/webpopup/icon-remove.png</iconset>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>MarbleWebView</class>
+ <extends>QWidget</extends>
+ <header>NullMarbleWebView.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources>
+ <include location="libmarble.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/src/lib/marble/PopupItem.cpp b/src/lib/marble/PopupItem.cpp
index 8dd885c..487b8d2 100644
--- a/src/lib/marble/PopupItem.cpp
+++ b/src/lib/marble/PopupItem.cpp
@@ -13,11 +13,16 @@
#include "PopupItem.h"
#include "MarbleWidget.h"
-#include "MarbleWebView.h"
-#include <QPointer>
+#ifdef QT_NO_WEBKIT
+#include "NullMarbleWebView.h"
+#else
#include <QWebView>
#include <QWebHistory>
+#include "MarbleWebView.h"
+#endif
+
+#include <QPointer>
#include <QPrinter>
#include <QPrintDialog>
#include <QMouseEvent>
@@ -30,6 +35,7 @@
#include <QKeyEvent>
#include <QClipboard>
#include <qdrawutil.h>
+#include <QPainter>
namespace Marble
{
@@ -62,7 +68,9 @@ PopupItem::PopupItem( QObject* parent ) :
QPalette palette = m_ui.webView->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
m_ui.webView->setPalette(palette);
+#ifndef QT_NO_WEBKIT
m_ui.webView->page()->setPalette(palette);
+#endif
m_ui.webView->setAttribute(Qt::WA_OpaquePaintEvent, false);
m_ui.webView->setUrl( QUrl( "about:blank" ) );
@@ -70,8 +78,10 @@ PopupItem::PopupItem( QObject* parent ) :
connect( m_ui.webView, SIGNAL(urlChanged(QUrl)), this, SLOT(updateBackButton()) );
connect( m_ui.hideButton, SIGNAL(clicked()), this, SIGNAL(hide()) );
+#ifndef QT_NO_WEBKIT
// Update the popupitem on changes while loading the webpage
connect( m_ui.webView->page(), SIGNAL(repaintRequested(QRect)), this, SLOT(requestUpdate()) );
+#endif
}
PopupItem::~PopupItem()
@@ -97,7 +107,9 @@ void PopupItem::setUrl( const QUrl &url )
QPalette palette = m_ui.webView->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
m_ui.webView->setPalette(palette);
+#ifndef QT_NO_WEBKIT
m_ui.webView->page()->setPalette(palette);
+#endif
m_ui.webView->setAttribute(Qt::WA_OpaquePaintEvent, false);
requestUpdate();
@@ -107,7 +119,9 @@ void PopupItem::setContent( const QString &html, const QUrl &baseUrl )
{
m_content = html;
m_baseUrl = baseUrl;
+#ifndef QT_NO_WEBKIT
m_ui.webView->setHtml( html, baseUrl );
+#endif
requestUpdate();
}
@@ -330,7 +344,9 @@ void PopupItem::clearHistory()
{
m_content.clear();
m_ui.webView->setUrl( QUrl( "about:blank" ) );
+#ifndef QT_NO_WEBKIT
m_ui.webView->history()->clear();
+#endif
}
void PopupItem::requestUpdate()
@@ -342,6 +358,7 @@ void PopupItem::requestUpdate()
void PopupItem::printContent() const
{
#ifndef QT_NO_PRINTER
+#ifndef QT_NO_WEBKIT
QPrinter printer;
QPointer<QPrintDialog> dialog = new QPrintDialog(&printer);
if (dialog->exec() == QPrintDialog::Accepted) {
@@ -349,25 +366,30 @@ void PopupItem::printContent() const
}
delete dialog;
#endif
+#endif
}
void PopupItem::updateBackButton()
{
+#ifndef QT_NO_WEBKIT
bool const hasHistory = m_ui.webView->history()->count() > 1;
bool const previousIsHtml = !m_content.isEmpty() && m_ui.webView->history()->currentItemIndex() == 1;
bool const atStart = m_ui.webView->history()->currentItemIndex() <= 1;
bool const currentIsHtml = m_ui.webView->url() == QUrl( "about:blank" );
m_ui.goBackButton->setVisible( hasHistory && !currentIsHtml && ( previousIsHtml || !atStart ) );
+#endif
}
void PopupItem::goBack()
{
+#ifndef QT_NO_WEBKIT
if ( m_ui.webView->history()->currentItemIndex() == 1 && !m_content.isEmpty() ) {
m_ui.webView->setHtml( m_content, m_baseUrl );
} else {
m_ui.webView->back();
}
updateBackButton();
+#endif
}
QPixmap PopupItem::pixmap( const QString &imageId ) const
diff --git a/src/lib/marble/PopupItem.h b/src/lib/marble/PopupItem.h
index 4c65004..9947a78 100644
--- a/src/lib/marble/PopupItem.h
+++ b/src/lib/marble/PopupItem.h
@@ -18,7 +18,12 @@
#include <QLabel>
#include "BillboardGraphicsItem.h"
+
+#ifdef QT_NO_WEBKIT
+#include "ui_NullWebPopupWidget.h"
+#else
#include "ui_WebPopupWidget.h"
+#endif
class QPainter;
diff --git a/src/lib/marble/cloudsync/RouteItemDelegate.cpp b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
index 9670f1e..bbc8cef 100644
--- a/src/lib/marble/cloudsync/RouteItemDelegate.cpp
+++ b/src/lib/marble/cloudsync/RouteItemDelegate.cpp
@@ -1,9 +1,16 @@
#include "RouteItemDelegate.h"
#include <QPainter>
+
+#ifdef QT_NO_WEBKIT
+#include <QWidget>
+#else
#include <QWebView>
+#endif
+
#include <QApplication>
#include <QAbstractTextDocumentLayout>
+#include <QPainter>
namespace Marble {
diff --git a/src/lib/marble/routing/RoutingInputWidget.cpp b/src/lib/marble/routing/RoutingInputWidget.cpp
index 40c4aad..c35a99a 100644
--- a/src/lib/marble/routing/RoutingInputWidget.cpp
+++ b/src/lib/marble/routing/RoutingInputWidget.cpp
@@ -14,7 +14,13 @@
#include "MarbleLocale.h"
#include "MarblePlacemarkModel.h"
#include "RouteRequest.h"
+
+#ifdef QT_NO_WEBKIT
+#include "NullTinyWebBrowser.h"
+#else
#include "TinyWebBrowser.h"
+#endif
+
#include "BookmarkManager.h"
#include "MarbleModel.h"
#include "MarbleWidget.h"
@@ -36,6 +42,7 @@
#include <QToolButton>
#include <QKeyEvent>
#include <QDomDocument>
+#include <QPainter>
namespace Marble
{