diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-03-21 14:20:55 +0000 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-03-21 14:34:55 +0000 |
commit | 3b7e9c03126ad3b87a3d5c61ed7f939c8b0545d3 (patch) | |
tree | 84f06f49602a4b0b2e3f78c5cbff334cfc0d908f /gui | |
parent | 5570b0c59a0889f7d7f47ecf8ff814dde0a80085 (diff) |
gui: Use QTextBrowser instead of QWebView.
QWebView was deprecated in Qt 5.5 and removed in Qt 5.6. QTextBrowser
seems sufficient for our needs and avoids the hassle of making the code
compatible both with QWebView and QWebEngineView.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/CMakeLists.txt | 4 | ||||
-rw-r--r-- | gui/mainwindow.cpp | 14 | ||||
-rw-r--r-- | gui/mainwindow.h | 1 | ||||
-rw-r--r-- | gui/ui/mainwindow.ui | 15 |
4 files changed, 6 insertions, 28 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index b74e3ece..2746711a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -101,11 +101,11 @@ add_executable (qapitrace ${qapitrace_SRCS} ${qapitrace_UIS_H}) if (Qt5Core_VERSION_STRING VERSION_LESS 5.2.0) qt5_use_modules (qubjson Widgets) qt5_use_modules (qubjson_test Widgets) - qt5_use_modules (qapitrace Widgets WebKitWidgets) + qt5_use_modules (qapitrace Widgets Network) else () target_link_libraries (qubjson Qt5::Widgets) target_link_libraries (qubjson_test Qt5::Widgets) - target_link_libraries (qapitrace Qt5::Widgets Qt5::WebKitWidgets) + target_link_libraries (qapitrace Qt5::Widgets Qt5::Network) endif () target_link_libraries (qapitrace diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 129e634d..e1859973 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -40,8 +40,7 @@ #include <QToolBar> #include <QUrl> #include <QVBoxLayout> -#include <QWebPage> -#include <QWebView> +#include <QTextBrowser> typedef QLatin1String _; @@ -886,11 +885,6 @@ void MainWindow::leakTraceFinished(){ delete t; } -void MainWindow::openHelp(const QUrl &url) -{ - QDesktopServices::openUrl(url); -} - void MainWindow::showSurfacesMenu(const QPoint &pos) { QTreeWidget *tree = m_ui.surfacesTreeWidget; @@ -1005,9 +999,6 @@ void MainWindow::initObjects() m_ui.surfacesTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - m_ui.detailsWebView->page()->setLinkDelegationPolicy( - QWebPage::DelegateExternalLinks); - m_jumpWidget = new JumpWidget(this); m_ui.centralLayout->addWidget(m_jumpWidget); m_jumpWidget->hide(); @@ -1121,9 +1112,6 @@ void MainWindow::initConnections() SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), SLOT(showSelectedSurface())); - connect(m_ui.detailsWebView, SIGNAL(linkClicked(const QUrl&)), - this, SLOT(openHelp(const QUrl&))); - connect(m_ui.nonDefaultsCB, SIGNAL(toggled(bool)), this, SLOT(fillState(bool))); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 0378d2c0..1f1e5797 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -74,7 +74,6 @@ private slots: void showSettings(); void leakTrace(); void leakTraceFinished(); - void openHelp(const QUrl &url); void showSurfacesMenu(const QPoint &pos); void showSelectedSurface(); void saveSelectedSurface(); diff --git a/gui/ui/mainwindow.ui b/gui/ui/mainwindow.ui index 376f70e3..89fc378c 100644 --- a/gui/ui/mainwindow.ui +++ b/gui/ui/mainwindow.ui @@ -134,17 +134,15 @@ <widget class="QWidget" name="dockWidgetContents"> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QWebView" name="detailsWebView"> + <widget class="QTextBrowser" name="detailsWebView"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Ignored"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="url"> - <url> - <string>about:blank</string> - </url> + <property name="openExternalLinks"> + <bool>true</bool> </property> </widget> </item> @@ -790,13 +788,6 @@ <zorder>errorsDock</zorder> <zorder>backtraceDock</zorder> </widget> - <customwidgets> - <customwidget> - <class>QWebView</class> - <extends>QWidget</extends> - <header>QtWebKitWidgets/QWebView</header> - </customwidget> - </customwidgets> <resources> <include location="../qapitrace.qrc"/> </resources> |