compile and work on qt 5.6 (this needs testing!) (#123)

* compile and work on qt 5.6 (this needs testing!)

* updated travis

* updated r2

* sync submodules wtf

* updated CMake files
This commit is contained in:
Duncan Ogilvie 2017-04-12 18:49:01 +02:00 committed by Hugo Teso
parent 5efc51d307
commit eae419ef3b
7 changed files with 28 additions and 28 deletions

View File

@ -4,11 +4,11 @@ sudo: require
dist: trusty dist: trusty
before_install: before_install:
- sudo add-apt-repository ppa:beineri/opt-qt532-trusty -y - sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y
- sudo apt-get update -qq - sudo apt-get update -qq
install: install:
- sudo apt-get -y install qt53base qt53webkit-examples - sudo apt-get -y install qt56base qt56webengine
- source /opt/qt5*/bin/qt5*-env.sh - source /opt/qt5*/bin/qt5*-env.sh
script: script:

View File

@ -11,7 +11,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebKit WebKitWidgets) find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebEngine WebEngineWidgets)
if(WIN32) if(WIN32)
@ -137,5 +137,5 @@ add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES}) add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
qt5_use_modules(iaito Core Widgets Gui WebKit WebKitWidgets) qt5_use_modules(iaito Core Widgets Gui WebEngine WebEngineWidgets)
target_link_libraries(iaito ${RADARE2_LIBRARIES}) target_link_libraries(iaito ${RADARE2_LIBRARIES})

View File

@ -11,8 +11,7 @@ win32 {
ICON = img/Enso.icns ICON = img/Enso.icns
QT += core gui webkit webkitwidgets QT += core gui widgets webengine webenginewidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QT_CONFIG -= no-pkg-config QT_CONFIG -= no-pkg-config

View File

@ -1055,7 +1055,7 @@ QTabBar::tab:hover {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="statsWebView" native="true"> <widget class="QWebEngineView" name="statsWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1104,7 +1104,7 @@ QTabBar::tab:hover {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="polarWebView" native="true"> <widget class="QWebEngineView" name="polarWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1187,9 +1187,9 @@ QTabBar::tab:hover {
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>QWebView</class> <class>QWebEngineView</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>QtWebKitWidgets/QWebView</header> <header>QtWebEngineWidgets/QWebEngineView</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>

View File

@ -11,10 +11,11 @@
#include <QScrollBar> #include <QScrollBar>
#include <QClipboard> #include <QClipboard>
#include <QShortcut> #include <QShortcut>
#include <QWebFrame> #include <QWebEnginePage>
#include <QMenu> #include <QMenu>
#include <QFont> #include <QFont>
#include <QUrl> #include <QUrl>
#include <QWebEngineSettings>
MemoryWidget::MemoryWidget(MainWindow *main) : MemoryWidget::MemoryWidget(MainWindow *main) :
QDockWidget(main), QDockWidget(main),
@ -69,17 +70,17 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
graph_bar->setVisible(false); graph_bar->setVisible(false);
// Hide graph webview scrollbars // Hide graph webview scrollbars
ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); ui->graphWebView->page()->runJavaScript("document.body.style.overflow='hidden';");
ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
// Allows the local resources (qrc://) to access http content // Allows the local resources (qrc://) to access http content
if (!ui->graphWebView->settings()->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls)) if (!ui->graphWebView->settings()->testAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls))
{ {
ui->graphWebView->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true); ui->graphWebView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
} }
// Debug console // Debug console
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); // For QWebEngine debugging see: https://doc.qt.io/qt-5/qtwebengine-debugging.html
//QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
// Add margin to function name line edit // Add margin to function name line edit
ui->fcnNameEdit->setTextMargins(5, 0, 0, 0); ui->fcnNameEdit->setTextMargins(5, 0, 0, 0);
@ -184,7 +185,7 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled())); connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled()));
connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled())); connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled()));
connect(ui->graphWebView->page()->mainFrame(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool))); connect(ui->graphWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool)));
} }
/* /*
@ -1520,7 +1521,7 @@ void MemoryWidget::create_graph(QString off)
ui->graphWebView->setUrl(QUrl("qrc:/graph/html/graph/index.html#" + off)); ui->graphWebView->setUrl(QUrl("qrc:/graph/html/graph/index.html#" + off));
QString port = this->main->core->config("http.port"); QString port = this->main->core->config("http.port");
ui->graphWebView->page()->mainFrame()->evaluateJavaScript(QString("r2.root=\"http://localhost:" + port + "\"")); ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:%1\"").arg(port));
} }
QString MemoryWidget::normalize_addr(QString addr) QString MemoryWidget::normalize_addr(QString addr)
@ -1929,7 +1930,7 @@ void MemoryWidget::frameLoadFinished(bool ok)
if (settings.value("dark").toBool()) if (settings.value("dark").toBool())
{ {
QString js = "r2ui.graph_panel.render('dark');"; QString js = "r2ui.graph_panel.render('dark');";
ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js); ui->graphWebView->page()->runJavaScript(js);
} }
} }
} }

View File

@ -11,7 +11,7 @@
#include <QDockWidget> #include <QDockWidget>
#include <QTreeWidget> #include <QTreeWidget>
#include <QTabWidget> #include <QTabWidget>
#include <QWebView> #include <QWebEngineView>
#include <QUrl> #include <QUrl>
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QMouseEvent> #include <QMouseEvent>
@ -40,8 +40,8 @@ public:
QTreeWidget *xrefToTreeWidget_2; QTreeWidget *xrefToTreeWidget_2;
QTreeWidget *xreFromTreeWidget_2; QTreeWidget *xreFromTreeWidget_2;
QTabWidget *memTabWidget; QTabWidget *memTabWidget;
QWebView *graphWebView; QWebEngineView *graphWebView;
QWebView *histoWebView; QWebEngineView *histoWebView;
Highlighter *highlighter; Highlighter *highlighter;
Highlighter *highlighter_5; Highlighter *highlighter_5;

View File

@ -933,7 +933,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="webSimpleGraph" native="true"> <widget class="QWebEngineView" name="webSimpleGraph" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1229,7 +1229,7 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="graphWebView" native="true"> <widget class="QWebEngineView" name="graphWebView" native="true">
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum> <enum>Qt::DefaultContextMenu</enum>
</property> </property>
@ -1629,7 +1629,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="fcnWebView" native="true"> <widget class="QWebEngineView" name="fcnWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1678,7 +1678,7 @@ QToolTip {
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="radarGraphWebView" native="true"> <widget class="QWebEngineView" name="radarGraphWebView" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -3036,9 +3036,9 @@ QToolTip {
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>QWebView</class> <class>QWebEngineView</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>QtWebKitWidgets/QWebView</header> <header>QtWebEngineWidgets/QWebEngineView</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>